git_ui: Fix select previous selects a non-visible item#49289
Merged
Veykril merged 1 commit intozed-industries:mainfrom Mar 17, 2026
Merged
Conversation
header This commit fixes that when you are below a header and want to select the previous item, we would not select a non-visible item as we did before because of the -1 of the newly selected index.
auto-merge was automatically disabled
March 17, 2026 07:28
Pull request was closed
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 fixes that when you are below a header and want to select a previous item, we would select a non-visible item because we did a -1 of the newly selected index, which could end up inside a collapsed directory.
Note: This is only an issue for the git tree view mode.
Before (See selection is not visible anymore after select previous, because it's inside the collapsed directory)
Screen.Recording.2026-02-16.at.20.39.00.mov
After (See selection now selects the first visible item in the list which is the collapsed directory)
Screen.Recording.2026-02-16.at.20.36.13.mov
Before you mark this PR as ready for review, make sure that you have:
Release Notes: