Skip to content

fix: DH-23205: Fix nested panels error with ui.column/ui.row - #1398

Open
vbabich wants to merge 2 commits into
deephaven:mainfrom
vbabich:vlad-DH-23205
Open

fix: DH-23205: Fix nested panels error with ui.column/ui.row#1398
vbabich wants to merge 2 commits into
deephaven:mainfrom
vbabich:vlad-DH-23205

Conversation

@vbabich

@vbabich vbabich commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

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 a ui.column or ui.row was used as the content of a ui.panel inside an ad-hoc dashboard.

Root cause

In Column.tsx and Row.tsx, the branch order checked initialLayoutConfig != null before panelId != null.

When a ui.column/ui.row is used as the content of a ui.panel (so panelId != null), it should render as a Flex. But during dashboard rehydration a persisted initialLayoutConfig is present, so the code took the first branch and called wrapBareChildrenInPanel, wrapping the bare child in a ReactPanel. That new panel then hit the contextPanelId != null guard in ReactPanel.tsx and threw the NestedPanelError.

Fix

Prioritize the inside-a-panel branch: if panelId != null, always render a Flex regardless of initialLayoutConfig. The rehydration and fresh-layout branches now only apply when not inside a panel.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

ui docs preview (Available for 14 days)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

ui docs preview (Available for 14 days)

1 similar comment
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

ui docs preview (Available for 14 days)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants