Skip to content

Keep the clicked row visible when the diff pane opens over it - #85

Merged
danipen merged 1 commit into
mainfrom
fix-graph-pane-covers-selection
Jul 23, 2026
Merged

Keep the clicked row visible when the diff pane opens over it#85
danipen merged 1 commit into
mainfrom
fix-graph-pane-covers-selection

Conversation

@danipen

@danipen danipen commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Problem

Clicking a branch label (or commit) near the bottom of the Graph opens the diff pane under the stage — and the shrunk canvas swallowed the very thing that was just clicked. The selection ended up hidden behind the pane.

Fix

Arm a one-shot reveal when the selection changes: the resize the opening pane triggers consumes it and pans vertically, just enough to keep the clicked row — label pill, nodes and caption — above the fold.

  • Never a recenter or horizontal jump, so the user keeps their bearings; a row already clear of the pane doesn't move at all.
  • The reveal expires two frames after the selection, so splitter drags and window resizes stay entirely user-driven (they can still cover the selection — by the user's own hand, with no surprise pan).
  • The pan math lives in a pure revealRowDy(view, viewportHeight, row) in geometry.ts (unit-tested); GraphCanvas.tsx wires it into the existing ResizeObserver.

Validation

  • lint, typecheck, full bun test suite green (6 new tests for revealRowDy).
  • Drove the real app over CDP and reproduced the original scenario: clicking a bottom branch label now leaves the branch fully visible right above the pane, for both branch-label and commit-node clicks, with no console errors.

🤖 Generated with Claude Code

Selecting a commit or branch near the bottom of the Graph opens the
diff pane under the stage — and the shrunk canvas swallowed the very
thing that was just clicked. Arm a one-shot reveal on selection: the
pane-opening resize consumes it and pans vertically just enough to
keep the row's label, nodes and caption above the fold — never a
recenter or horizontal jump, and it expires two frames later so
splitter drags and window resizes stay entirely user-driven.
@danipen
danipen merged commit adbda53 into main Jul 23, 2026
9 checks passed
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