Skip to content

P1: DeckContext + deckStorage + draft→cloud migration #465

Description

@Doberjohn

Working-deck state with local drafts + cloud sync.

Scope

  • DeckContext/useDeck (mounted under CardDataProvider): addCard/removeCard/setQuantity/markCore/setGameplan/renameDeck/clearDeck.
  • deckStorage.ts — localStorage draft persistence built exactly like features/voting/lib/voteStorage.ts (inkweave:deck:* keys, safe read/write, schemaVersion).
  • Debounced Supabase sync when authed (last-write-wins by updatedAt).
  • First-sign-in draft → cloud migration (idempotent, guarded by inkweave:deck:migrated:<uid>).

Tests: deckStorage namespacing + corruption-clear; migration idempotency.

Part of #451 · Deck Builder & Engine Score milestone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    deck-builderDeck builder + advisor + Engine Score initiativefeatureNew feature or functionalitytestingTest coverage and quality

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions