Repository navigation
feat: scroll the left pane when the sessions outgrow it - #45
Merged
Merged
Conversation
The session list dropped every row that did not fit. With fourteen sessions open the last ones were simply not drawn, and a jump key could select a row nobody could see. The list now starts at a row offset and scrolls. Rows have different heights — the title line and the branch line are both optional — so the offset counts tree rows and the placement walks the measured heights: sidebar_rows counts what fits from an offset, sidebar_max_offset stops the wheel at the row that puts the last one on the bottom edge, and sidebar_follow raises the offset until the selected row is inside. The wheel over the left pane moves the list. It used to fall through to the selected terminal's scrollback, which is not what the pointer was on. When the cross-session hits are showing, it moves those instead. Following happens only when the selected row changes, not every frame: every frame would undo the wheel the moment the hand left it. The clamp to the last usable offset does run every frame, since closing a session lowers it. Two coordinate systems meet in the drag-to-reorder path and used to coincide. sidebar_boundary now returns the tree row rather than the position inside the window, and sidebar_boundary_y converts back. The jump label is taken from the tree row as well, so the key a row wears is still the key that selects it. Rows outside the window now reconcile shown_working too. Leaving them stale made wants_redraw ask for a full redraw on every byte a session nobody could see printed. TERMIT_PROBE_OVERLAY=many renders the scrolled list for the eye check. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
tkc
force-pushed
the
feat/sidebar-scroll
branch
from
October 29, 2026 23:17
316b581 to
d758613
Compare
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.
The session list dropped every row that did not fit: with fourteen sessions
open the last ones were simply not drawn, and a jump key could select a row
nobody could see.
Stacked on #44 — it rewrote
sidebar_layout, which is exactly where thislands. GitHub will retarget this to
mainonce #44 merges.What it does
moves it; it used to fall through to the selected terminal's scrollback,
which is not what the pointer was on. When the cross-session hits are
showing, the wheel moves those instead.
Rows have different heights (the title line and the branch line are both
optional), so the offset counts tree rows and the placement walks the
measured heights. Three pure functions carry it, each with its own test:
sidebar_rows(what fits from an offset),sidebar_max_offset(the row thatputs the last one on the bottom edge — the wheel stops there rather than
scrolling into blank space),
sidebar_follow(raise the offset until theselected row is inside).
Following only happens when the selected row changes, not every frame.
Every frame would undo the wheel the moment the hand left it. The clamp to the
last usable offset does run every frame, since closing a session lowers it.
Two things the eye check caught
The visual gate is
TERMIT_PROBE_OVERLAY=many cargo run --release -- --probe out.png, added here: 21 sessions, the last one selected, the list scrolled.the window, so after scrolling
⌘1sat on a row that⌘1does not select— against what the README promises. Now taken from the tree row.
sidebar_boundaryreturns a position in the window;drop_rowtakes treerows. With a non-zero offset a dragged row would land that many places
away.
sidebar_boundarynow returns the tree row andsidebar_boundary_yconverts back.
Also
Rows outside the window now reconcile
shown_working. Leaving them stale madewants_redrawask for a full redraw on every byte a session nobody could seeprinted — pre-existing for the cut-off rows, but this change owns them now.
Gates
cargo fmt --checkclean,clippy --all-targets -D warningssilent,308 passed; 0 failed; 2 ignored(7 new).Not in this PR
No hint of how many rows are hidden above or below. The labels give it away
(
⌘Aat the top means you are nine rows down), and a counter is a separatedrawing change.
🤖 Generated with Claude Code