Repository navigation
Preserve Git history lanes through unrelated roots - #26932
Conversation
Carry unrelated lanes through root commits and share node color selection between labels and the graph. Keep the renderer's output cursor aligned when a root has no replacement parent edge. Cover both root positions, real unrelated Git histories, rendered paths and colors, truncated history, and existing boundary/read-budget behavior. Co-authored-by: Matheus Breguêz <matbrgz@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to No actionable issue remains in this review scope; the change is mergeable after normal checks. Pre-merge checks |
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
b1521a22-60d9-45a9-85ff-6dad36904bda
📒 Files selected for processing (5)
src/renderer/src/components/right-sidebar/source-control/sync/git-history-graph-svg.test.tsxsrc/renderer/src/components/right-sidebar/source-control/sync/git-history-graph-svg.tsxsrc/shared/git-history-graph.test.tssrc/shared/git-history-graph.tssrc/shared/git-history-real-repository.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
ELI5
When a repository merges two unrelated histories, the Commits graph can lose one history's line and restart it in another color. Keep that line connected until its own history ends.
What Changed
Root commits now end only their own graph lanes. The renderer follows the remaining lanes without skipping an output position, and commit dots and reference labels use the same color rule. Regression tests exercise real unrelated Git repositories and the rendered SVG.
Why
The shared graph model dropped every active lane at a root. Repairing that model and its existing renderer preserves the relationship for local and remote histories without changing Git queries, parsing or history ordering. This also avoids introducing another layout implementation.
Based on the material repair in #25361 by @matbrgz, credited as a co-author with the name and email from the original commits.
Linked Issue
Fixes #25360
Visual Proof
Actual hidden Electron Commits panel, same four-commit repository and renderer bounds. Before: the first history disconnects below the unrelated root and changes color. After: its blue lane continues through that root and the remaining commits.
Before:
After:
Testing
Initial macOS validation at
67f9556d4f01dad2e65708aff5bf5eeaabc7c303: actual hidden Electron Commits panel; canonical Bun and native Node each pass the same six suites / 41 tests, including two real Git repositories, parser, allocation, graph, read-budget and SVG checks. Web and Node typechecks, production Electron build, changed-file lint, formatting and all seven changed-code quality gates pass.Native Windows and Linux: the same six suites / 41 tests pass at
67f9556d4f01dad2e65708aff5bf5eeaabc7c303, including both native Git temporary-repository cases. Windows uses Node24.18.0and Git2.55.0.windows.3; Linux uses Node26.8.1and Git2.55.0. Both use Vitest5.0.3, their own locked dependency folders, andORCA_BACKGROUND_LAUNCH=1. These checks cover source and SVG fixtures; actual hidden Electron proof above is macOS only. No live SSH renderer claim; host routing, Git commands and wire formats are unchanged.Review-bot follow-up at
355e537c0af87f79db06332c1ef4bdaf69bdd3a0: the real-Git fixture clears inherited Git environment variables before applying its own config and dates. Two regressions reproduce repository redirection and config injection using disposable caller repositories, then verify those callers' HEAD, config, index and refs remain unchanged. Both fail before the isolation fix; all 35 tests in four fixture/history suites pass afterward. Node typecheck, full-file lint, formatting and changed-code quality checks pass. This follow-up changes one test file; the production graph and rendered proof remain unchanged.Integration follow-up at
d4a06583cb24c0cc2ade92ac0aadfc457d01d65c: initial new-head CI exposed the original test import removed by the process-package migration on current main (TS2307 during the CLI build). A normal main merge and the existing public@orca/process-hostimport repair that boundary. The final six suites pass 43 tests, including allocation/read-budget and SVG controls; canonical CLI and Node typechecks, full-file lint/formatting, and all changed-code quality checks pass against the actual five-file PR diff. The original graph production files remain unchanged. The first CI failure is retained; the corrected commit starts ordinary CI without a retry.AI Disclosure
Review
Independent source/behavior and root final reviews are clean, including the final duplicate-root model and renderer controls.
Agent skill upstream boundary
Notes
No new production Git command or capability requirement. Real-repository tests use the existing cross-platform process wrapper and temporary paths. Existing graph colors and layout dimensions are retained.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)