Prevent dev container modal dismissal during creation#52506
Merged
KyleBarton merged 2 commits intozed-industries:mainfrom Apr 6, 2026
Merged
Prevent dev container modal dismissal during creation#52506KyleBarton merged 2 commits intozed-industries:mainfrom
KyleBarton merged 2 commits intozed-industries:mainfrom
Conversation
6 tasks
Collaborator
|
Hi @antont thanks for this change - mind merging main and addressing the failing test here? Otherwise, this approach looks sound and works as expected when I test. We should be good to merge once CI is green. Thanks! |
The test opens a dev container modal with a single config (which immediately enters the "Creating" state), then simulates a click outside the modal on the backdrop. Without a fix, the modal is dismissed, losing visual feedback while creation continues in the background. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add an allow_dismissal flag to RemoteServerProjects that is: - Set to false when entering Creating state (blocks accidental dismissal) - Set to true before emitting DismissEvent on success (allows explicit dismissal) - Set to true on error (allows user interaction with error UI) Override on_before_dismiss to check this flag, preventing backdrop clicks and focus loss from dismissing the modal while a dev container is being created. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ff2aca4 to
e61fdfb
Compare
Contributor
Author
|
@KyleBarton - cool! It went with clean rebase from current main and then tests passed, at least the failing one ( |
KyleBarton
approved these changes
Apr 6, 2026
Collaborator
|
Thanks again! |
piper-of-dawn
pushed a commit
to piper-of-dawn/zed
that referenced
this pull request
Apr 25, 2026
…#52506) ## Context When the dev container creation modal is showing "Creating Dev Container", clicking anywhere on the workspace backdrop dismisses the dialog. The container creation continues in the background, but the user loses visual feedback and the subsequent `open_remote_project` call may fail because the modal entity is gone. This adds an `allow_dismissal` flag to `RemoteServerProjects` that blocks accidental dismissal (backdrop clicks, focus loss) while a dev container is being created, but allows explicit dismissal on success or error. ## How to Review Small PR — two files changed: 1. **`remote_servers.rs`** (the fix): `allow_dismissal` bool field added, set to `false` when entering Creating state, set to `true` before emitting `DismissEvent` on success/error. `on_before_dismiss` override checks the flag. 2. **`recent_projects.rs`** (the test): Regression test that opens a dev container modal, simulates a backdrop click, and asserts the modal stays open. ## Self-Review Checklist - [x] I've reviewed my own diff for quality, security, and reliability - [x] 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) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - Fixed dev container creation modal being dismissed when clicking outside it --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.
Context
When the dev container creation modal is showing "Creating Dev Container", clicking anywhere on the workspace backdrop dismisses the dialog. The container creation continues in the background, but the user loses visual feedback and the subsequent
open_remote_projectcall may fail because the modal entity is gone.This adds an
allow_dismissalflag toRemoteServerProjectsthat blocks accidental dismissal (backdrop clicks, focus loss) while a dev container is being created, but allows explicit dismissal on success or error.How to Review
Small PR — two files changed:
remote_servers.rs(the fix):allow_dismissalbool field added, set tofalsewhen entering Creating state, set totruebefore emittingDismissEventon success/error.on_before_dismissoverride checks the flag.recent_projects.rs(the test): Regression test that opens a dev container modal, simulates a backdrop click, and asserts the modal stays open.Self-Review Checklist
Release Notes: