Skip to content

navigator: one shape per session state, one spinner, a reserved gutter - #709

Merged
mohitranka merged 3 commits into
mainfrom
feat/navigator-session-rows
Sep 17, 2026
Merged

mohitranka merged 3 commits into
mainfrom
feat/navigator-session-rows

Conversation

@mohitranka

@mohitranka mohitranka commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

What

The navigator's session list spoke three glyphs (● needs you, ◐ working, ○ idle) for eight states, so failed, cancelled and interrupted rows all rendered ○ idle, and working was a static quarter circle one shape away from the empty ring. That is the bug; the rest is the chrome the mockups asked for.

before after
○ idle · ◐ working · ● needs you, everything else ○ ○ ⣾ ● ⇥ list-local, ✓ ✗ ■ ∅ from TurnLifecycle
static running glyph, no motion braille spinner on the event-loop tick, staggered per row
selection = › + a one-line accent_soft ground ▌ bar in a reserved gutter + a ground across both lines
peek rendered as transcript that leaked into the column framed expanded row over a guided peek

Vocabulary

Eight states, one shape each, precedence attention → queued → working → lifecycle. The four outcomes borrow TurnLifecycle's symbols so the list and the transcript cannot disagree about how a turn ended; Waiting's old ! collides with Interrupted's, so Interrupted is now ∅ (first commit, with a test that no two lifecycles share a marker).

Motion

TuiApp::session_row_step, advanced in tick_render_state() while any session is working — not the wall clock (the turn line free-runs on SystemTime) and not BusyState::throbber() (it only ticks for the workspace-visible session, so a background turn would have frozen). Rows are staggered by index; the collapsed chip carries the same frame, since on a collapsed column it is the only thing separating in-flight from waiting.

Chrome

A row is five reserved cells and an elastic label (bar marker space glyph space label), so no state — selection, hover, expansion — can move another row's label (no_state_moves_the_label_column). The cursor cell is disclosure, not selection: › collapsed, ⌄ expanded, › under the pointer.

One deliberate deviation from the mock. The mock asked for an accent_soft selection ground muting to selection when the list loses the keyboard. Shipped instead: the neutral selection ground while the navigator holds the keyboard, and no ground (bar + weight step) when it does not. §8.4 bars filling the active block with accent, §8.6 pins selection as the strongest neutral ground so hover can never impersonate a selection (accent_soft would have become a fourth step above it), accent_soft already means "the active tab" one row up, and §8.5's "visible but muted" is spelled in the explorer as selection_inactive() — bar, weight step, no ground.

Peek

The expanded row is framed in a rounded accent box whose left edge takes the gutter and whose right edge the list's last column, so expanding moves nothing. The peek hangs below behind one guide rule: last answer ([forge.turn_failed] marker in the error hue), reply box, hairline, then the §6 hint grammar. The frame costs a line above and below, so it is drawn only when the whole block fits — a short pane falls back to the unframed layout rather than painting half a box (a_frame_that_does_not_fit_is_dropped_whole).

Second deviation. The hint row asks for the reply pair when both pairs do not fit. The shared grammar drops verbs before pairs, and the navigator is 25 columns wide at 120, so the grammar alone would have left the useless Enter Esc. Both pairs render from 30 columns. The mock's bordered Enter/Esc key chips stayed declined — hints.rs is the one hint grammar.

Design record

FORGE-DESIGN.md: §7.7 (table, reserved columns, selection grammar, framed row), §5.3 (one glyph means running, once), §4 rule 4, §8.6 (hover marker in the reserved marker cell), §9.3 — whose working meter claimed "one quarter-circle glyph from the same ◐◓◑◒ family the turn line speaks", false on both halves; the footer is a state word with a pulsing fixed-width ● and the turn line speaks braille. The design walkthrough under docs/mockups/session-rows/ is local (gitignored) and was refreshed to match what shipped.

Tests

Run, one filter per invocation:

  • cargo test --locked --package forge-tui --lib widgets::navigator — 35 (new: no_state_moves_the_label_column, selection_paints_the_bar_and_hover_never_does, the_selection_ground_covers_both_lines, an_unfocused_selection_keeps_the_bar_and_gives_up_the_ground, the_cursor_cell_shows_disclosure, the_expanded_row_is_framed_in_the_reserved_gutter, a_frame_that_does_not_fit_is_dropped_whole, a_failed_peek_line_colours_its_marker, the_peek_hints_keep_the_reply_verb_when_only_one_pair_fits)
  • app filters — multi_task 53, mouse 28, nav 66, peek 5, collapsed_chip 1
  • adjacent widgets — status 77, footer 51, throbber 1
  • cargo fmt --all -- --check — clean
  • cargo clippy --workspace --all-targets --locked -- -D warnings — clean

