nightly: workspace: Fix captured focus when opening modals (#63512)
2 September 2026 om 13:59
Objective
- This PR fixes the captured focus in modals.
- Fixes #63480 (and actually this was not specific to the task modal. it
was generic and applied to all modals)
Solution
- Previously when a modal was opened the
previous_focus_handlewas
stealing the focus because it was captured inshow_modal. The fix was
to capture it before callingshow_modalorreveal_stashed_modaland
pass it toshow_modal. That fixes the bug :) (yuhuu).
Testing
- Tested by running the build and trying to reproduce the bug. I
couldn't reproduce it anymore. - For testing, a reviewer also needs to test the revelal stashed modal
functionality. I did it with the file finder.
Self-Review Checklist:
- I've reviewed my own diff for quality, security, and reliability
- Unsafe blocks (if any) have justifying comments
- The content adheres to Zed's UI standards
(UX/UI
and
icon
guidelines) - Tests cover the new/changed behavior
- Performance impact has been considered and is acceptable
Release Notes:
- Fixed previous window focus handle not being captured correctly when
opening modals