feat(web-hud): seed default layout with orchestration widgets
All checks were successful
ci/woodpecker/push/web Pipeline was successful
All checks were successful
ci/woodpecker/push/web Pipeline was successful
This commit is contained in:
@@ -14,6 +14,70 @@ const DEFAULT_LAYOUT_NAME = "default";
|
|||||||
*/
|
*/
|
||||||
const WORKSPACE_KEY = "mosaic-workspace-id";
|
const WORKSPACE_KEY = "mosaic-workspace-id";
|
||||||
|
|
||||||
|
function createDefaultLayout(): LayoutConfig {
|
||||||
|
return {
|
||||||
|
id: DEFAULT_LAYOUT_NAME,
|
||||||
|
name: "Default Layout",
|
||||||
|
layout: [
|
||||||
|
{
|
||||||
|
i: "tasks-1",
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
w: 2,
|
||||||
|
h: 3,
|
||||||
|
minW: 1,
|
||||||
|
minH: 2,
|
||||||
|
isDraggable: true,
|
||||||
|
isResizable: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
i: "calendar-1",
|
||||||
|
x: 2,
|
||||||
|
y: 0,
|
||||||
|
w: 2,
|
||||||
|
h: 2,
|
||||||
|
minW: 1,
|
||||||
|
minH: 2,
|
||||||
|
isDraggable: true,
|
||||||
|
isResizable: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
i: "agent-status-1",
|
||||||
|
x: 2,
|
||||||
|
y: 2,
|
||||||
|
w: 2,
|
||||||
|
h: 2,
|
||||||
|
minW: 1,
|
||||||
|
minH: 1,
|
||||||
|
isDraggable: true,
|
||||||
|
isResizable: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
i: "orchestrator-events-1",
|
||||||
|
x: 0,
|
||||||
|
y: 3,
|
||||||
|
w: 2,
|
||||||
|
h: 2,
|
||||||
|
minW: 1,
|
||||||
|
minH: 1,
|
||||||
|
isDraggable: true,
|
||||||
|
isResizable: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
i: "quick-capture-1",
|
||||||
|
x: 2,
|
||||||
|
y: 4,
|
||||||
|
w: 2,
|
||||||
|
h: 1,
|
||||||
|
minW: 1,
|
||||||
|
minH: 1,
|
||||||
|
isDraggable: true,
|
||||||
|
isResizable: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
interface UseLayoutReturn {
|
interface UseLayoutReturn {
|
||||||
layouts: Record<string, LayoutConfig>;
|
layouts: Record<string, LayoutConfig>;
|
||||||
currentLayout: LayoutConfig | undefined;
|
currentLayout: LayoutConfig | undefined;
|
||||||
@@ -45,7 +109,18 @@ export function useLayout(): UseLayoutReturn {
|
|||||||
if (stored) {
|
if (stored) {
|
||||||
const emptyFallback: Record<string, LayoutConfig> = {};
|
const emptyFallback: Record<string, LayoutConfig> = {};
|
||||||
const parsed = safeJsonParse(stored, isLayoutConfigRecord, emptyFallback);
|
const parsed = safeJsonParse(stored, isLayoutConfigRecord, emptyFallback);
|
||||||
setLayouts(parsed as Record<string, LayoutConfig>);
|
const parsedLayouts = parsed as Record<string, LayoutConfig>;
|
||||||
|
if (Object.keys(parsedLayouts).length > 0) {
|
||||||
|
setLayouts(parsedLayouts);
|
||||||
|
} else {
|
||||||
|
setLayouts({
|
||||||
|
[DEFAULT_LAYOUT_NAME]: createDefaultLayout(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
setLayouts({
|
||||||
|
[DEFAULT_LAYOUT_NAME]: createDefaultLayout(),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load current layout ID preference
|
// Load current layout ID preference
|
||||||
@@ -195,11 +270,7 @@ export function useLayout(): UseLayoutReturn {
|
|||||||
|
|
||||||
const resetLayout = useCallback(() => {
|
const resetLayout = useCallback(() => {
|
||||||
setLayouts({
|
setLayouts({
|
||||||
[DEFAULT_LAYOUT_NAME]: {
|
[DEFAULT_LAYOUT_NAME]: createDefaultLayout(),
|
||||||
id: DEFAULT_LAYOUT_NAME,
|
|
||||||
name: "Default Layout",
|
|
||||||
layout: [],
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
setCurrentLayoutId(DEFAULT_LAYOUT_NAME);
|
setCurrentLayoutId(DEFAULT_LAYOUT_NAME);
|
||||||
}, []);
|
}, []);
|
||||||
|
|||||||
@@ -385,3 +385,4 @@
|
|||||||
| ORCH-OBS-006 | done | Add `WidgetRenderer` regression tests for hyphenated widget IDs | #411 | web | feature/mosaic-stack-finalization | ORCH-OBS-005 | | orch | 2026-02-17T16:48Z | 2026-02-17T16:50Z | 5K | 3K |
|
| ORCH-OBS-006 | done | Add `WidgetRenderer` regression tests for hyphenated widget IDs | #411 | web | feature/mosaic-stack-finalization | ORCH-OBS-005 | | orch | 2026-02-17T16:48Z | 2026-02-17T16:50Z | 5K | 3K |
|
||||||
| ORCH-OBS-007 | done | Add `OrchestratorEventsWidget` for live/recent orchestration visibility with Matrix signal hints | #411 | web | feature/mosaic-stack-finalization | ORCH-OBS-002 | | orch | 2026-02-17T16:55Z | 2026-02-17T17:03Z | 12K | 9K |
|
| ORCH-OBS-007 | done | Add `OrchestratorEventsWidget` for live/recent orchestration visibility with Matrix signal hints | #411 | web | feature/mosaic-stack-finalization | ORCH-OBS-002 | | orch | 2026-02-17T16:55Z | 2026-02-17T17:03Z | 12K | 9K |
|
||||||
| ORCH-OBS-008 | done | Integrate new widget into HUD/WidgetRegistry and extend widget regression coverage | #411 | web | feature/mosaic-stack-finalization | ORCH-OBS-007 | | orch | 2026-02-17T17:03Z | 2026-02-17T17:08Z | 10K | 7K |
|
| ORCH-OBS-008 | done | Integrate new widget into HUD/WidgetRegistry and extend widget regression coverage | #411 | web | feature/mosaic-stack-finalization | ORCH-OBS-007 | | orch | 2026-02-17T17:03Z | 2026-02-17T17:08Z | 10K | 7K |
|
||||||
|
| ORCH-OBS-009 | done | Seed default/reset local HUD layout with orchestration widgets so visibility works out-of-box | #411 | web | feature/mosaic-stack-finalization | ORCH-OBS-008 | | orch | 2026-02-17T17:10Z | 2026-02-17T17:14Z | 8K | 6K |
|
||||||
|
|||||||
Reference in New Issue
Block a user