Repository navigation
Conversation
Add a `Local changes as graph node` option (in the graph advanced options menu, disabled by default). When enabled and the working copy has changes, a pseudo commit is inserted at the top of the history, linked to HEAD with a dashed line. - Selecting the node shows the full local changes view (stage, diff, commit) in the details panel - Selecting the node together with a commit compares that commit with the worktree - Context menu on the node: stash, discard all changes, open in the Local Changes page; double-click opens the Local Changes page - When the node disappears (commit, stash, discard) while selected, the current HEAD gets selected - Add translations for all locales Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Oh I did almost the same #2816 |
Author
|
One or another, I'm fine as it's merged!... |
This branch has not been deployed
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.
Summary
Adds an optional display mode that shows the working copy (local changes) as a node of the commit graph, "not yet attached" to the history, directly in the Dashboard view.
This allow us to see and commit current changes directly on the graph without needing to click on the "Loca changes" button on the left column. This feature exists in Gitkraken or Fork and is very convenient.
The option is disabled by default and can be toggled from the graph's advanced options menu (⚙ → Local changes as graph node). The existing Local Changes page is unchanged.
Behavior
When the option is enabled and the working copy has changes, a pseudo commit "Local changes (N)" is inserted at the top of the history:
HEADwith a dashed line. Only that link is dashed; the rest of the branch is drawn as usual.HEADis selected (then the newHEADonce commits are refreshed).HEADis not part of the loaded history (branch filters, commit limit).Ctrl+Cignores it.Implementation
Models.LocalChangesNode: newCommitsubclass with a sentinel SHA and an observableCount;Commit.IsLocalChanges(virtual) is used by views and graph.ViewModels.Histories: inserts/removes/updates the node (ApplyLocalChangesNode/RefreshLocalChangesNode) without regenerating the graph when only the count changes; selection handling for the new cases.ViewModels.Repository: refreshes the node after querying local changes.Models.CommitGraph: newDotType.LocalChangesandPath.IsDashed; the node's path is split atHEAD(PathHelper.Detach()) so that only the link toHEADis dashed.Views.CommitGraph: renders dashed paths and the new dot type.Views.Histories: row template,WorkingCopydata template in the details panel, menu entry, context menu, double-click handling.Preferences.ShowLocalChangesInGraph: new global preference.DynamicResource, so it follows runtime locale changes. Non-English/French translations were not reviewed by native speakers; corrections welcome.Known limitations
Tested
HEADat the top,HEADnot at the top (newer branch above), detachedHEADHEADgets selected