Skip to content

project_panel: Make the window deactivation test actually deactivate - #4

Closed
butvinm wants to merge 1 commit into
mainfrom
fix-vacuous-deactivation-test
Closed

project_panel: Make the window deactivation test actually deactivate#4
butvinm wants to merge 1 commit into
mainfrom
fix-vacuous-deactivation-test

Conversation

@butvinm

@butvinm butvinm commented Aug 1, 2026

Copy link
Copy Markdown
Owner

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::new but never calls workspace.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's Blurred handler 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:

  • N/A

@butvinm butvinm changed the title Make the window-deactivation rename test actually deactivate project_panel: Make the window deactivation test actually deactivate Aug 5, 2026
@butvinm
butvinm force-pushed the fix-vacuous-deactivation-test branch from 9a16266 to 98de5dc Compare August 5, 2026 00:38
@butvinm
butvinm changed the base branch from fix-layout-switch-cancels-rename to main August 5, 2026 00:39
@butvinm
butvinm force-pushed the fix-vacuous-deactivation-test branch from 98de5dc to 35d8a1e Compare August 8, 2026 23:58
@butvinm
butvinm force-pushed the fix-vacuous-deactivation-test branch from 35d8a1e to f3a7ef7 Compare August 16, 2026 20:42
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
butvinm force-pushed the fix-vacuous-deactivation-test branch from f3a7ef7 to 05a08fe Compare August 16, 2026 21:59
@butvinm

butvinm commented Aug 22, 2026

Copy link
Copy Markdown
Owner Author

Merged upstream as zed-industries#62724; closing the fork copy.

@butvinm butvinm closed this Aug 22, 2026
@butvinm
butvinm deleted the fix-vacuous-deactivation-test branch August 22, 2026 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant