Skip to content

feat(tui): reach the navigator tab row with ↑ and switch tabs there - #691

Merged
mohitranka merged 1 commit into
mainfrom
feat/navigator-tab-row
Sep 15, 2026
Merged

mohitranka merged 1 commit into
mainfrom
feat/navigator-tab-row

Conversation

@mohitranka

Copy link
Copy Markdown
Contributor

What

The navigator's tab row was pointer-only. Ctrl+1 / Ctrl+2 set the tab and Ctrl+E flips the pair, but nothing in the keyboard grammar ever touched the row itself — so Sessions | Files was a label rather than a control. ↑ at the first row of either tab's list now moves onto the row.

Behaviour

Key On the tab row
← / → switch Sessions / Files; the row keeps the keyboard
Enter / ↓ / Esc step back into the pane the active tab shows
Tab / Shift+Tab unchanged — still cycles blocks
anything else inert on the row
  • ↑ keeps its cursor meaning everywhere below the first row; the inline composer (n) and an open peek (Space) still own ↑ first.
  • The row is a sub-focus of the navigator column, never a block: it does not enter FocusBlock::ORDER, so it is never a Tab stop of its own.
  • Switching tabs from the row moves focus.block() to the pane the tab shows (TaskStrip / Search), so no invisible block owns keys; the session list / explorer paints as unfocused while the row is up, so exactly one thing on screen claims the keyboard.
  • normalize_focus drops the row when the keyboard leaves that pane, when the column collapses (narrow layout), or when an overlay opens.
  • An empty tree counts as "at the first row", so ↑ still reaches the row there; a tree with no selection yet is not, so the very first ↑ still selects row 0 exactly as before.
  • Pointer unchanged: clicking a tab switches tabs and focuses that tab's pane.

Design

FORGE-DESIGN §9.6 says the tab bar "shows which tab is active, not which block owns the keyboard". Making the row focusable needs exactly one exception, so this PR takes the smallest signal that cannot be confused with the active tab: while the row holds the keyboard both outlines step to the L3 accent (the same idiom §9.6 already uses for "search focus colours the border") while the active tab keeps its accent_soft ground and hue. No marker glyph, no underline, labels stay centred.

Updated: §7.7 (navigator bullet + frontmatter binding), §8.3 (grammar table + prose), §8.4 (L3 list), §9.6 (the exception), README.md, and the F1 help hints for the three navigator blocks.

Tests

  • cargo test --package forge-tui --locked tab_row — reaching the row from the session list and from the tree, the cursor still moving below the top row, arrows switching tabs without leaving the row, ↓ handing the keyboard (and the search caret) back, Tab cycling from the row, session verbs staying inert, the row clearing when the navigator is left, and no row without a repository.
  • --locked outlines — the widget test for the focused outline, and that the active tab's ground is untouched by it.
  • Neighbours green on top of bd9d12d1: multi_task 36, focus 71, explorer 59, mouse 27, navigator 20, help 8, characterization 3.
  • cargo fmt --all -- --check and cargo clippy --package forge-tui --all-targets --locked -- -D warnings clean.

One pre-existing local failure is host noise unrelated to this change (app::tests::chrome::completed_turn_renders_unfinished_checks_without_claiming_failure, a sandbox/environment issue seen before this branch existed).

Authored with Forge.

The navigator's tab row was pointer-only: `Ctrl+1`/`Ctrl+2` set the tab, and nothing
in the keyboard grammar ever touched the row itself.

`↑` at the first row of either tab's list now moves onto the row: `←`/`→` switch
`Sessions`/`Files`, `Enter`/`↓`/`Esc` step back into the pane the active tab shows,
and every other key is inert there, so no session verb fires from a row that covers
the list. `↑` keeps its cursor meaning everywhere below the first row, and the inline
composer and an open peek still own it first.

The row is a sub-focus of the navigator column, not a block: it never enters
`FocusBlock::ORDER`, so `Tab`/`Shift+Tab` still cycle blocks from it and it is never
a Tab stop. Switching tabs from the row moves `focus.block()` to the pane the tab
shows, so no invisible block owns keys, and `normalize_focus` drops the row as soon
as the keyboard leaves that pane.

`FORGE-DESIGN` §9.6 said the tab bar shows which tab is active, "not which block owns
the keyboard". That invariant needs one exception: while the row holds the keyboard
both outlines take the L3 accent (the same idiom §9.6 already uses for the focused
search field) while the active tab keeps its `accent_soft` ground. §8.3, §8.4 and
§7.7 are updated to match, and the pane under the row paints unfocused so exactly one
thing on screen claims the keyboard.

Tests: reaching the row from the list and from the tree, the cursor still moving
below the top row, arrows switching tabs without leaving the row, `↓` handing the
keyboard (and the search caret) back, `Tab` cycling from the row, session verbs
staying inert, the row clearing when the navigator is left, no row without a
repository, and a widget test for the focused outline.
@mohitranka
mohitranka merged commit 27c4d12 into main Sep 15, 2026
3 checks passed
@mohitranka
mohitranka deleted the feat/navigator-tab-row branch September 15, 2026 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant