Skip to content

fix(tui): keep the terminal panel beside the workspace in the Tab cycle - #684

Merged
mohitranka merged 1 commit into
mainfrom
fix/tab-cycle-panel-order
Sep 14, 2026
Merged

mohitranka merged 1 commit into
mainfrom
fix/tab-cycle-panel-order

Conversation

@mohitranka

Copy link
Copy Markdown
Contributor

What

FocusBlock::ORDER put BottomPanel last in the Tab cycle. layout.rs docks the bottom panel under files+chat, never under the sidebar, so it is the centre column's second band rather than chrome — and its last position also put a conditional block on the wrap edge, so the number of Tab presses needed to travel between always-available blocks changed with the panel's open state.

New cycle, ordered by the layout's columns left to right and top to bottom inside each column, chrome last:

Sessions(TaskStrip) → Search → Files → CHAT(Workspace) → PANEL(BottomPanel) → Sidebar → Approval → Composer → Footer

Approval still sits in the sidebar group and enters the cycle only while a decision is pending.

Docs

The design doc and one help hint disagreed with the code, so they are corrected in the same change:

  • §8.3 listed ← / → as "previous/next tab within a block". No block implements arrow tab switching: navigator tabs are Ctrl+1 / Ctrl+2 in repository mode and Ctrl+E flips them; plain arrows keep their in-block meaning (session cursor, tree collapse/expand, footer chip, composer caret, PTY pass-through). The frontmatter previous-tab/next-tab keys said the same thing.
  • §7.7 claimed the tabs toggle by "focusing the navigator and pressing Tab/Enter" — Tab is block cycling and Enter attaches the selected session — and that ← opens the collapsed Sessions panel, which is a display-only chip.
  • The Composer's F1 hint promised Tab would reach the panel next; it now reads "Footer, then Sessions".

Tests

tab_cycles_visible_blocks_and_skips_hidden_ones now pins the new forward walk from Workspace: BottomPanel → Sidebar → Composer → Footer → wrap to Sessions → Search → Files → Workspace.

Local results on this machine: cargo test --package forge-tui --locked → 1290 passed / 5 failed, cargo fmt --all -- --check clean, cargo clippy --package forge-tui --all-targets -- -D warnings clean.

The 5 local failures are host-environmental and unrelated to this change (this host refuses sandbox confinement, which breaks the app::tests::tasks::* background-task tests plus chrome::completed_turn_renders_unfinished_checks_without_claiming_failure and turn::responsiveness_tests::tui_runtime_keeps_processing_while_a_tool_runs); neither of the latter two files contains a KeyCode::Tab, and FocusBlock::ORDER is read only by the cycle logic. 68/68 focus tests pass. CI is the authoritative run.

Arrow-key travel between panes (including a tab-row interaction) is deliberately out of scope: it needs a design decision and is left for a follow-up PR.

`FocusBlock::ORDER` put `BottomPanel` last, so a conditional block sat on the wrap edge and the panel read as chrome even though `layout.rs` docks it under `files`+`chat` only. Order the cycle by the layout's columns, left to right and top to bottom: TaskStrip, Search, Files, Workspace, BottomPanel, Sidebar, Approval, Composer, Footer. Chrome stays last, and conditional blocks stay inside their own group so the Tab-press count between always-available blocks never changes with the panel's open state.

Correct the documentation that disagreed with the code: 8.3 claimed plain left/right arrows switch tabs within a block (no block implements that; the navigator tabs are Ctrl+1/Ctrl+2 and Ctrl+E flips them in a repository), 7.7 claimed Tab/Enter switch tabs and that left-arrow opens the collapsed Sessions panel, and the Composer help hint promised Tab would reach the panel from the footer. Update the test that pins the cycle.
@mohitranka
mohitranka merged commit 5a561c3 into main Sep 14, 2026
3 checks passed
@mohitranka
mohitranka deleted the fix/tab-cycle-panel-order branch September 14, 2026 23:54
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