Skip to content

project_panel: Do not ignore first focus clicks on items - #58562

Merged
yara-blue merged 1 commit into
zed-industries:mainfrom
ChintanAcharya:project-panel-focus-click
Jun 5, 2026
Merged

project_panel: Do not ignore first focus clicks on items#58562
yara-blue merged 1 commit into
zed-industries:mainfrom
ChintanAcharya:project-panel-focus-click

Conversation

@ChintanAcharya

Copy link
Copy Markdown
Contributor

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() == true are no longer ignored.

Before:

Before.mov

After:

After.mov

Self-Review Checklist:

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

Closes #58261

Release Notes:

  • Fixed project panel needing a second click to change the file if the window is not in focus

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.
@cla-bot

cla-bot Bot commented Jun 4, 2026

Copy link
Copy Markdown

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'.

@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 4, 2026
@ChintanAcharya

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 4, 2026
@cla-bot

cla-bot Bot commented Jun 4, 2026

Copy link
Copy Markdown

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

@maxdeviant maxdeviant changed the title project_panel: do not ignore first focus clicks on items project_panel: Do not ignore first focus clicks on items Jun 4, 2026
@yara-blue
yara-blue enabled auto-merge June 5, 2026 08:56
@yara-blue

Copy link
Copy Markdown
Contributor

I wonder why that line was added, #9553 mentions an issue with first click and drag but the line was added before the commit on #9553 taking care of that. Let's see what happens when we merge this.

Thanks!

@yara-blue
yara-blue added this pull request to the merge queue Jun 5, 2026
@yara-blue

Copy link
Copy Markdown
Contributor

@zed-industries/approved

Merged via the queue into zed-industries:main with commit 0cab9ee Jun 5, 2026
43 checks passed
@ChintanAcharya
ChintanAcharya deleted the project-panel-focus-click branch June 6, 2026 11:49
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
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
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 first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Project panel needs a second click to change the file if the window is not in focus

2 participants