feat(ui): DH-19818: add nested dashboard support#1302
feat(ui): DH-19818: add nested dashboard support#1302mofojed wants to merge 21 commits intodeephaven:mainfrom
Conversation
- Dashboard component now detects when inside a panel and delegates to NestedDashboard - NestedDashboard uses DHCDashboard from @deephaven/dashboard to create isolated GoldenLayout - NestedDashboardContent provides context providers for nested panels - DashboardContent extracted for top-level dashboard rendering - Add E2E tests and Python test fixtures for nested dashboards - Add unit tests for Dashboard and NestedDashboard components DH-19818
- Just using usePersistentState and it seems to work - Sometimes the nested dashboards don't load correctly, seems to be an intermittent issue/some sort of race condition. Will debug later, after writing docs
- Update rules to clarify root-level vs nested dashboard restrictions - Update bottom-level section to reference nested dashboards - Add Nested Dashboards section with examples to dashboard.md - Add Nested Dashboards section to creating-dashboards.md guide - Add example for sharing state between nested dashboards
1be29b1 to
6b71ddb
Compare
|
ui docs preview (Available for 14 days) |
- Separated into its own PR: deephaven#1303
|
ui docs preview (Available for 14 days) |
|
|
||
| ## Nested Dashboards | ||
|
|
||
| Dashboards can be nested inside panels to create complex layouts with isolated drag-and-drop regions. Each nested dashboard creates its own independent layout that users can rearrange without affecting the parent dashboard. |
There was a problem hiding this comment.
Do we need an enterprise only note that dashboards not defined at root won't appear in the shared dashboards list?
There was a problem hiding this comment.
Hmm well the dashboard doesn't have a name... but yea I'll make that clear. In DHC it won't appear in your panels list either.
|
ui docs preview (Available for 14 days) |
|
ui docs preview (Available for 14 days) |
|
Found these issues while testing:
|
- Was trying to re-open the layout after it was already set in the layout config - Just don't set the layout config, that's how we handle other deephaven.ui dashboards - The widget state is still preserved, so input/filters set within nested dashboards still is preserved - There still seems to be an intermittent issue where sometimes when opening a nested dashboard, it displays incorrectly (just an empty black square)
e3d3023
|
ui docs preview (Available for 14 days) |
|
ui docs preview (Available for 14 days) |
- Pass down the __dhId correctly to the NestedDashboardContent - That's what's calling the usePersistentState, so that's what needs the dhId set - Don't register event listeners from nested DashboardPlugin - Just need to register the PortalPanel stuff
|
ui docs preview (Available for 14 days) |
tests/ui_nested_dashboard.spec.ts
Outdated
| await expect(outerPanel.getByText('Deepest Content')).toBeVisible(); | ||
| }); | ||
|
|
||
| test('nested dashboard resizes with parent panel', async ({ page }) => { |
There was a problem hiding this comment.
This test doesn't seem to test what it claims, either delete or update.
| // We do it outside of the `handleClose` function in case a new panel opens up in the same render cycle | ||
| log.debug2( | ||
| 'Widget', | ||
| widget.id, | ||
| 'open panel count', | ||
| panelIds.current.length | ||
| ); | ||
| if (panelIds.current.length === 0) { | ||
| log.debug('Widget', widget.id, 'closed all panels, triggering onClose'); | ||
| onClose?.(); | ||
| } else { | ||
| onDataChange({ ...widgetData, panelIds: panelIds.current }); |
There was a problem hiding this comment.
Looks like this is existing code moved from DocumentHandler. Could passing a mutable panelIds.current be potentially problematic?
There was a problem hiding this comment.
Yea, it's not a problem yet but that's an anti-pattern. I'll copy the array first.
|
ui docs preview (Available for 14 days) |
|
ui docs preview (Available for 14 days) |
margaretkennedy
left a comment
There was a problem hiding this comment.
one tiny nitpick!
Co-authored-by: margaretkennedy <82049573+margaretkennedy@users.noreply.github.com>
|
ui docs preview (Available for 14 days) |

NestedDashboardNestedDashboardusesDashboardfrom@deephaven/dashboardto create isolated layoutNestedDashboardContentprovides context providers for nested panelsDashboardContentextracted for top-level dashboard renderingDashboardandNestedDashboardcomponents