You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Auto-select first file for DiffView, whenever context is set or changed #1019
There is an unnecessary click whenever the "Select file to view changes" (DiffView) panel is/becomes visible and/or the selected context is changed.
It would be much preferable to always auto-select the first file (diff) from the list (whenever there is no active selection already), both on entering/activating the diff panel and when changing its selected context. (NOTE: This means the Text.Diff.Welcome string should be changed from "Select file to view changes" to "No changes available" or similar, since it would only be shown if the file list is empty.)
This sort of auto-selection is what we're used to from other tools (Plastic SCM, GitHub Desktop, Fork, Git Extensions, Tower, Sourcetree etc).
All the 5 DiffView instances would benefit from auto-selection:
On the CHANGES tab-link-page in HISTORY view.
On the RevisionCompare page in HISTORY view (i.e when exactly 2 commits are multi-selected).
In the LOCAL CHANGES view - auto-select from non-empty list of UNSTAGED or STAGED (in whatever order would make more sense).
In the STASHES view, when changing the selected stash. (NOTE: Should also auto-select the first stash when entering!)
In the "Branch Compare" window.
Related:
When going back from multi-selection to single-selection in HISTORY view, the previously active tab-link-page (INFORMATION / CHANGES / FILES) should be preserved, instead of reverting to the first tab-link-page (INFORMATION) !
changed the title [-][Enhancement] Auto-select first changed file in list, whenever selecting a commit or local changes[/-][+][Enhancement] Auto-select first file for DiffView, whenever context is set or changed[/+]on Feb 24, 2025
The first file-change is now auto-selected on CHANGES page when changing selected commit in HISTORY view (and RevisionCompare when selecting 2 commits), in STASHES view when changing selected Stash, and finally when choosing "Compare with HEAD/Worktree" on a branch/commit. This is perfect! 👍
I realize now that the LOCAL CHANGES view already remembers its currently selected Unstaged/Staged file-change (after initial selection). Likewise, the STASHES view already remembers its current Stash (after initial selection). These are remembered per each repo-tab in the current session, so with your current fix (for auto-selection on Stash change) it now works great! (I don't mind so much an extra click on session startup, it was primarily the repeated extra clicks within an ongoing session that bothered me.)
The selected details page (INFORMATION / CHANGES / FILES) is now remembered per repo-tab (in current session), even after switching between single-/pair-/multi-selection in the graph/log. Excellent! 🎉
(The Text.Diff.Welcome string does not need to be changed (as I first suggested), it still works fine even if the list of file-changes are empty.)
changed the title [-][Enhancement] Auto-select first file for DiffView, whenever context is set or changed[/-][+]Auto-select first file for DiffView, whenever context is set or changed[/+]on Feb 25, 2025
Activity
[-][Enhancement] Auto-select first changed file in list, whenever selecting a commit or local changes[/-][+][Enhancement] Auto-select first file for DiffView, whenever context is set or changed[/+]love-linger commentedon Feb 24, 2025
See issue #261 and discussion #754
goran-w commentedon Feb 24, 2025
Thanks, I contributed to the discussion in #754. This feature is oft-requested and could be implemented as an optional one (via Preferences).
feature: auto-select first change in commit details panel and revisio…
feature: auto-select the first change when selected stash changed (#1019
goran-w commentedon Feb 25, 2025
Awesome, thanks a lot! 🥳
Comments after testing:
Text.Diff.Welcomestring does not need to be changed (as I first suggested), it still works fine even if the list of file-changes are empty.)goran-w commentedon Feb 25, 2025
(And the way this is implemented, it could easily be made an optional (by Preference) feature, if desired, in a future update.) 👍
[-][Enhancement] Auto-select first file for DiffView, whenever context is set or changed[/-][+]Auto-select first file for DiffView, whenever context is set or changed[/+]