Fix real branches drawn as virtual - #2822
Conversation
Real branches (thick solid lines) can be drawn as virtual (thin dashed lines) when their tip is a part of another, newer branch. This commit solves this issue by splitting branch line drawing into two segments, dashed and solid.
|
| Filename | Overview |
|---|---|
| GitUpKit/Interface/GIGraphView.m | Adds virtual-line path splitting and transition-node rendering, but endpoint-only quadratic classification leaves a small dashed overlap at a curved transition. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Virtual graph line] --> B[Find first real node]
B --> C[Split path at node Y]
C --> D[Dummy prefix]
C --> E[Real branch portion]
D --> F[Thin dashed stroke]
E --> G[Solid branch-width stroke]
Reviews (1): Last reviewed commit: "Fix real branches drawn as virtual" | Re-trigger Greptile
| } else if ((start.y >= transitionY) && (end.y >= transitionY)) { | ||
| _AddQuadraticCurveSegmentToPath(dashedPath, start, control, end); |
There was a problem hiding this comment.
Quadratic transition remains dashed
When a virtual branch changes columns at its first real node, these endpoint checks assign the entire quadratic corner to dashedPath even though its control point extends below transitionY, causing a visible dashed overlap in the solid branch segment.
Knowledge Base Used: Commit graph rendering
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
This is a theoretical concern that does not apply to the actual path geometry in GitUp. This code will not run for the quadratic corner at the first real node, because its start.y > transitionY, control.y == transitionY, and end.y < transitionY. GIGraphView.m:882–920 constructs points on the opposite sides of the node, GIGraphView.m:988–996 uses the node as the control point, GIGraphView.m:1014 sets transitionY from the same node.
There was a problem hiding this comment.
You're right — with the actual path construction, this case is handled by the mixed-endpoint branch: start.y > transitionY, control.y == transitionY, and end.y < transitionY. The quadratic is monotonic across the transition, so _QuadraticCurveParameterForY finds the valid split and the solid portion begins at the transition rather than leaving a dashed overlap. My concern depended on a control point extending past transitionY, which GitUp does not generate here. I'll withdraw this comment.
Tip: You can customize Greptile's behavior for this repo with .greptile/rules.md and .greptile/config.json.
This PR fixes a long-standing bug where real branches (thick solid lines) are drawn as virtual (thin dashed lines) when their tip is a part of another, newer branch. The fix splits branch line drawing into two segments, dashed and solid.
Before:
After:
I AGREE TO THE GITUP CONTRIBUTOR LICENSE AGREEMENT