Context
Surfaced during #287 (Dashboard v1 Phase 5) review. Now that the StoredWorkspaceV1 aggregate is the source of truth and dashboard.tiles[] is the canonical Dashboard membership (#280), the Workbench star button still only flips spec.favorite — it does not add/remove a Dashboard tile.
src/ui/saved-history.ts star handler → toggleFavorite (src/state.ts) → patchSavedSpec → commits the workspace with the toggled spec.favorite, but never touches state.dashboard.tiles.
- The one-shot legacy migration (
src/workspace/legacy-migration.ts) is the only place favorites are turned into tiles, and only when no aggregate exists yet.
Effect
After the aggregate exists, starring a query in the Workbench does not make it appear as a tile in the Dashboard (/sql/dashboard), and un-starring does not remove one. This is a pre-existing #285-adjacent gap that #287 deliberately did not fix (it was out of scope — #287 unified persistence and the file-I/O front door, not the star→membership wiring).
Proposed
Wire the star action to Dashboard add-query / remove-tile commands (src/dashboard/application/dashboard-commands.ts, already built in Phase 3) against state.dashboard, committing through the same app.serializeWrite + WorkspaceRepository.commit path, and retire the temporary spec.favorite dual-write once membership reads entirely from dashboard.tiles[] (per #280's documented removal path).
Context
Surfaced during #287 (Dashboard v1 Phase 5) review. Now that the
StoredWorkspaceV1aggregate is the source of truth anddashboard.tiles[]is the canonical Dashboard membership (#280), the Workbench star button still only flipsspec.favorite— it does not add/remove a Dashboard tile.src/ui/saved-history.tsstar handler →toggleFavorite(src/state.ts) →patchSavedSpec→ commits the workspace with the toggledspec.favorite, but never touchesstate.dashboard.tiles.src/workspace/legacy-migration.ts) is the only place favorites are turned into tiles, and only when no aggregate exists yet.Effect
After the aggregate exists, starring a query in the Workbench does not make it appear as a tile in the Dashboard (
/sql/dashboard), and un-starring does not remove one. This is a pre-existing #285-adjacent gap that #287 deliberately did not fix (it was out of scope — #287 unified persistence and the file-I/O front door, not the star→membership wiring).Proposed
Wire the star action to Dashboard
add-query/remove-tilecommands (src/dashboard/application/dashboard-commands.ts, already built in Phase 3) againststate.dashboard, committing through the sameapp.serializeWrite+WorkspaceRepository.commitpath, and retire the temporaryspec.favoritedual-write once membership reads entirely fromdashboard.tiles[](per #280's documented removal path).