Skip to content

feat: add 'Always show current HEAD on the left' option for commit graph#2330

Closed
heartacker wants to merge 1 commit intosourcegit-scm:developfrom
heartacker:feat/head-on-left
Closed

feat: add 'Always show current HEAD on the left' option for commit graph#2330
heartacker wants to merge 1 commit intosourcegit-scm:developfrom
heartacker:feat/head-on-left

Conversation

@heartacker
Copy link
Copy Markdown
Contributor

This PR adds a new option to the preferences that allows users to always show the current HEAD path on the leftmost column of the commit graph. This is especially useful in complex repositories with many parallel branches, as it ensures that the branch currently being worked on remains visually prominent and stable.

Key improvements:

  • Forward lineage pre-scanning to accurately identify the HEAD branch.
  • Column reservation mechanism to guarantee the leftmost slot for HEAD.
  • Dynamic path reordering to maintain consistency across rows.

@heartacker heartacker force-pushed the feat/head-on-left branch 2 times, most recently from 2a33824 to f4b4b87 Compare May 9, 2026 14:54
This feature ensures that the current HEAD lineage is always positioned in the leftmost column (Slot 0) of the commit graph.

Key technical improvements:
1.  **Forward Lineage Pre-scanning**: Correctly identifies HEAD and its descendants to ensure position stability even with complex parallel merges.
2.  **Absolute Column Reservation**: Reserves Slot 0 exclusively for the HEAD lineage, preventing other branches from occupying it.
3.  **Dynamic Slot Reordering**: Reorders the active path list in every row to keep the HEAD path at the visual start.
4.  **Optimized Layout**: Refined margin calculations to eliminate empty column gaps and ensure a compact, readable graph.
5.  **Clean Implementation**: Follows project standards with zero LINQ usage and preserved original code comments.

Includes UI toggle in Preferences and full localization (EN/ZH).
@heartacker heartacker force-pushed the feat/head-on-left branch from f4b4b87 to ddc1ef5 Compare May 9, 2026 16:19
@heartacker heartacker closed this May 10, 2026
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