Skip to content

feat(tui): sessions rail with adaptive density and a shared strip data pass (U9) - #101

Merged
lg2m merged 2 commits into
feat/eng-849-u3-code-panelfrom
feat/eng-852-u9-sessions-rail
Sep 21, 2026
Merged

lg2m merged 2 commits into
feat/eng-849-u3-code-panelfrom
feat/eng-852-u9-sessions-rail

Conversation

@lg2m

@lg2m lg2m commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

U9: sessions rail with adaptive density and a shared strip data pass

Spec: docs/plans/tui-redesign.md (tier table, slice U9) Linear: ENG-852 (parent ENG-843)

Stacked on #100 (U3). Review the top commit only until #100 merges.

What changed (crates/qq-tui/src/view/sidebar.rs)

  • One O(sessions) pass, rail_entries(), produces grouped RailEntrys (group, unread, live flag, direct spend). Both sidebar() and agent_strip() consume it; the grouping logic exists once.
  • RailDensity::of(tier): Compact/Regular → one row per session (glyph, name, right-aligned N new badge); Wide/Ultra → a second muted row with the live tail (live_status_line: approval → tool verb → streamed text → activity) and the session's cost right-aligned ($0.12, from SessionSummary.accounting.direct). Quiet sessions with nothing to show stay one row at every density, which is what keeps every existing golden still.
  • Group order NEEDS YOU → WORKING → IDLE → DONE; tree order within a group. Glyph colors follow the attention rule: settled states are muted, accent marks an unseen finish.
  • layout.rs untouched: PanePref::Shown already forces the rail at Compact when width − rail ≥ 32; a test now pins it.
  • New Scene::Sessions (8 sessions across all four groups, child with a shell approval, two streaming, unread finish with spend, two idle, one seen-done) and five sessions-* goldens; 80×24 shows the strip.

Rail at 200×60 (excerpt)

│ NEEDS YOU  2
│ ● Refactor          1 new
│                     $0.12
│   ◇ Deploy helper
│      ◇ approve run
│
│ WORKING  2
│ ◐ Write tests       1 new
│    Adding a regressio...

How verified

  • cargo test -p qq-tui --all-features 279 lib + 5 golden (40 frames); fmt; clippy -D warnings.
  • New: group order, unread badge present/absent by focus, Regular one-row vs Wide two-row, strip and rail agree on counts/order, rail forced at Compact when it fits / strip otherwise.
  • No existing golden moved (a first draft gave every session a second row at Wide+ and moved 21 goldens; fixed).

Measurements (target/qq-perf/tui-U9-2026-09-20/, pinned core)

Gate Before After Budget
sessions_200_with_sidebar 33.6 µs 31.5 ±5 %
children_20_with_sidebar 56.3 57.1 ±5 %
steady_state_frame 21.1 21.3 ±5 %
golden_path 38.4 38.7 ±5 %
keystroke 26.6 26.3 ±5 %

A first cut with per-session lookups in the planner regressed sessions_200 to 37.0; folding live flag and cost into the single pass brought it under baseline.

Design notes

  • Density is keyed on Tier, not raw rail width: the rail is 28 columns from 112 cols on, so width alone cannot separate Regular from Wide.

Docs

  • docs/design/layout.md new § Sessions rail. Ledger receipt.

Compatibility

  • PROTOCOL / DESCRIPTOR / schema: unchanged.

…a pass (U9)

Slice U9 of docs/plans/tui-redesign.md (ENG-852), stacked on U2.

`rail_entries` walks the sessions once and both the rail and the agent
strip consume it, so group order and counts cannot drift. Density follows
the tier: one row per session (glyph, title, right-aligned accent unread
badge) at Regular, plus a muted tail + `$cost` row at Wide and Ultra for
sessions with a live status or reported spend. Glyph colors follow the
attention rule (warning/error only for a real pending or failed state).
New `Scene::Sessions` pins the rail at all five golden sizes; no existing
golden moved; render bench within noise (sessions_200 33.6 -> 31.5 us).
@lg2m
lg2m force-pushed the feat/eng-852-u9-sessions-rail branch from cf2c0a8 to 6ffd434 Compare September 21, 2026 07:20
@lg2m
lg2m added this pull request to stack #105 September 21, 2026 19:40
@lg2m
lg2m merged commit 400fb23 into main Sep 21, 2026
4 checks passed
@lg2m
lg2m deleted the feat/eng-852-u9-sessions-rail branch September 21, 2026 19:41
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