-
Notifications
You must be signed in to change notification settings - Fork 5.9k
git_ui: Close branch selector as soon as branch is selected #39725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
git_ui: Close branch selector as soon as branch is selected #39725
Conversation
|
We require contributors to sign our Contributor License Agreement, and we don't have @mattermoran 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'. |
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
cole-miller
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I like this change! Just one point of feedback (and I think it's fine to merge this without adding a test).
…closed before operation is done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Looks like this just needs a round of clippy fixes.
Head branch was pushed to by a user without write access
I noticed that branch picker doesn't close until the checkout operation is completed.
While normally it's not an issue, it becomes obvious if there are longer running post checkout hooks. In that case selecting a branch makes it feel like nothing has happened (there's a small indicator in the footer) so it's possible to click it multiple times. Closing the modal before the operation completes leads to the error modal saying
Failed to change branch. entity released. Please try again.even though the checkout was successful.The new behavior is to close the branch picker as soon as the branch is selected. This also aligns with the existing behavior in
create_branchwherecx.emit(DismissEvent);is called without waiting forrepo.update.And as I mentioned before there an indicator in the footer saying
git switch <branch_name>with a spinner thingy.I also added a check in the picker's
openfunction where it first checks if there's currently an active job and does not show the picker in that case.If this generally makes sense I can add the tests as well if needed.
P.S I checked how it works in VSCode and yes it also closes the branch picker as soon as the branch is selected. The only difference is that they show the loading indicator right next to the branch name (with a new branch) but in our case the current branch and activity indicator are located in different places.
Before
Screen.Recording.2025-10-08.at.12.59.27.AM.mp4
After
Screen.Recording.2025-10-08.at.1.07.49.AM.mp4
Release Notes: