fix(DockView): stop sibling blanking on any exit-maximize#1044
Merged
Conversation
…e tab on a real shrink
…e/add/hide a group)
|
Thanks for your PR, @zhaijunlei955. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
Reviewer's GuideAdds a guard to ensure all maximize exits carry the Sequence diagram for guarded maximize exit behaviorsequenceDiagram
participant Dockview
participant Gridview
participant DockviewParams as DockviewParams
Dockview->>Dockview: cerateDockview
Dockview->>Dockview: guardMaximizeExit
Dockview->>Gridview: wrap exitMaximizedView
Gridview->>Gridview: exitMaximizedView
Gridview->>DockviewParams: set maximizing = true
Gridview->>Gridview: original exitMaximizedView
Gridview->>DockviewParams: restore maximizing
Flow diagram for setWidth active panel handling on shrinkflowchart TD
A[setWidth] --> B[find group for header]
B --> C[update _lastHeaderWidth]
C --> D{voidWidth == 0?}
D -->|no| H
D -->|yes| E{tabs > 1?}
E -->|no| H
E -->|yes| F{shrinking and active tab would overflow?}
F -->|yes| G[call group.panels_0_.api.setActive]
F -->|no| H[adjust tabs into dropdown]
H --> I{group.activePanel exists?}
I -->|no| J[call group.panels_0_.api.setActive]
I -->|yes| K[keep current active panel]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In
guardMaximizeExit, consider defensively checking thatproto.exitMaximizedViewexists before wrapping it so the guard degrades gracefully if the underlying gridview implementation changes. - The
_lastHeaderWidthstate is being attached ad hoc to the group object; it may be safer to centralize this tracking (or ensure it’s cleared on group disposal) to avoid stale width data if groups/headers are recycled.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `guardMaximizeExit`, consider defensively checking that `proto.exitMaximizedView` exists before wrapping it so the guard degrades gracefully if the underlying gridview implementation changes.
- The `_lastHeaderWidth` state is being attached ad hoc to the group object; it may be safer to centralize this tracking (or ensure it’s cleared on group disposal) to avoid stale width data if groups/headers are recycled.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
ArgoZhang
approved these changes
Jun 24, 2026
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.
Issues
close #1045
Two fixes around the
onlyWhenVisiblerenderer and visibility transitions.1. Active panel resets to the first / blanks after becoming visible
Problem: Activate a non-first panel in a group, switch to another view (so this
DockView's container is hidden), refresh, then switch back — the group's active
panel snaps to the first one and its content goes blank (tab titles remain).
Cause:
setWidth's tab-overflow fallback force-activatedgroup.panels[0]whenever the visible tab strip had no active tab. On becoming visible after a
hidden init the group expands through narrow widths and transiently overflows the
active tab into the dropdown → reads as "no active tab" → wrong switch + churn.
Fix: Only re-pick the active tab on a real shrink (header width strictly drops,
never the transient expand), switching before the active tab is tucked away. The
remaining fallback fires only when the group genuinely has no active panel.
2. Blank DockView when a group is removed/moved/added/hidden while maximized
Problem: With a grid group maximized, closing all its panels (or otherwise
removing/moving/adding/hiding a group) leaves the whole DockView blank.
Cause: The core exits maximize on its own for those operations
(
gridview.removeView/setViewVisible/moveView/addView), but without themaximizingflag theonlyWhenVisiblehandler moves the restored siblings'content into the template → blank. Earlier fixes (e.g. #1025) only set the flag on
the toggle-button and save paths.
Fix: A single guard wraps the core's
exitMaximizedViewso every exit-maximizecarries the
maximizingflag, covering all paths at once.Summary by Sourcery
Guard DockView maximize exits and refine active-panel selection during tab overflow handling to prevent panels and views from becoming blank after visibility or layout changes.
Bug Fixes: