project_panel: Make the window deactivation test actually deactivate - #4
Closed
butvinm wants to merge 1 commit into
Closed
project_panel: Make the window deactivation test actually deactivate#4butvinm wants to merge 1 commit into
butvinm wants to merge 1 commit into
Conversation
butvinm
force-pushed
the
fix-vacuous-deactivation-test
branch
from
August 5, 2026 00:38
9a16266 to
98de5dc
Compare
butvinm
force-pushed
the
fix-vacuous-deactivation-test
branch
from
August 8, 2026 23:58
98de5dc to
35d8a1e
Compare
butvinm
force-pushed
the
fix-vacuous-deactivation-test
branch
from
August 16, 2026 20:42
35d8a1e to
f3a7ef7
Compare
The regression test added in zed-industries#61852 passes with or without the fix it guards. The panel is built with ProjectPanel::new but never added to the workspace, so it is never rendered and its filename editor never holds window focus. Deactivating the window blurs nothing, the Blurred handler never runs, and the assertion holds trivially. Add the panel to the workspace so it renders and takes focus, and assert the filename editor is focused before deactivating, so the test fails at an explanatory precondition instead of silently going vacuous again.
butvinm
force-pushed
the
fix-vacuous-deactivation-test
branch
from
August 16, 2026 21:59
f3a7ef7 to
05a08fe
Compare
Owner
Author
|
Merged upstream as zed-industries#62724; closing the fork copy. |
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.
Follow-up to zed-industries#61852. The regression test I added there passes with or without the fix.
The test creates the panel with
ProjectPanel::newbut never callsworkspace.add_panel(...), so the panel is never rendered and its filename editor never holds window focus. Deactivating the window then blurs nothing, the project panel'sBlurredhandler never runs, and the assertion holds trivially.Fixed by adding the panel to the workspace, and asserting the filename editor is focused before deactivating so the test fails loudly rather than silently going vacuous again.
Verified by making it fail at that precondition before
add_panel, and pass after.Release Notes: