Skip to content

Dashboard v1 phase 2 (#280): atomic StoredWorkspaceV1 persistence + legacy migration #284

Description

@BorisTyshkevich

Part of #280 (Dashboard as a first-class module). Phase 2 of 6, after Phase 1 (contracts). Normative spec in #280.

Goal

Browser persistence moves from flat per-feature localStorage keys to one atomic StoredWorkspaceV1 aggregate behind WorkspaceRepository, with one-shot migration from legacy keys.

Scope (from #280 "Phase 2: atomic persistence and migration")

  • WorkspaceRepository with atomic replacement semantics: validate the complete candidate before writing; publish committed state only after persistence succeeds; failed persistence leaves the previous stored workspace intact, the draft dirty, and revision unchanged; never partially replace queries/dashboard/layout/metadata.
  • Legacy migration exactly per Make Dashboard a first-class module with one-dashboard-per-current-workspace v1 UX #280 "Legacy migration marker": runs only when no aggregate exists; builds the initial Dashboard from legacy favorites; converts legacy layout preferences (asb:dashLayout, asb:dashCols, …) to flow@1; validates the whole candidate; persists atomically; legacy keys untouched until the aggregate write succeeds.
  • Workspace operation semantics (rename, new-workspace, replace-from-bundle, reload) per Make Dashboard a first-class module with one-dashboard-per-current-workspace v1 UX #280.
  • Multi-tab policy: last successful commit wins; documented; test proving a commit never produces a partially mixed workspace.

Decisions to settle in this phase

Dependencies

Phase 1 (schemas/validation/canonical encoder). Coordinate with #276 phase 4 (AppPreferences service) so preference persistence isn't extracted twice.

Tests

Per #280 "Workspace persistence and migration": atomic commit; failed write preserves prior workspace + dirty draft + revision; migration runs once keyed on aggregate existence; legacy keys survive until successful commit; multi-tab last-write-wins never mixes aggregates.

Acceptance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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