Skip to content

git_ui: Fix select previous selects a non-visible item#49289

Merged
Veykril merged 1 commit intozed-industries:mainfrom
RemcoSmitsDev:git-ui-keyboard-navigation-select-previous
Mar 17, 2026
Merged

git_ui: Fix select previous selects a non-visible item#49289
Veykril merged 1 commit intozed-industries:mainfrom
RemcoSmitsDev:git-ui-keyboard-navigation-select-previous

Conversation

@RemcoSmitsDev
Copy link
Copy Markdown
Contributor

@RemcoSmitsDev RemcoSmitsDev commented Feb 16, 2026

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:

  • Added a solid test coverage and/or screenshots from doing manual testing
  • Done a self-review taking into account security and performance aspects
  • Aligned any UI changes with the UI checklist

Release Notes:

  • Git UI: Fix selecting previous item would select a non-visible item if it's inside a collapsed directory

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.
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Feb 16, 2026
@github-actions github-actions bot added the community champion Issues filed by our amazing community champions! 🫶 label Feb 16, 2026
Copy link
Copy Markdown
Member

@Veykril Veykril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Veykril Veykril enabled auto-merge (squash) March 17, 2026 07:28
@Veykril Veykril closed this Mar 17, 2026
auto-merge was automatically disabled March 17, 2026 07:28

Pull request was closed

@Veykril Veykril reopened this Mar 17, 2026
@Veykril Veykril enabled auto-merge (squash) March 17, 2026 07:29
@Veykril Veykril merged commit cd1211f into zed-industries:main Mar 17, 2026
25 checks passed
@Veykril Veykril assigned Veykril and unassigned cameron1024 Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement community champion Issues filed by our amazing community champions! 🫶

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants