feat(tui): full/compact view modes for the session list#939
Merged
Conversation
The session list gains a two-line full-card view alongside the existing one-line compact rows, mirroring the lineage section's full/compact pair: - Full mode adds a muted detail line under each session name: model and reasoning effort, a four-cell context-window gauge with percentage, activity (live busy time while running, coarse age otherwise), lifetime token volume, and cost. Segments drop least-important-first on narrow sidebars; sessions reporting no usage data fall back to their directory. - Toggled by a clickable label on the pane's top border next to the ' + sessions ' title, with a hover tooltip; the choice persists across launches (tui-state.json, legacy blobs restore to compact). - Display rows and items are no longer 1:1, so the renderer records a row-to-item map used by click and diamond-hover hit-testing; gutter affordances (disclosure, pin) stay on a card's first line. Scroll limits, scrollbar geometry, and harness hover zones are measured in display rows. - Spec 0106 records the design decision.
…utton
Matches the lineage header's layout: ' compact \u{21c4} ' / ' full \u{21c4} '
sits immediately left of the ' \u{ab} ' collapse control instead of next to
the ' + sessions ' title.
Program feedback on the full session-list view: - The dollar amount no longer renders on the detail line (spec 0106 updated: cost is deliberately excluded). - The four-cell context gauge now rounds its fill to the nearest quarter instead of ceiling, so 54% reads as two cells rather than three.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a full/compact view-mode pair to the session list, mirroring the lineage section's precedent (spec 0106 records the decision):
busy 4m12swhile running, coarse2h agootherwise), and lifetime tokens (cost is deliberately excluded). The gauge's fill rounds to the nearest quarter so the bar tracks the percentage. Absent data is omitted; sessions reporting nothing (plain shells) fall back to their directory. On narrow sidebars, segments drop least-important-first (tokens → activity → model → gauge) instead of wrapping.compact ⇄/full ⇄label on the pane's top border, right-aligned immediately before the«collapse button — the same placement and label shape as the lineage header's toggle — with hover styling and a tooltip. The choice persists intui-state.json(legacy blobs restore to compact).LayoutSnapshot::list_visible_rows) used by click and pin-diamond-hover hit-testing; disclosure/pin gutters live on a card's first line only, while a click anywhere in the card selects it. Scroll clamping (App::list_max_scroll), scrollbar geometry, and harness hover zones are measured in display rows, so mixed-height items (one-line group headers among two-line cards) stay correct. As a side effect, diamond-hover now honors the scroll offset through the same map the click path uses.compact (unchanged, default)
full
full-mode video (busy timers ticking)
Both captured from the same seeded demo daemon at commit
c0d4f0b1fb7a27208081690ea257179a8b287a8d(sidebar dragged to 52 cols; at the default 40, tokens drop per the priority order).Testing
cargo test --workspacegreen locally (1069 cli + all other suites).list_max_scrolldisplay-row math, full-mode click mapping (detail-line click selects, gutter click on detail line doesn't pin), border-label toggle round trip, tui-state persistence round trip.🤖 Generated with Claude Code