Skip to content

git_ui: Dismiss pickers only on active window#41320

Merged
cole-miller merged 4 commits intozed-industries:mainfrom
v1narth:feat/branch-picker-dismiss
Nov 19, 2025
Merged

git_ui: Dismiss pickers only on active window#41320
cole-miller merged 4 commits intozed-industries:mainfrom
v1narth:feat/branch-picker-dismiss

Conversation

@v1narth
Copy link
Contributor

@v1narth v1narth commented Oct 27, 2025

Small QOL improvement for branch picker to only dismiss when focus lost in active window.
This can benefit those who need to switch windows mid branch creation to fetch correct jira ticket number or etc.

Added window.is_active_window() guard in picker.rs -> cancel event

Release Notes:

  • (Let's Git Together) Fixed a behavior where pickers would automatically close upon the window becoming inactive.

@cla-bot
Copy link

cla-bot bot commented Oct 27, 2025

We require contributors to sign our Contributor License Agreement, and we don't have @v1narth 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'.

@v1narth
Copy link
Contributor Author

v1narth commented Oct 27, 2025

@cla-bot check

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Oct 27, 2025
@cla-bot
Copy link

cla-bot bot commented Oct 27, 2025

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

@maxdeviant maxdeviant changed the title feat: dismiss branch picker only on active window git_ui: Dismiss branch picker only on active window Oct 27, 2025
@v1narth
Copy link
Contributor Author

v1narth commented Oct 28, 2025

I think it may be better to also introduce this to other places like file_finder, command_palette, maybe even profile_selector and agent_model_selector so it consistent across the UI.

@cole-miller
Copy link
Member

cole-miller commented Nov 11, 2025

Thanks!

I think we can enable this for all pickers in a clean way by adding a && window.is_active_window() guard before calling cancel to the blur handlers in picker.rs, would you be up for doing that?

@zed-industries-bot
Copy link
Contributor

zed-industries-bot commented Nov 15, 2025

Warnings
⚠️

This PR is missing release notes.

Please add a "Release Notes" section that describes the change:

Release Notes:

- Added/Fixed/Improved ...

If your change is not user-facing, you can use "N/A" for the entry:

Release Notes:

- N/A

Generated by 🚫 dangerJS against 7bd3ec5

@v1narth
Copy link
Contributor Author

v1narth commented Nov 15, 2025

@cole-miller thx for the guide, i've implemented your suggestion, seems like its working just fine

@v1narth v1narth changed the title git_ui: Dismiss branch picker only on active window git_ui: Dismiss pickers only on active window Nov 15, 2025
@cole-miller
Copy link
Member

Sorry, I think my previous post was unclear--I think we should add this check inside the two blur handlers in picker.rs, so these lines:

if self.is_modal {

self.cancel(&menu::Cancel, window, cx);

Maybe a bit of a nitpick but I think we should ensure that this behavior is only applied for blue handlers.

@v1narth
Copy link
Contributor Author

v1narth commented Nov 18, 2025

@cole-miller done

@cole-miller
Copy link
Member

Thank you!

@cole-miller cole-miller merged commit 24c1617 into zed-industries:main Nov 19, 2025
24 checks passed
@JosephTLyons JosephTLyons moved this to 🚢 Shipped by Community in Git board Nov 19, 2025
mikayla-maki pushed a commit that referenced this pull request Nov 20, 2025
Small QOL improvement for branch picker to only dismiss when focus lost
in active window.
This can benefit those who need to switch windows mid branch creation to
fetch correct jira ticket number or etc.

Added `window.is_active_window()` guard in `picker.rs` -> `cancel` event

Release Notes:
- (Let's Git Together) Fixed a behavior where pickers would
automatically close upon the window becoming inactive.
11happy pushed a commit to 11happy/zed that referenced this pull request Dec 1, 2025
Small QOL improvement for branch picker to only dismiss when focus lost
in active window.
This can benefit those who need to switch windows mid branch creation to
fetch correct jira ticket number or etc.

Added `window.is_active_window()` guard in `picker.rs` -> `cancel` event

Release Notes:
- (Let's Git Together) Fixed a behavior where pickers would
automatically close upon the window becoming inactive.
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

Projects

Status: 🚢 Shipped by Community

Development

Successfully merging this pull request may close these issues.

3 participants