Launch Notes: MTG Collection Tracker with Scan-to-Log Workflow
2025-10-07 | 3 min read
Our trade show âcartâ experiment just matured into a true Magic: The Gathering collection tracker. You can still scan cards in seconds, but the destination is no longer a checkout listâit is the canonical record of your finishing details, condition notes, acquisition history, and locations. This is the foundation we will use for upcoming profile-backed libraries, analytics, and insuranceâgrade exports.
At-a-glance: what shipped
- Collection-aware context everywhere - the old
ScanCartProvider/floating button is gone. A newCollectionProviderkeeps state site-wide, exposes a compact "recent additions" tray, and powers both the scanner and the dedicated manager at/collection. - Expanded item model - every entry now tracks finish, condition, language, quantity, tags, and a structured acquisition object (
pricePaid,currency,acquiredAt,source,location). We keep ISO timestamps (addedAt,updatedAt) so you can diff or export chronologically. - Shareable public URLs -
/api/collectionspersists a JSON snapshot undercontent/collections/*.jsonand returns an ID. Anyone with the link (/collection?collection=abc123) can open a read-only copy that hydrates into their local tracker. - Collection manager UI -
/collectionlists the entire library with editing controls: adjust finish/condition, set quantities with +/- buttons, log purchase info, drop notes, tags, and quick-link to card pages or TCGplayer price checks. - Scanner + quick search rewired - adding from OCR or fast search now routes through
useCollection(), populating defaults (near_mint, finish inferred from pricing metadata) and incrementing existing records instead of toggling a foil checkbox. - Snapshot sidebar - the scanner page shows a "Collection Snapshot" panel with totals, recent additions, and one-click sharing. It is designed for mobile trade floors where you want a read-only dashboard and a quick link to the full manager.
Update: Compact manager view (2025-10-06)
- Added a compact row mode toggle at the top of
/collection, defaulting to summary rows so even 5,000+ card libraries stay scannable. The legacy layout is still available via the "Expanded rows" option. - Each row now shows finish, condition, quantity controls, and valuation inline, with quick access to card/price links. Deeper metadata (language, acquisition history, notes, tags) lives in a collapsible detail grid to reduce vertical sprawl.
- Collapsed detail state is tracked per card so you can expand only the entries you are actively editing without losing context when navigating around the page.
- The compact design keeps the same inline styling approach as the rest of the tracker, ensuring trade-show tablets and desktop binders share a consistent editing experience.
Technical deep dive
Data model & storage
- Replaced
ScanCartItemwithCollectionItem(lib/collection-types.ts). Important additions:printId,finish,condition,language,acquisition,notes,tags,addedAt,updatedAt. CollectionProvider(formerlyScanCartContext) handles sanitisation, localStorage persistence (takescake-collection), merge semantics, and exposes helpers for every editable field (setFinish,setCondition,setLanguage,setAcquisition,setTags,setQuantity,removeItem, etc.).- Share endpoints renamed to
/api/collectionsand/api/collections/[id]. Storage moved fromcontent/scan-carts/*tocontent/collections/*and gained optional metadata fields.
UI refresh
- Scanner CTA, quick search buttons, and card detail pages now render
AddToCollectionButton. It provides finish toggles, condition selector, quantity field, and callsaddItem({ printId, finish, condition, quantity }). CollectionSidebarreplaces the cart sidebar with stats, recents, share/load actions, and a link to/collection.RecentCollectionTrayfloats bottom-right (desktop/tablet) showing the newest entry with an âOpen collectionâ buttonâfulfilling the âalways visibleâ requirement without the commerce-style cart bubble.- Navigation now includes Collection as a first-class destination.
Scanner behaviour changes
CardScannerchooses a finish by inspecting tcgcsv subType + pricing availability, then callsaddItemwithfinish,condition: 'near_mint', and a unique composite key (printId + finish).- âAdd to cartâ language, console logging, and foil checkbox logic were removed. All strings now describe the collection tracker.
Compatibility & migration
- Old
localStorageentries undertakescake-scan-cartare ignored; users start fresh with the richer schema. Legacycontent/scan-carts/*.jsonfiles were deleted. - API consumers expecting
/api/scan-cartsshould switch to/api/collections. - Card pricing helpers (
lib/build-collection-pricing.ts) and API responses (/api/cards/versions,/api/cards/scan) now emitCollectionPricing.
Whatâs next
- Authentication + profile-backed persistence so collections follow users across devices without manual sharing.
- Smart grouping (decks vs binders), bulk edits, and CSV/portfolio exports.
- Alerts for mismatched finishes/conditions when you scan variants we already know about.
- Insurance/export bundles that include acquisition history, photos, and valuation snapshots.
Let us know what data points you still track elsewhereâweâre structuring the schema now so we can deliver stable APIs alongside the UI. Happy cataloguing!