-
Notifications
You must be signed in to change notification settings - Fork 37.3k
fix: Panel doesn't close when maximized and center-aligned (fixes #281772) #281773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Panel doesn't close when maximized and center-aligned (fixes #281772) #281773
Conversation
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @bpaseroMatched files:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a bug where the panel fails to close when clicking the toggle button while the panel is maximized and center-aligned. The issue stems from a circular dependency in the layout state management.
Key changes:
- Moved the unmaximize logic to execute before changing the panel's visibility state
- Updated comment to reflect the actual reason for the change (preventing conflict with setEditorHidden)
| // changing visibility to prevent conflict with setEditorHidden | ||
| // which would force panel visible again (fixes #281772) |
Copilot
AI
Dec 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The comment mentions "prevent conflict with setEditorHidden" but could be clearer. The conflict occurs because toggleMaximizedPanel() calls setEditorHidden(false) (at line 2126), which then checks if both editor and panel are hidden (at line 1798), and if so, forces the panel visible again via setPanelHidden(false, true) (at line 1799). By calling toggleMaximizedPanel() before changing the panel's hidden state, the panel is still visible when setEditorHidden checks, avoiding the forced re-showing. Consider clarifying this chain of events in the comment.
| // changing visibility to prevent conflict with setEditorHidden | |
| // which would force panel visible again (fixes #281772) | |
| // changing visibility. This prevents a conflict with setEditorHidden: | |
| // toggleMaximizedPanel() calls setEditorHidden(false), which checks if both editor and panel are hidden, | |
| // and if so, forces the panel visible again via setPanelHidden(false, true). | |
| // By unmaximizing before hiding, the panel is still visible when setEditorHidden checks, | |
| // so it does not force the panel to be shown again. (fixes #281772) |
|
Thank you! 🍻 |
Summary
This PR fixes a bug where the panel doesn't close when clicking the toggle button while the panel is maximized and center-aligned.
Problem
When the panel is in "center" alignment mode and maximized, clicking the toggle panel button fails to close the panel. The issue occurs because the
focusGroupparameter is undefined when trying to readactiveElementproperty.Fixes #281772
Solution
Added a null check to safely access
focusGroup?.activeElementinstead of directly accessingfocusGroup.activeElement, preventing the runtime error and allowing the panel to close correctly.Testing