diff --git a/docs/workspace-panel-todo.md b/docs/workspace-panel-todo.md index cd2bf127..0e8146cb 100644 --- a/docs/workspace-panel-todo.md +++ b/docs/workspace-panel-todo.md @@ -413,8 +413,31 @@ the whole table: that passes and reaches `PanelSlot.tsx:311-317`, which on a `locked` screen renders an empty teal-bordered box with no picker and no way for the user to recover. - `screens/QrTransferScreen.tsx:19-39` has the guard but no persist-back, so it re-normalises on every mount forever and never heals the row. -- [ ] **Then collapse the three default-layout mechanisms**: per-screen `defaultLayout.ts` (×20), - `createDefaultLayout()` in the core, and the 6-entry template array at `DashboardPreview.tsx:33-142`. +- [x] **~~Then collapse the three default-layout mechanisms~~ — inventoried and dropped.** Per-screen + `defaultLayout.ts` (21, not 20 — `Home/defaultLayout.tsx` is misnamed), `createDefaultLayout()` + in the core, and the 6-entry template array at `DashboardPreview.tsx:33-142`. + + They are not three copies of one mechanism. `createDefaultLayout()` is a one-liner meaning "the + empty state of a workspace" and the templates are the picker for a *user-created* dashboard, + where the user chooses the apps afterwards. The 21 files are *built-in locked screens*, where + the apps are fixed. Collapsing across that line would merge two different questions. + + Nor are the 21 duplication. Fourteen share a shape — flat horizontal split, nav on the left — + but across seven different size pairs, with panel ids that other code hardcodes (`components` + maps, `mobilePanelId`, `ChatPanelWrapper panelId=…`, and now the `appTypes` allow-lists). A + `splitH(...)` helper would turn 11 lines into 1 without removing a single decision: still 14 + call sites, still 14 argument sets, plus a layer between "what does /music look like" and the + answer. That is compression, not deduplication. + + What the inventory did turn up, none of which is an abstraction: + - **`DashboardPreview`'s edit path reset the layout on every submit** — renaming a dashboard or + editing its description threw away the panel arrangement, and dropped the terminal maps on a + rename. Fixed and verified against the running server (`cd1f161`). + - `Home/defaultLayout.tsx` is a `vertical` group with one child at `size: 100` — a bare panel + with a wrapper that does nothing, unlike Files/Terminal/Desktop next to it. Cosmetic: the + persisted `screens/home` row is what actually renders, so changing it changes nothing today. + - Browser and Email are the one genuine copy-paste pair (same nesting, same 25/75 and 60/40, + same trailing chat panel). One duplicate, and the two screens are diverging anyway. ### 5.5 Persistence hygiene @@ -654,6 +677,12 @@ Cheap to fix, and prerequisites for the 5.8 migration rather than alternatives t _(move items here with the commit and a one-line resolution)_ +- [x] **Editing a dashboard no longer resets it.** _(`cd1f161`, branch `agent-coordination-mvp`)_ — + the edit form rebuilt the layout from the template on every submit, so a rename or a typo fix in + the description silently discarded the panel arrangement; a rename additionally dropped + `ws-terminals-`/`ws-host-terminals-` instead of carrying them, abandoning every shell the + dashboard held. Found while inventorying §5.4's second item, which was itself dropped. + - [x] **The appType allow-list is a prop, not a convention.** _(`1de1d92`, branch `agent-coordination-mvp`)_ — closes the first item of §5.4. Fourteen character-identical normalisers, each with its `useMemo` and persist-back `useEffect`, collapse to