feat: DH-21757: WidgetPlugin support in deephaven.ui#1341
feat: DH-21757: WidgetPlugin support in deephaven.ui#1341mofojed wants to merge 31 commits intodeephaven:mainfrom
Conversation
- Needs deephaven/web-client-ui#2648 - WidgetPlugin just registers directly - Allows for nested ui.resolve deephaven.ui components - Still maintain DashboardPlugin to handle legacy behaviour - Works with the ui_home_screen, nested dashboards, etc - Styling a little bit different (ui.panel is automatically wrapped in a nested dashboard rather than opening up panels in the existing dashboard like before) - Dashboard now has a `show_headers` option that can be set to False to not show headers on a dashboard. Useful if you're doing a homescreen type dashboard
- Add moduleNameMapper in jest.config.cjs to resolve React 18 from the plugin's local node_modules, fixing dual-React-instance errors - Mock usePersistentState in @deephaven/plugin mock to avoid FiberProvider dependency in tests - Update DocumentHandler test to reflect new behavior where non-layout children are rendered directly without ReactPanel wrapping
- Wrap bare (non-layout) widget children in DefaultPanelContent so they receive padding and surface widget loading/error states (fixes the ui_boom_counter error overlay not appearing after the WidgetPlugin refactor). - Add a styles.scss rule that strips the outer ReactPanel padding when its only child is a .dh-nested-dashboard, eliminating the duplicate padding around nested dashboards (e.g. ui_deeply_nested_dashboard).
- There's an issue here - when the ui.dashboard is the othermost thing, it should just take over the outer dashboard. Right now it's embeddign in. Need to fix that.
When a deephaven.ui widget is a single ui.panel hosted by the core WidgetPanel (e.g. opened via the WidgetPlugin in a code studio or in the embed widget scenario), render the panel's children inline using DefaultPanelContent instead of opening another GoldenLayout panel. Previously this produced a panel tab nested inside another panel tab. DefaultPanelContent now forwards the same View/Flex props that ReactPanel accepts so the user's ui.panel styling (padding, direction, gap, etc.) is preserved when rendered inline, and applies the dh-react-panel/dh-inner-react-panel class names so existing CSS rules (grid/chart padding strip, etc.) still apply. Also scope the nested-dashboard padding rule to .dh-react-panel so the outer WidgetPanel does not add extra padding around a top-level ui.dashboard in the embed widget scenario.
|
ui docs preview (Available for 14 days) |
- Shouldn't need to update all of these, there are likely some other fixes I need to do.
|
ui docs preview (Available for 14 days) |
|
ui docs preview (Available for 14 days) |
- now we don't have padding on the dashboard in the embed widget app scenario
|
ui docs preview (Available for 14 days) |
|
ui docs preview (Available for 14 days) |
|
ui docs preview (Available for 14 days) |
96a9770 to
1fe9308
Compare
|
ui docs preview (Available for 14 days) |
- For the render-all pages, just load that widget up directly instead of opening it up in a nested panel.
|
ui docs preview (Available for 14 days) |
- This is consistent with how panels are opened in a dashboard without specifying a column or row (e.g. ui.dashboard([ui.panel(..), ui.panel(...)])). - Before it would just stack multiple panels when opening from a code studio, which was weird
- This was a fix in web-client-ui
|
ui docs preview (Available for 14 days) |
|
I'm not sure why the "UI Table responds to props changes" tests have slightly changed. I need to look into this a bit to understand why. |
…haven.ui-widget-plugin
|
ui docs preview (Available for 14 days) |
- In the ui_home_screen.py, we were re-declaring `_stocks` to be another variable, and were not using a ticking table - The ticking table was causing the snapshots to not match - This kind of points to an issue with app mode in general, where we need to be concious we're not overwriting other variables in other files. I'm choosing to ignore that at this time
|
ui docs preview (Available for 14 days) |
dsmmcken
left a comment
There was a problem hiding this comment.
Needs some docs, at least for the show headers
|
ui docs preview (Available for 14 days) |
dsmmcken
left a comment
There was a problem hiding this comment.
Are all the other e2e changes expected?
| ``` | ||
|
|
||
| > [!NOTE] | ||
| > When `show_headers=False`, users will not be able to drag panels to rearrange the layout, since the header is the drag handle. |
There was a problem hiding this comment.
| > When `show_headers=False`, users will not be able to drag panels to rearrange the layout, since the header is the drag handle. | |
| > When `show_headers=False`, users will not be able to drag panels to rearrange the layout or change to other panels in a `ui.stack`, since the header is the target and drag handle. |
Added stack caveat, I assume that's what would happen.
| "Value=i%2==0 ? `A` : `B`", | ||
| "Row=i", | ||
| ] | ||
| ) |
There was a problem hiding this comment.
You shouldn't use a timetable in e2e tests, you don't want anything ticking.
Though it doesn't look like the e2e tests display this, on screen. I think you should still switch it over so agents to follow it as a pattern.
show_headersoption that can be set to False to not show headers on a dashboard. Useful if you're doing a homescreen type dashboard