diff --git a/src/apps/officer-web/Screens/Dashboard/CommandHQ/CommandHqScreen.tsx b/src/apps/officer-web/Screens/Dashboard/CommandHQ/CommandHqScreen.tsx index 4a9874eb..29e81bfd 100644 --- a/src/apps/officer-web/Screens/Dashboard/CommandHQ/CommandHqScreen.tsx +++ b/src/apps/officer-web/Screens/Dashboard/CommandHQ/CommandHqScreen.tsx @@ -1,15 +1,29 @@ +import { useEffect } from 'react'; import type { LayoutNode } from 'officerdev'; import { WorkspaceView } from 'officerdev'; import { useDashboardState } from 'state/useDashboardState'; -import { defaultLayout } from './defaultLayout'; +import { defaultLayout, isLegacyThreeColumn } from './defaultLayout'; -// /command-hq: nav + grid + detail, all three always mounted (like /chat), selection carried by the URL +// /command-hq: navigation and detail, all panels always mounted (like /chat), selection carried by the URL // — `?category=` for the nav filter, `:sessionId` for the open commander. See `docs/command-hq.md` → -// "Route, surface, placement" and "Layout, v1". +// "Route, surface, placement". export const CommandHqScreen = () => { const workspace = useDashboardState('screens/command-hq', defaultLayout); + /* + Move a saved three-column layout onto the two-column one. + + The default alone cannot do it: this key is persisted per account, so anybody who has opened the screen + keeps the arrangement they had. See `isLegacyThreeColumn` for why the test is structural rather than an + appType check, and why replacing outright is the safe direction on a `locked` screen. + */ + useEffect(() => { + if (!workspace.isLoaded) return; + if (!isLegacyThreeColumn(workspace.value)) return; + workspace.setValue(defaultLayout); + }, [workspace.isLoaded, workspace.value, workspace.setValue]); + return (
{ }; return ( -
-
-
- -
-
-
Command HQ
-
Watchers & long-running jobs
-
-
+ /* + One scrollable list, and a heading that does not scroll with it. - + This was a nav COLUMN with the screen's branding at the top — a 9px Radar tile, "Command HQ", and + "Watchers & long-running jobs" — costing about seventy pixels. All three are gone: the panel now sits + at the FOOT of the left column rather than owning it, so the vertical room is the whole budget, and the + screen's own header already says Command HQ two inches above. Repeating it in a filter panel was + branding where a list should be. -
+ `All commanders` and `Uncategorised` are inside the scroll box with the categories rather than in a + separate nav above it. They are the same kind of thing — a filter over the list — and splitting them + into two nav blocks made the second look like a different mechanism. + */ +
+
Categories
-