Skip to content

Wire the Workbench star button to Dashboard tile membership (post-#287 aggregate) #299

Description

@BorisTyshkevich

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    inboxFiled mid-task; not yet triaged into the roadmap

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions