feat: add 'Always show current HEAD on the left' option for commit graph#2330
Closed
heartacker wants to merge 1 commit intosourcegit-scm:developfrom
Closed
feat: add 'Always show current HEAD on the left' option for commit graph#2330heartacker wants to merge 1 commit intosourcegit-scm:developfrom
heartacker wants to merge 1 commit intosourcegit-scm:developfrom
Conversation
2a33824 to
f4b4b87
Compare
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).
f4b4b87 to
ddc1ef5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: