Skip to content

Add local TCG collection workflow with scanner mode, import/export, and My Collection view#25

Draft
7effrey89 with Copilot wants to merge 7 commits into
mainfrom
copilot/card-scanner-feature
Draft

Add local TCG collection workflow with scanner mode, import/export, and My Collection view#25
7effrey89 with Copilot wants to merge 7 commits into
mainfrom
copilot/card-scanner-feature

Conversation

Copilot AI commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

This change adds the first end-to-end collection flow for physical Pokémon cards: users can scan a card from the existing camera dialog, confirm or retry identification, save owned cards locally in the browser, and manage counts from the TCG database. It also adds a dedicated My Collection entry in the TCG database toggle group (in the highlighted green-ring position from the issue) plus local JSON import/export from Settings.

  • Scanner collection mode

    • Added an alternate scanner mode inside the existing camera modal for collection logging.
    • Expanded the modal to show:
      • live camera preview
      • identified card preview
      • accept / retry actions
      • hint input after failed retries
      • scan history with per-entry removal
      • collection summary with editable counts
    • Accepting a match logs the card to local storage and animates the preview into the saved list.
  • Local collection persistence

    • Added a browser-local CardCollectionStore backed by localStorage.
    • Stores:
      • normalized owned card snapshots
      • per-card owned counts
      • recent scanner history
    • Added Settings actions to export/import the full collection as JSON.
  • TCG database integration

    • Added My Collection as a third toggle alongside Expansions and All Cards.
    • In card grids:
      • owned cards render normally
      • unowned cards render in monochrome
    • Added inline count controls directly on cards:
      • decrement / increment buttons
      • editable numeric input
      • immediate persistence to local collection state
  • AI / navigation wiring

    • Added shared frontend tool support for show_my_collection so chat/realtime flows can open the owned-cards view.
    • Updated canvas context text so the assistant understands when the user is viewing the collection.
  • Docs

    • Documented the new collection scanner, My Collection view, collection counters, and JSON import/export in docs/features.md.
    • Added the local collection store architecture note in docs/architecture.md.

Example of the new local collection persistence layer:

const store = new CardCollectionStore();

store.recordScan(card, { source: 'scanner' });
store.setCardCount(card, 3);

const backupJson = store.exportState();
store.importState(backupJson);

Copilot AI linked an issue Jun 10, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add card scanning feature with identification and logging Add local TCG collection workflow with scanner mode, import/export, and My Collection view Jun 10, 2026
Copilot AI requested a review from 7effrey89 June 10, 2026 11:47
@7effrey89

Copy link
Copy Markdown
Owner

the new scanner mode cant fit into screen anymore. This part needs to be able to show full on a mobile phone.
image
So we need to optimize for mobile screen estate. Consider to render the card preview and the buttons on top of the camera feed to save space. @copilot

Copilot AI commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

the new scanner mode cant fit into screen anymore. This part needs to be able to show full on a mobile phone.
<img width="1216" height="1424" alt="image" src="https://github.com/user-attachments/ass...

Addressed in 2fd7b1b.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

card scanner

2 participants