Not run locally: the full workspace suite (AGENTS.md forbids it for agents). CI's Test and format job runs on this PR and is green.

Commits

  1. fix(tui): the interrupted marker.
  2. feat(tui): the vocabulary, the motion and the row chrome (phases 1–4 of the plan).
  3. docs(design): the design record.

CI

Test and format pass · Dependency audit pass · cargo audit pass.

Mohit Ranka added 3 commits September 17, 2026 02:51
Waiting and Interrupted both rendered `!`, so "blocked on you" and "no recoverable runtime" — the two states an operator most needs apart — were the same glyph. Interrupted takes `∅`; a test now pins that no two lifecycles share a marker, with Ready the only one allowed none.
The navigator's session list is the only multi-session surface, and it spoke
three glyphs for eight states: failed, cancelled and interrupted rows all
rendered `○` idle, and `working` was a static quarter circle one state away from
the empty ring.

Phases 1-4 of the session-row plan (design record: FORGE-DESIGN.md §7.7; the
working notes under docs/mockups/session-rows/ are gitignored).

Vocabulary: eight row states, one shape each — `○` idle, the turn line's braille
spinner for working, `●` needs you, `⇥` queued (all four list-local), and
`✓ ✗ ■ ∅` borrowed from `TurnLifecycle` so the list and the transcript cannot
disagree about how a turn ended. Precedence is attention → queued → working →
lifecycle. This fixes the row that rendered `○` for failed, cancelled and
interrupted alike.

Motion: the running glyph steps on `TuiApp::session_row_step`, advanced by the
event-loop tick while any session is working — not the wall clock, and not
`BusyState::throbber()`, which only ticks for the workspace-visible session.
Rows are staggered by index so a column of running sessions is not one
metronome, and the collapsed chip carries the same frame.

Chrome: a row is five reserved cells and an elastic label
(`bar marker space glyph space label`), so no state — selection, hover,
expansion — can move another row's label. Selection is the accent bar in the
gutter plus a ground across both lines; the cursor cell is disclosure (`›`
collapsed, `⌄` expanded, and `›` again under the pointer). While the navigator
holds the keyboard the ground is the neutral `selection` step; when it does not,
the row keeps the bar and a weight step and gives up the ground (§8.5). The
mock's `accent_soft` wash is deliberately not used: §8.4 bars filling the active
block with accent, and §8.6 pins `selection` as the strongest neutral ground so
hover can never impersonate a selection.

Peek: the expanded row is framed in a rounded accent box whose left edge takes
the reserved gutter and whose right edge the list's last column; the peek hangs
below it behind one guide rule — last answer (a `[forge.turn_failed]` marker in
the error hue), reply box, hairline, then the §6 hint grammar. The frame is
drawn only when the whole block fits, so a short pane falls back to the unframed
layout rather than painting half a box. The hint row asks for the reply pair
when both pairs do not fit: the shared grammar drops verbs before pairs, which at
the navigator's 25 columns at 120 would have left the useless `Enter Esc`.

Tests run: `cargo test --locked --package forge-tui --lib <filter>`, one filter
per run — `widgets::navigator` 35, `multi_task` 53, `mouse` 28, `nav` 66, `peek`
5, `collapsed_chip` 1, `status` 77, `footer` 51, `throbber` 1; plus
`cargo fmt --all -- --check` and
`cargo clippy --workspace --all-targets --locked -- -D warnings` (clean).

Not run: the full workspace suite (AGENTS.md: agents must not).
§7.7's "only three states are user-facing" was the bug, written down: it named
`◐ working` for a row whose glyph can be eight different shapes. The section now
carries the shipped table, the reserved columns, the bar-plus-ground selection
grammar with its `§8.5` mute, the `›`/`⌄` disclosure split, and the framed
expanded row with its guide rule, reply box, hairline and hint row.

§9.3's working meter claimed "one quarter-circle glyph from the same ◐◓◑◒ family
the turn line speaks". Both halves were false — no quarter-circle rotation
exists in Forge, and the turn line speaks braille. The footer is a state word
with a fixed-width `●` whose brightness pulses. §5.3 now says once which glyph
means running (the braille family, on the list, the turn line and the chip), and
§8.6's hover marker moved from "the reserved gutter" to "the reserved marker
cell" so it matches §7.7's column grammar.
@mohitranka
mohitranka merged commit 04231d9 into main Sep 17, 2026
3 checks passed
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