tui: configurable navigation presets — arrow+Enter vs vim-style #111

Closed
opened 2026-04-12 18:10:08 +00:00 by claude-desktop · 0 comments
Collaborator

User story

As a user who is not familiar with vim keybindings, I want to navigate loom-tui entirely with arrow keys and Enter, so that the TUI is accessible without memorizing hjkl mnemonics and single-letter shortcuts.

Problem

Arrow keys work inconsistently:

  • In some screens, j/k and arrows both work for list navigation
  • Global mnemonics (g=Gallery, s=Settings, e=Entities, p=Presets) consume single-letter keys that screens also use, causing unpredictable behavior depending on focus state
  • There is no Enter-to-select flow for the sidebar — screen switching requires memorizing letter shortcuts or using the command palette (Ctrl+P)
  • Arrow keys have no effect on the sidebar (it's display-only)

Acceptance criteria

Navigation presets

  • tui.toml supports a navigation_preset field: "vim" (default, current behavior) or "standard"
  • "standard" preset:
    • Arrow keys navigate all lists, grids, and form fields
    • Enter selects/confirms the focused item
    • Sidebar is focusable — Up/Down arrows switch screens when sidebar is focused
    • Tab cycles focus between sidebar → main content → overlays
    • Escape goes back / closes overlay / unfocuses
    • No single-letter global mnemonics (no g/s/e/p hijacking)
    • F-keys for actions: F1=help, F5=generate, etc.
  • "vim" preset: current behavior preserved exactly
  • Preset is applied at startup via the keybinds system (keybinds::defaults() vs keybinds::standard())

Sidebar navigation (both presets)

  • Sidebar items are selectable with Up/Down when sidebar is focused
  • Enter on a sidebar item navigates to that screen
  • Visual highlight shows the focused sidebar item
  • Tab/Shift-Tab cycles focus between sidebar and main content

Key conflict resolution

  • In "standard" mode, no single-letter key is bound globally — all single letters go to the active screen
  • In "vim" mode, global mnemonics only fire when the active screen doesn't consume the key (screen gets priority)
  • Document both presets in docs/keybindings.md

Out of scope

  • Custom per-key rebinding (already supported via tui.toml [keybinds] section)
  • Mouse navigation (separate ticket)
  • Gamepad/controller input

References

  • crates/loom-tui/src/keybinds.rs — keybind system, defaults() function
  • crates/loom-tui/src/config.rstui.toml parsing
  • crates/loom-tui/src/app.rsprocess_event() dispatch chain, handle_global_key()
  • crates/loom-tui/src/components/mod.rsSidebar widget
## User story As a user who is not familiar with vim keybindings, I want to navigate loom-tui entirely with arrow keys and Enter, so that the TUI is accessible without memorizing `hjkl` mnemonics and single-letter shortcuts. ## Problem Arrow keys work inconsistently: - In some screens, `j`/`k` and arrows both work for list navigation - Global mnemonics (`g`=Gallery, `s`=Settings, `e`=Entities, `p`=Presets) consume single-letter keys that screens also use, causing unpredictable behavior depending on focus state - There is no Enter-to-select flow for the sidebar — screen switching requires memorizing letter shortcuts or using the command palette (`Ctrl+P`) - Arrow keys have no effect on the sidebar (it's display-only) ## Acceptance criteria ### Navigation presets - [ ] `tui.toml` supports a `navigation_preset` field: `"vim"` (default, current behavior) or `"standard"` - [ ] `"standard"` preset: - Arrow keys navigate all lists, grids, and form fields - Enter selects/confirms the focused item - Sidebar is focusable — Up/Down arrows switch screens when sidebar is focused - Tab cycles focus between sidebar → main content → overlays - Escape goes back / closes overlay / unfocuses - No single-letter global mnemonics (no `g`/`s`/`e`/`p` hijacking) - F-keys for actions: F1=help, F5=generate, etc. - [ ] `"vim"` preset: current behavior preserved exactly - [ ] Preset is applied at startup via the keybinds system (`keybinds::defaults()` vs `keybinds::standard()`) ### Sidebar navigation (both presets) - [ ] Sidebar items are selectable with Up/Down when sidebar is focused - [ ] Enter on a sidebar item navigates to that screen - [ ] Visual highlight shows the focused sidebar item - [ ] Tab/Shift-Tab cycles focus between sidebar and main content ### Key conflict resolution - [ ] In `"standard"` mode, no single-letter key is bound globally — all single letters go to the active screen - [ ] In `"vim"` mode, global mnemonics only fire when the active screen doesn't consume the key (screen gets priority) - [ ] Document both presets in `docs/keybindings.md` ## Out of scope - Custom per-key rebinding (already supported via `tui.toml` `[keybinds]` section) - Mouse navigation (separate ticket) - Gamepad/controller input ## References - `crates/loom-tui/src/keybinds.rs` — keybind system, `defaults()` function - `crates/loom-tui/src/config.rs` — `tui.toml` parsing - `crates/loom-tui/src/app.rs` — `process_event()` dispatch chain, `handle_global_key()` - `crates/loom-tui/src/components/mod.rs` — `Sidebar` widget
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/loom#111
No description provided.