Skip to content

Conversation

mattermoran
Copy link

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_branch where cx.emit(DismissEvent); is called without waiting for repo.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 open function 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

Copy link

cla-bot bot commented Oct 7, 2025

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

@mattermoran
Copy link
Author

@cla-bot check

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

cla-bot bot commented Oct 7, 2025

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

@maxdeviant maxdeviant changed the title fix(git_ui): close branch selector as soon as branch is selected git_ui: Close branch selector as soon as branch is selected Oct 7, 2025
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

None yet

Development

Successfully merging this pull request may close these issues.

2 participants