Skip to content

Git status list fix#59155

Merged
ChristopherBiscardi merged 3 commits into
zed-industries:mainfrom
Groni3000:git-status-list-fix
Jun 22, 2026
Merged

Git status list fix#59155
ChristopherBiscardi merged 3 commits into
zed-industries:mainfrom
Groni3000:git-status-list-fix

Conversation

@Groni3000

Copy link
Copy Markdown
Contributor

Self-Review Checklist:

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content adheres to Zed's UI standards (UX/UI and icon guidelines)
  • Tests cover the new/changed behavior
  • Performance impact has been considered and is acceptable

Closes #ISSUE

Issue:

  • Create and/or modify several files.
  • Go to GitPanel.
  • Stage files you want to commit.
  • Select last entry. You may select not last but make sure after list of entries shrinks, your selection would be "out of visible list" after.
  • Commit.
  • Entries will be committed and disappear.
  • But it seems like selected_entry is not updated (or updated incorrectly) and Zed still have "hidden" selected entry of the last selected entry. So you need to Shift-g (in vim mode) or some other keybinding to select last entry manually. I used k multiple times before I realized I can use Shift-g or g g -,-

Release Notes:

  • Fixed: stale index (selected_entry) of git panel after .

Notes:

  • I basically copied logic of function 1 line above but instead of first_entry I used last_etnry. So... It should be harmless.
  • I didn't find where selection logic is tested. I tried to do something using test_amend as template, but... I'm afraid I won't be able to understand if I'm using testing framework correctly.
  • I couldn't make tests, but I tried to "test" by hand using something like this:
image

Flat View seems like working fine, but Tree View has some "bugs" (if we can call it like that) inherited. For example, if I stage selected file and commit it, selection jumps to the asdjfl instead of the file right under - outer_file. The same behavior in the current release.

@cla-bot

cla-bot Bot commented Jun 11, 2026

Copy link
Copy Markdown

We require contributors to sign our Contributor License Agreement, and we don't have @Groni3000 on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@zed-community-bot zed-community-bot Bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label Jun 11, 2026
@Groni3000

Copy link
Copy Markdown
Contributor Author

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Jun 11, 2026
@cla-bot

cla-bot Bot commented Jun 11, 2026

Copy link
Copy Markdown

The cla-bot has been summoned, and re-checked this pull request!

@ChristopherBiscardi ChristopherBiscardi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks! This fixes the keyboard navigation issue after committing

@ChristopherBiscardi ChristopherBiscardi added this pull request to the merge queue Jun 22, 2026
Merged via the queue into zed-industries:main with commit 13dd39b Jun 22, 2026
34 checks passed
saranblock3 pushed a commit to saranblock3/zed that referenced this pull request Jun 23, 2026
Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #ISSUE

Issue:
- Create and/or modify several files.
- Go to GitPanel.
- Stage files you want to commit.
- Select last entry. You may select not last but make sure after list of
entries shrinks, your selection would be "out of visible list" after.
- Commit.
- Entries will be committed and disappear.
- But it seems like `selected_entry` is not updated (or updated
incorrectly) and Zed still have "hidden" selected entry of the last
selected entry. So you need to `Shift-g` (in vim mode) or some other
keybinding to select last entry manually. I used `k` multiple times
before I realized I can use `Shift-g` or `g g` -,-

Release Notes:

- Fixed: stale index (`selected_entry`) of git panel after .

Notes:
- I basically copied logic of function 1 line above but instead of
`first_entry` I used `last_etnry`. So... It should be harmless.
- I didn't find where selection logic is tested. I tried to do something
using `test_amend` as template, but... I'm afraid I won't be able to
understand if I'm using testing framework correctly.
- I couldn't make tests, but I tried to "test" by hand using something
like this:
<img width="358" height="487" alt="image"
src="https://github.com/user-attachments/assets/8575bdcc-f59b-44f2-99e3-fe663e5e61f1"
/>

Flat View seems like working fine, but Tree View has some "bugs" (if we
can call it like that) inherited. For example, if I stage selected file
and commit it, selection jumps to the `asdjfl` instead of the file right
under - `outer_file`. The same behavior in the current release.

---------

Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
weihuoya pushed a commit to weihuoya/zed that referenced this pull request Jun 25, 2026
Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #ISSUE

Issue:
- Create and/or modify several files.
- Go to GitPanel.
- Stage files you want to commit.
- Select last entry. You may select not last but make sure after list of
entries shrinks, your selection would be "out of visible list" after.
- Commit.
- Entries will be committed and disappear.
- But it seems like `selected_entry` is not updated (or updated
incorrectly) and Zed still have "hidden" selected entry of the last
selected entry. So you need to `Shift-g` (in vim mode) or some other
keybinding to select last entry manually. I used `k` multiple times
before I realized I can use `Shift-g` or `g g` -,-

Release Notes:

- Fixed: stale index (`selected_entry`) of git panel after .

Notes:
- I basically copied logic of function 1 line above but instead of
`first_entry` I used `last_etnry`. So... It should be harmless.
- I didn't find where selection logic is tested. I tried to do something
using `test_amend` as template, but... I'm afraid I won't be able to
understand if I'm using testing framework correctly.
- I couldn't make tests, but I tried to "test" by hand using something
like this:
<img width="358" height="487" alt="image"
src="https://github.com/user-attachments/assets/8575bdcc-f59b-44f2-99e3-fe663e5e61f1"
/>

Flat View seems like working fine, but Tree View has some "bugs" (if we
can call it like that) inherited. For example, if I stage selected file
and commit it, selection jumps to the `asdjfl` instead of the file right
under - `outer_file`. The same behavior in the current release.

---------

Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:integrations/git Git integration feedback cla-signed The user has signed the Contributor License Agreement first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants