fix: DH-23205: Fix nested panels error with ui.column/ui.row - #1398
Open
vbabich wants to merge 2 commits into
Open
fix: DH-23205: Fix nested panels error with ui.column/ui.row#1398vbabich wants to merge 2 commits into
vbabich wants to merge 2 commits into
Conversation
|
ui docs preview (Available for 14 days) |
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes nested panel errors by ensuring rows and columns inside panels render as flex containers during layout rehydration.
Changes:
- Prioritizes panel context over persisted layout handling.
- Adds regression tests for row and column behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
layout/Row.tsx |
Prioritizes in-panel flex rendering. |
layout/Row.test.tsx |
Tests row behavior during rehydration. |
layout/Column.tsx |
Prioritizes in-panel flex rendering. |
layout/Column.test.tsx |
Tests column behavior during rehydration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
ui docs preview (Available for 14 days) |
1 similar comment
|
ui docs preview (Available for 14 days) |
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.
Summary
Fixes a
NestedPanelError— "ui.panel must be a top-level component or used within a dashboard layout." — that intermittently rendered instead of a panel's content when aui.columnorui.rowwas used as the content of aui.panelinside an ad-hoc dashboard.Root cause
In
Column.tsxandRow.tsx, the branch order checkedinitialLayoutConfig != nullbeforepanelId != null.When a
ui.column/ui.rowis used as the content of aui.panel(sopanelId != null), it should render as aFlex. But during dashboard rehydration a persistedinitialLayoutConfigis present, so the code took the first branch and calledwrapBareChildrenInPanel, wrapping the bare child in aReactPanel. That new panel then hit thecontextPanelId != nullguard inReactPanel.tsxand threw theNestedPanelError.Fix
Prioritize the inside-a-panel branch: if
panelId != null, always render aFlexregardless ofinitialLayoutConfig. The rehydration and fresh-layout branches now only apply when not inside a panel.