Skip to content

feat(tui): tell navigator tabs apart by ground and centre labels - #678

Merged
mohitranka merged 1 commit into
mainfrom
feat/navigator-tab-ground
Sep 14, 2026
Merged

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

Conversation

@mohitranka

Copy link
Copy Markdown
Contributor

Navigator tab selection (Sessions | Files) is now carried by the tab's own ground instead of an underline plus a reserved > cell.

What changed

  • The active tab fills with accent_soft across the whole tab box; its label keeps the accent hue at bold weight. No tab is underlined any more.
  • Both labels are centred in their own tab box — Sessions in its fixed 12-cell tab, Files in the remainder — so the axis is the tab's, not leftover space.
  • N need keeps its right edge and is dropped only when it would touch the centred label.
  • NavigatorTabs::focused is deleted rather than left as a no-op: it existed solely to draw the marker.

Deliberate tradeoffs

  1. The tab bar shows which tab is active, not which block owns the keyboard. On the Sessions tab that removes the last ownership cue, because the list already paints selected and focused rows identically (navigator.rs:194,209). That is recorded in FORGE-DESIGN.md §9.6 rather than left implicit.
  2. N need disappears between frame widths 116 and 125. The navigator is clamp(content_width / 4, 28, 37), so the centred label eats the badge's lane there; it fit when the label was left-aligned. The count returns at 126 and up, and the collapsed chip below files_fit() is unaffected.
  3. theme.rs::brand()'s "accent is a focus style" docstring is untouched. The FORGE-DESIGN token table already lists accent for "active structure", and §9.6 now names the active tab's accent as exactly that.

Tests

  • the_active_tab_is_told_apart_by_its_ground_alone — accent + bold + ground on the label, fill spans the tab box, nothing underlined.
  • each_label_is_centred_in_its_own_tab — pins absolute label columns at 40 cells.
  • the_badge_holds_the_right_edge_and_yields_to_a_narrow_tab — wide tab keeps both; narrow tab drops the badge rather than crowding the label.
  • navigator_tab_grounds_stay_apart_in_every_theme — new per-theme guard: accent_soft must stay separable from surface and surface_hover, so a future theme cannot collapse the active tab into an idle or hovered one.

Docs updated: §9.6 tab treatment, the §5 L3 lists, and invariant 11's marker list.

Local run

cargo test -p forge-tui: 1286 passed, 5 failed on this machine — all five are the host refusing nested confinement (background-command tests and the bash exit 127 case), unrelated to this diff and green in a normal environment. cargo fmt --all -- --check and cargo clippy -p forge-tui --all-targets -- -D warnings are clean.

The active navigator tab was marked by an accent underline plus a reserved
`>` cell in front of the label. Replace both with the tab's own ground: the
active tab fills with `accent_soft`, keeps the accent hue at bold weight, and
the label is centred in the tab box.

Consequences carried deliberately:
- The label no longer shifts when the tab gains focus, because there is no
  marker cell left to reserve.
- The tab bar now shows which tab is active, not which block owns the
  keyboard. On the Sessions tab that removes the only ownership cue, since
  the list already paints `selected` and `focused` rows identically.
- `N need` keeps its right edge and is dropped when the centred label would
  touch it, which happens between frame widths 116 and 125.

Add a per-theme guard that `accent_soft` stays separable from `surface` and
`surface_hover`, so a future theme cannot collapse the active tab into an
idle or hovered one (FORGE-DESIGN invariant 11, §9.6).
@mohitranka
mohitranka merged commit 4f5d574 into main Sep 14, 2026
3 checks passed
@mohitranka
mohitranka deleted the feat/navigator-tab-ground branch September 14, 2026 18:17
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