Repository navigation
refactor(tui): per-pane transcript state behind one visible pane (L2) - #94
Merged
Merged
Conversation
Slice L2 of docs/plans/tui-redesign.md (ENG-846). Structural only: the layout still produces one transcript slot, so frames and goldens do not move. - viewport::TranscriptPane owns a pane's View, Viewport, and live-row anchors; MAX_PANES = 3. App.panes + focused_pane replace App.view and App.viewport, reached through view()/set_view()/viewport()/pane(). - TranscriptCache keeps only what panes share (completed layouts, tool rows, live settled prefixes). body() takes the pane and returns a PaneUpdate; retain_visible prunes once per frame across every shown session; the layout bound is MAX_VISIBLE_MESSAGES * MAX_PANES so panes never evict each other. - FrameRenderer::frame zips the layout's slots with the pane window around the focus and commit writes every reconciled pane back; overlays paint into the focused slot. A pane following a deleted session renders the empty prompt. - The layout geometry struct is renamed TranscriptSlot. - docs/design/layout.md gains "Panes and state"; the ledger records the receipt and a root request for architecture.md. Tests: three new pane tests; 258 lib + 5 golden green. Bench within noise of L1 (steady_state_frame 22.0 us, resize_horizontal 32.9 us).
Collaborator
Author
|
Linear: ENG-846. Stacked PR #95 (U1) targets this branch; retarget to main after merge. |
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.
L2: per-pane transcript state behind one visible pane
Spec: docs/plans/tui-redesign.md#responsive-model Linear: ENG-846 (parent ENG-843)
Follows #87 (L1, merged). Structural slice: no user-visible change, goldens unchanged. It gives each transcript pane its own scroll and live-row state so L4 can show two or three sessions side by side, each independently scrollable.
What changed
viewport.rs:TranscriptPane { view, viewport, live_message_ranges },MAX_PANES = 3.app.rs:panes: Vec<TranscriptPane>+focused_panereplace the singleview/viewport; accessorsview(),set_view(),viewport(),pane(). Every scroll path (wheel, PageUp/Down, Shift-arrows, Ctrl-Home/End) goes through the focused pane;set_focus/Refocus/ResetSnapshotroute throughset_view.panes.len() == 1in this slice.view/transcript.rs:TranscriptCacheholds only state shared across panes (completed layouts keyed by width, tool rows, settled-prefix layouts).body(pane, …)returns aPaneUpdate;retain_visible(app, shown)prunes once per frame across all shown sessions; eviction bound raised toMAX_VISIBLE_MESSAGES × MAX_PANESso a second pane cannot thrash the first.view.rs:framezips layout slots with the pane window around focus, collectspane_updates,commitwrites them back. Overlays render into the focused slot only.view/layout.rs: the geometry struct is renamedTranscriptSlotto leaveTranscriptPanefor state.docs/design/layout.md: "Panes and state" section.How verified
cargo test --workspacegreen (qq-tui 258 lib + 5 goldens; goldens byte-identical)-D warnings/cargo check --workspace --all-targetspanes_on_different_sessions_scroll_independently,a_non_zero_pane_keeps_its_tail_anchor_when_its_live_message_settles,a_pane_following_a_deleted_session_shows_the_empty_promptMeasurements
target/qq-perf/tui-L2-2026-09-20/{baseline,after-3}.txt, same session:Design notes / deviations
preserve_tail_anchorfield on the pane: derived each frame from the pane's stored ranges and viewport, so it cannot go stale.tool_rowspruning is a scan over the shown sessions' calls rather than a per-frameHashSet(the set cost +1 µs ontool_calls_32_folded).TranscriptCachefor L4.Docs
docs/design/layout.md,docs/plans/progress/tui-redesign.md. Root request:architecture.md'sqq-tuibullet still says one cache "for the shown session".Compatibility