Skip to content

Count label pill overhang in the graph's content size - #86

Merged
danipen merged 1 commit into
mainfrom
fix-graph-label-overflow
Jul 23, 2026
Merged

Count label pill overhang in the graph's content size#86
danipen merged 1 commit into
mainfrom
fix-graph-label-overflow

Conversation

@danipen

@danipen danipen commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Problem

A long branch name on a short row draws its label pill well past the row's last commit column — but contentSize measured commit columns only. Pan clamping (clampView) and fit both stop at that width, so the overhanging label was forever cut at the viewport edge: no amount of panning could reveal the rest of it.

Fix

contentSize now takes an optional label-width accessor and extends the diagram's width to cover each pill's rest rect (via labelRect) plus the right margin. GraphCanvas feeds it the measured widths (labelWidthFor), so both the pan clamp and fit-to-view account for every label.

Verified in the running app: at high zoom, panning fully right now brings the longest labels (fix-graph-label-overflow, fix-graph-pane-covers-selection) completely into view; fit shows the whole diagram including pills; no console errors.

Tests

  • contentSize grows to cover a pill overhanging its last column
  • contentSize is unchanged when labels fit inside their row span

🤖 Generated with Claude Code

A long branch name on a short row draws past its last commit column, but
contentSize measured columns only — pan clamping and fit stopped short, so
the overhanging label was forever cut at the viewport edge. Feed the
measured label widths into contentSize so every pill stays reachable.
@danipen
danipen merged commit 925e08a 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