Fix agent panel closing unexpectedly when zoomed#49037
Merged
Conversation
Two changes: 1. Fix observe_global_in to not permanently remove observers when the window is transiently unavailable (e.g. temporarily taken during a nested update). Previously this returned false and silently removed the observer from the subscriber set. Now it checks whether the entity is actually dropped before removing — if the entity is alive but the window is just unavailable, it keeps the observer alive. 2. Extend dock_to_preserve in handle_pane_focused to also preserve docks whose active panel has focus, not just docks whose panel's inner pane matches the focused pane. Panels like AgentPanel don't implement pane() (only panels like TerminalPanel that contain panes do), so the existing preservation logic never identified the agent panel's dock as needing protection. This meant that when the agent panel was zoomed and a center pane received focus (e.g. during macOS window activation events), dismiss_zoomed_items_to_reveal would close the dock, making the panel disappear unexpectedly. Closes AI-16
a3cf796 to
74e3966
Compare
Member
|
Could we add tests demonstrating this bug and it's resolution? |
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.
Closes #33430
Two changes:
Fix
observe_global_into not permanently remove observers when the window is transiently unavailable (e.g. temporarily taken during a nested update). Previously this returned false and silently removed the observer from the subscriber set. Now it checks whether the entity is actually dropped before removing — if the entity is alive but the window is just unavailable, it keeps the observer alive.Extend
dock_to_preserveinhandle_pane_focusedto also preserve docks whose active panel has focus, not just docks whose panel's inner pane matches the focused pane. Panels likeAgentPaneldon't implementpane()(only panels likeTerminalPanelthat contain panes do), so the existing preservation logic never identified the agent panel's dock as needing protection. This meant that when the agent panel was zoomed and a center pane received focus (e.g. during macOS window activation events),dismiss_zoomed_items_to_revealwould close the dock, making the panel disappear unexpectedly.Closes AI-16
Release Notes: