feat(chat): add a conversation minimap for turn navigation - #359
Merged
Conversation
The chat minimap needs the same side-capable fork the sidebar already had; move it up instead of copying the popup's class list a third time.
Row offsets, imperative scrolling, and a scroll callback, so a viewport-pinned overlay can navigate the stream. The named container sizes such overlays against the pane rather than the window.
Dock-style magnification falloff and the rail's own scroll position, kept pure so the curve and the clamping are testable without layout.
One evenly spaced tick per turn in the reading column's left gutter, magnifying under the pointer, previewing the turn on hover, and jumping to it on click. Ticks are indexed rather than proportional because a virtualized row's offset is an estimate until it mounts.
Surfaces that only misbehave at length — the minimap rail's own scrolling, the virtualizer's windowing — were unreachable in dev without a real agent. Emitted in one burst; turn sizes vary so the rail shows an uneven rhythm.
Tightened after driving it in the desktop app: everything shrinks a notch, magnification acts on width alone (a 2px hairline swelling in height reads as a blob), off-screen turns rest at the hairline tone and no longer lift when the rail is hovered, and a thread with a single turn hides the rail entirely.
AprilNEA
requested review from
SukkaW,
Zerlight and
lucas77778
and removed request for
Zerlight
July 31, 2026 14:27
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f4cf7830fb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
SukkaW
approved these changes
Jul 31, 2026
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 turn-navigation rail — a conversation minimap — in the reading column's left gutter. One tick
per turn; hovering a tick magnifies it and its neighbours and opens a preview of that turn; clicking
jumps to it. Closes CODE-517.
It is not a scrollbar and does not replace one. The native scrollbar answers "where am I in the
pixel stream"; the rail answers "what turns is this thread made of, and which one do I want". Inside
a single long turn the rail is deliberately static — the scrollbar is the only thing that moves
there, which is why it stays.
Ticks are evenly spaced, not proportional to document height. Under virtualization an unmounted
row's offset is an estimate that shifts as it measures, so mapping ticks to document position makes
them drift while you scroll. Index spacing also keeps every hit area the same size regardless of how
long a turn is.
Two facts made this much smaller than expected:
ConversationViewalready virtualizes overTurnSegment[], so a tick index is a virtualizerindex — there is no mapping layer.
use-stick-to-bottomneeds no coaxing: scrolling up setsescapedFromLock, so an upward jumpunpins itself, and a downward jump only re-pins within 70px of the bottom — exactly the behaviour
you want when clicking the last tick. Zero mitigation code.
No new dependencies. The preview card is base-ui's
PreviewCard(already vendored in coss-ui), usedwith
createHandle()+ detached triggers so one card serves every tick and only the open turn'sexcerpt is ever built.
Commits
refactor(ui)preview-card-popup.tsxasSidePreviewCardPopup, rather than copy its class list a third time. Behaviour unchanged for both sidebar call sites.feat(chat)ConversationContentexposes the virtualizer handle and a scroll callback; the conversation root becomes a named container so viewport-pinned overlays size against the pane, not the window.feat(chat)feat(chat)feat(mock)fix(chat)Notes for review
pointermove, not throughstate — a continuous per-frame value across every tick would otherwise re-render the whole rail
each frame. Resting width lives in a class rather than
styleso a re-render mid-hover cannotclobber it; that collision caused a visible snap-back before it was fixed.
either with an effect (
sukka/react-no-use-effect-watching). Before the first scroll every turn istreated as on-screen — correct for a thread too short to scroll, and corrected immediately by the
initial jump to bottom on one that isn't.
useMemo, notuseSingleton.sukka/react-no-use-state-as-refpushes towarduseSingleton, but base-ui reads the handle during render andreact-hooks/refsrejects that. Thetwo rules conflict here;
useMemosatisfies both.justify-center. A centered flex column clips its first item once thecontent outgrows the scroll container, which would make the top tick permanently unreachable.
overflow-y-automakes the x axis clip too, soa column narrower than a fully magnified tick would cut it off.
bg-border). Thelabel-*tiers are built for textand all sit too high for a fill this small; the front-end rules exempt fills from the
no-ad-hoc-opacity rule, but a semantic token is still better than a raw opacity.
where it would be pure decoration.
Verification
pnpm check:ciandpnpm test(2243 passed) both green.Driven in the desktop app against the new 48-turn mock thread — magnification feel, tick states,
preview content, click-to-jump, and the rail following the viewport were all judged there over
several tuning rounds, which is where the final shape came from.
Measured in the browser (mock webview, no daemon):
button "Turn N"per tick.side=right, 376px wide (thew-96override beats the vendoredw-64), anchoredagainst the rail's right edge, title from the turn's user text, body rendered through Streamdown.
scrollHeight 1098 > clientHeight 687; atscrollTop 0the firsttick's top equals the rail's top (not clipped — the
justify-centertrap above); the last tickis fully reachable at the end; the rail's own scrollbar is not rendered.
150ms cubic-bezier(0.23, 1, 0.32, 1).Not covered by automated checks: the magnification is rAF-driven, and the headless browser pane
produces no animation frames, so its motion was only verifiable by hand in the desktop window. The
falloff curve itself is unit-tested.
Checklist
pnpm check:ciandpnpm testboth pass (pluscargo fmt/clippy/testfor Rust changes)WIRE_PROTOCOL_VERSIONis bumped — n/a, no wire change