Skip to content

feat(tui): full/compact view modes for the session list#939

Merged
edwin-zvs merged 8 commits into
mainfrom
session-list-full-mode
Jul 22, 2026
Merged

feat(tui): full/compact view modes for the session list#939
edwin-zvs merged 8 commits into
mainfrom
session-list-full-mode

Conversation

@edwin-zvs

@edwin-zvs edwin-zvs commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a full/compact view-mode pair to the session list, mirroring the lineage section's precedent (spec 0106 records the decision):

  • Full mode renders each session as a two-line card: the unchanged compact line, plus a muted detail line aligned under the name showing model·effort, a four-cell context-window gauge with percentage, activity (live busy 4m12s while running, coarse 2h ago otherwise), 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.
  • Toggle is a clickable 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 in tui-state.json (legacy blobs restore to compact).
  • Rows ≠ items now: the renderer records a display-row → item map (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)

compact

full

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 --workspace green locally (1069 cli + all other suites).
  • New tests: detail-line segments/fitting/formatters, mode-button geometry, list_max_scroll display-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

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.
@edwin-zvs
edwin-zvs merged commit e39aede into main Jul 22, 2026
1 check passed
@edwin-zvs
edwin-zvs deleted the session-list-full-mode branch July 22, 2026 03:47
@edwin-zvs edwin-zvs mentioned this pull request Jul 22, 2026
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