project_panel: Do not ignore first focus clicks on items - #58562
Merged
yara-blue merged 1 commit intoJun 5, 2026
Conversation
When handling click events on entries in project panel, we were returning early if the click was the one that brought the Zed window into focus. This effectively ignored the click action on the item. This leads to two clicks being required to act on an item in the project panel if the Zed window is out of focus. This behaviour is also inconsistent with other UI controls, where clicking on them when the window is out of focus actually acts upon them.
|
We require contributors to sign our Contributor License Agreement, and we don't have @ChintanAcharya 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'. |
Contributor
Author
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
yara-blue
enabled auto-merge
June 5, 2026 08:56
Contributor
Contributor
|
@zed-industries/approved |
TomPlanche
pushed a commit
to TomPlanche/zed
that referenced
this pull request
Jun 8, 2026
…ies#58562) When handling click events on entries in project panel, we were returning early if the click was the one that brought the Zed window into focus. This effectively ignored the click action on the item. This leads to two clicks being required to act on an item in the project panel if the Zed window is out of focus. The existing behaviour is also inconsistent with other UI controls, where clicking on them when the window is out of focus actually acts upon them. This behaviour was introduced in zed-industries#9553. This PR fixes the click handler on the entries so that events with `first_focus() == true` are no longer ignored. Before: https://github.com/user-attachments/assets/d51ec11d-c47a-4ea3-af6d-63bf6daf3c44 After: https://github.com/user-attachments/assets/87b9e6a8-9ef0-463f-8557-e15d25b519ca Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [ ] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [ ] Tests cover the new/changed behavior - [ ] Performance impact has been considered and is acceptable Closes zed-industries#58261 Release Notes: - Fixed project panel needing a second click to change the file if the window is not in focus
This was referenced Jun 18, 2026
Closed
This was referenced Jul 1, 2026
This was referenced Jul 10, 2026
jonx
pushed a commit
to jonx/zed-aros
that referenced
this pull request
Jul 17, 2026
…ies#58562) When handling click events on entries in project panel, we were returning early if the click was the one that brought the Zed window into focus. This effectively ignored the click action on the item. This leads to two clicks being required to act on an item in the project panel if the Zed window is out of focus. The existing behaviour is also inconsistent with other UI controls, where clicking on them when the window is out of focus actually acts upon them. This behaviour was introduced in zed-industries#9553. This PR fixes the click handler on the entries so that events with `first_focus() == true` are no longer ignored. Before: https://github.com/user-attachments/assets/d51ec11d-c47a-4ea3-af6d-63bf6daf3c44 After: https://github.com/user-attachments/assets/87b9e6a8-9ef0-463f-8557-e15d25b519ca Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [ ] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [ ] Tests cover the new/changed behavior - [ ] Performance impact has been considered and is acceptable Closes zed-industries#58261 Release Notes: - Fixed project panel needing a second click to change the file if the window is not in focus
jolutz
pushed a commit
to jolutz/zed
that referenced
this pull request
Aug 8, 2026
…ies#58562) When handling click events on entries in project panel, we were returning early if the click was the one that brought the Zed window into focus. This effectively ignored the click action on the item. This leads to two clicks being required to act on an item in the project panel if the Zed window is out of focus. The existing behaviour is also inconsistent with other UI controls, where clicking on them when the window is out of focus actually acts upon them. This behaviour was introduced in zed-industries#9553. This PR fixes the click handler on the entries so that events with `first_focus() == true` are no longer ignored. Before: https://github.com/user-attachments/assets/d51ec11d-c47a-4ea3-af6d-63bf6daf3c44 After: https://github.com/user-attachments/assets/87b9e6a8-9ef0-463f-8557-e15d25b519ca Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [ ] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [ ] Tests cover the new/changed behavior - [ ] Performance impact has been considered and is acceptable Closes zed-industries#58261 Release Notes: - Fixed project panel needing a second click to change the file if the window is not in focus
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.
When handling click events on entries in project panel, we were returning early if the click was the one that brought the Zed window into focus. This effectively ignored the click action on the item. This leads to two clicks being required to act on an item in the project panel if the Zed window is out of focus. The existing behaviour is also inconsistent with other UI controls, where clicking on them when the window is out of focus actually acts upon them.
This behaviour was introduced in #9553.
This PR fixes the click handler on the entries so that events with
first_focus() == trueare no longer ignored.Before:
Before.mov
After:
After.mov
Self-Review Checklist:
Closes #58261
Release Notes: