Skip to content

fix(graph): merge edge starts at child lane, polish node + curve styling#5

Merged
poolcamacho merged 1 commit intomasterfrom
fix/commit-graph-merge-edge-and-styling
Apr 15, 2026
Merged

fix(graph): merge edge starts at child lane, polish node + curve styling#5
poolcamacho merged 1 commit intomasterfrom
fix/commit-graph-merge-edge-and-styling

Conversation

@poolcamacho
Copy link
Copy Markdown
Owner

Closes #3.

Bug

CommitGraphBuilder was recording each merge-parent edge with fromLane = parentLane, i.e. the lane the parent had just been pushed onto. Because the renderer draws the start half of an edge at the child's row, the curve was originating from the parent's future column instead of rising out of the merge commit. Visually, side branches looked disconnected from their origin and merge-back lines appeared to start in empty space.

Fix

fromLane now uses the child commit's lane for every parent edge (first parent and merges alike). The start curve sweeps from the merge node into whatever lane the side branch ends up on.

Drive-by polish

While in the canvas:

  • Split the body into edgePath(...) and drawNode(...) helpers (was a single 60-line block).
  • Edge stroke 1.5 -> 2.0pt.
  • Regular node diameter 8 -> 9px.
  • Merge nodes redrawn as a hollow ring + small inner dot so joins stay legible when vertical lane lines cross behind them.
  • Curve control points tuned so lane transitions feel like a smoother S.

Verification

  • xcodebuild build clean
  • swiftlint --strict clean
  • Manual: opened a repo with merges and confirmed branches now visibly originate from the merge commit; no edges floating in empty space.

…d curve styling

Closes #3.

The merge-parent edges were recorded with fromLane = parentLane (the
lane we had just chosen for the parent), which meant the start-of-edge
curve was drawn at the parent's future column instead of rising from
the merge commit. Side branches looked disconnected from their origin,
and merge-back lines appeared to start mid-air on the wrong side.

fromLane now tracks the child commit's lane for every parent edge, so
the curve visibly leaves the merge node and sweeps into the side lane.

While in the file, split the Canvas body into edgePath() and drawNode()
helpers, bump edge stroke to 2pt, bump regular node diameter to 9px,
and change merge node styling to a hollow ring plus a small inner dot
so joins stay readable over crossing lane lines.
@poolcamacho poolcamacho merged commit 1305b72 into master Apr 15, 2026
3 checks passed
@poolcamacho poolcamacho deleted the fix/commit-graph-merge-edge-and-styling branch April 15, 2026 09:18
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.

In the graph, the origin of a branch is displayed incorrectly.

1 participant