Conversation
- hideTab() now records the popout home location when hiding a popped-out widget's tab, so re-showing it via WIDGET_TAB_OPEN restores it back into its popout window instead of docking to a default panel section. - Introduced a TabRestoreState union (WidgetRestoreState | PopoutWidgetRestoreState) used only by SavedTabState/TabHomeState, keeping the narrower WidgetRestoreState type intact for PopoutWidgetState.home. - addRemovedTab() restores a tab into a popout widget via addPopoutWidget() when its saved home is a popout restore state. - Enforce a 200x200 minimum popout window size (matching Widget.tsx's floating-widget minimum) in the WIDGET_TAB_POPOUT reducer and in FrontstageDef.openPopoutWidgetContainer(), preventing popout windows from shrinking to an invisibly small size across repeated pop-out cycles. - Added a Storybook story (Widget/PopoutRestore) demonstrating the fix: pop a widget out, hide it, then show it again and confirm it stays popped out instead of docking back into the panel. AB#2024472 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes popout widget restoration so a widget that was popped out, then hidden (WidgetState.Hidden), reopens back into its popout window when shown again, and also enforces a minimum popout window size to prevent progressive shrinking across cycles.
Changes:
- Persist popout “home” information when hiding a tab from a popout widget, and restore hidden tabs back into popout widgets on re-open.
- Introduce
TabRestoreState(widening tab restore semantics to include popouts) and add popout-aware restore logic inaddRemovedTab(). - Enforce a 200x200 minimum popout window size in both the state reducer and
FrontstageDef, with updated tests and a Storybook repro story.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| ui/appui-react/src/appui-react/layout/state/NineZoneStateReducer.ts | Record popout home on hide; clamp popout bounds to a minimum size during popout creation. |
| ui/appui-react/src/appui-react/layout/state/WidgetRestoreState.ts | Add popout-aware restore state/type-guards for tab restoration. |
| ui/appui-react/src/appui-react/layout/state/SavedTabState.ts | Widen TabHomeState to allow popout restore state. |
| ui/appui-react/src/appui-react/layout/state/internal/TabStateHelpers.ts | Restore removed/hidden tabs into popout widgets when saved home indicates popout. |
| ui/appui-react/src/appui-react/frontstage/FrontstageDef.tsx | Clamp popout window open/resize dimensions to a minimum size. |
| ui/appui-react/src/test/layout/state/NineZoneStateReducer.test.ts | Add/update reducer tests for minimum size clamp and popout hide/show restore. |
| ui/appui-react/src/test/frontstage/FrontstageDef.test.tsx | Add test verifying minimum size is enforced in popout window features. |
| docs/storybook/src/widget/PopoutRestore.tsx | Add Storybook scenario demonstrating popout hide/show restore behavior. |
| docs/storybook/src/widget/PopoutRestore.stories.tsx | Register the new Storybook story and document repro steps. |
| .changeset/popout-widget-hide-restore.md | Add patch changeset describing the fix and minimum size enforcement. |
Suppressed comments (1)
ui/appui-react/src/appui-react/layout/state/WidgetRestoreState.ts:65
- Same as above: the parameter type can be simplified to
TabRestoreStatefor clarity (it still acceptsWidgetRestoreStatevalues).
export function isPanelWidgetRestoreState(
state: WidgetRestoreState | TabRestoreState
): state is PanelWidgetRestoreState {
return "side" in state;
}
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@arome could you provide additional details - what is this fixing exactly: repro steps, expected and current behavior, target environment. My main concern is that (especially in browser environment) window popouts require an explicit user action. |
Summary
Fixes a popped-out (child window) widget docking back into its panel instead of remaining popped out after it is hidden (
WidgetState.Hidden) and then shown again.Details
hideTab()now records the popout home location when hiding a popped-out widget's tab, so re-showing it viaWIDGET_TAB_OPENrestores it back into its popout window instead of docking to a default panel section.TabRestoreStateunion (WidgetRestoreState | PopoutWidgetRestoreState) used only bySavedTabState/TabHomeState, keeping the narrowerWidgetRestoreStatetype intact forPopoutWidgetState.home.addRemovedTab()restores a tab into a popout widget viaaddPopoutWidget()when its saved home is a popout restore state.Widget.tsx's floating-widget minimum) in theWIDGET_TAB_POPOUTreducer and inFrontstageDef.openPopoutWidgetContainer(), preventing popout windows from shrinking to an invisibly small size across repeated pop-out cycles.Widget/PopoutRestore) demonstrating the fix: pop a widget out, hide it, then show it again and confirm it stays popped out instead of docking back into the panel.Test plan
NineZoneStateReducer.test.tsandFrontstageDef.test.tsxcovering hide/show restore of popout widgets and the minimum popout size enforcement.Widget/PopoutRestoreStorybook story.