Objective
Move the logic for managing detached items (drag-to-window and re-integration) from application-level Viewport Controllers (e.g., AgentOS.view.ViewportController, Colors.view.ViewportController) into the core Neo.dashboard.Container. This will standardize the behavior and significantly improve Developer Experience (DX).
Key Changes
New Configs on Neo.dashboard.Container:
detachToNewWindow (Boolean, default true): Enables the drag-to-window feature.
popupConfig (Object): Default window features (e.g., {height: 600, width: 800}).
popupUrl (String|Function): A default template for the popup URL.
detachedItems (Map): Internal state to track items currently in popups.
Per-Item Configuration:
- Dashboard items (panels) can override the default
popupUrl via a custom config (e.g., popupUrl property on the item itself). This is critical for applications like AgentOS where different widgets require different app shells (e.g., swarm uses a canvas-enabled shell).
Lifecycle Management:
- Implement
onDragBoundaryExit in dashboard.Container to handle opening the popup.
- Implement
onDragBoundaryEntry in dashboard.Container to handle closing the popup and re-integrating the item.
- Handle
Neo.currentWorker connect/disconnect events within the container to manage state when windows are closed manually.
Cleanup:
- Remove the redundant logic from
AgentOS and Colors Viewport Controllers.
Objective Move the logic for managing detached items (drag-to-window and re-integration) from application-level Viewport Controllers (e.g.,
AgentOS.view.ViewportController,Colors.view.ViewportController) into the coreNeo.dashboard.Container. This will standardize the behavior and significantly improve Developer Experience (DX).Key Changes
New Configs on
Neo.dashboard.Container:detachToNewWindow(Boolean, defaulttrue): Enables the drag-to-window feature.popupConfig(Object): Default window features (e.g.,{height: 600, width: 800}).popupUrl(String|Function): A default template for the popup URL.detachedItems(Map): Internal state to track items currently in popups.Per-Item Configuration:
popupUrlvia a custom config (e.g.,popupUrlproperty on the item itself). This is critical for applications like AgentOS where different widgets require different app shells (e.g.,swarmuses a canvas-enabled shell).Lifecycle Management:
onDragBoundaryExitindashboard.Containerto handle opening the popup.onDragBoundaryEntryindashboard.Containerto handle closing the popup and re-integrating the item.Neo.currentWorkerconnect/disconnectevents within the container to manage state when windows are closed manually.Cleanup:
AgentOSandColorsViewport Controllers.