The StrategyPanelController fails to re-integrate widgets into the dashboard when a popup window is closed manually (without dragging it back).
Problem:
When a widget is dragged out, onDragBoundaryExit sets #isWindowDragging to true. If the user drops the window (ending the drag operation), the SortZone correctly resets its internal state, but the StrategyPanelController does NOT receive a notification to reset its #isWindowDragging flag.
Consequently, when onWindowDisconnect fires (e.g., user closes the popup), the controller sees me.#isWindowDragging as true and opts out of re-integration:
if (me.#isWindowDragging || me.#isReintegrating) {
me.#isWindowDragging = false;
return
}
Proposed Solution:
- Expose
onDragEnd in Controller: Listen to the dragEnd event from the SortZone (or dragZone) in the StrategyPanelController.
- Reset State: Inside this handler, explicitly set
#isWindowDragging = false.
This ensures that once the drag operation concludes, the controller is ready to handle a subsequent window close event by re-inserting the widget into the dashboard.
Files to Modify:
apps/agentos/view/StrategyPanelController.mjs
- (Potentially)
apps/agentos/view/StrategyPanel.mjs (to attach the listener)
The
StrategyPanelControllerfails to re-integrate widgets into the dashboard when a popup window is closed manually (without dragging it back).Problem: When a widget is dragged out,
onDragBoundaryExitsets#isWindowDraggingtotrue. If the user drops the window (ending the drag operation), theSortZonecorrectly resets its internal state, but theStrategyPanelControllerdoes NOT receive a notification to reset its#isWindowDraggingflag.Consequently, when
onWindowDisconnectfires (e.g., user closes the popup), the controller seesme.#isWindowDraggingas true and opts out of re-integration:if (me.#isWindowDragging || me.#isReintegrating) { me.#isWindowDragging = false; // It resets here, but skips logic return }Proposed Solution:
onDragEndin Controller: Listen to thedragEndevent from theSortZone(ordragZone) in theStrategyPanelController.#isWindowDragging = false.This ensures that once the drag operation concludes, the controller is ready to handle a subsequent window close event by re-inserting the widget into the dashboard.
Files to Modify:
apps/agentos/view/StrategyPanelController.mjsapps/agentos/view/StrategyPanel.mjs(to attach the listener)