2026-08-14 21:20:43 -04:00
|
|
|
export default function ScannerCountPill({ count, onReview, onOpenCheckout }) {
|
|
|
|
|
const handleClick = onOpenCheckout || onReview;
|
|
|
|
|
|
feat(scanner): rebuild as mobile-first three-phase flow
Replace the desktop-first, everything-at-once scanner layout with a
phased mobile-optimized experience: Setup → Scanning → Review.
Phase 1 (Setup): destination picker, game filter, deck mode toggle,
scan history (last 5 sessions).
Phase 2 (Scanning): full-screen camera with auto-start, haptic + sound
feedback on card detection, torch/flash toggle, count pill, bottom-sheet
disambiguation (replaces full-screen modal).
Phase 3 (Review): card list with inline condition/foil/qty edits,
batch confirm, 30-second undo, deck progress indicator.
New features:
- Deck mode (progress toward 40/60/99 card target)
- Scan history (persisted to localStorage)
- Sound feedback (Web Audio oscillator, configurable)
- Offline queue (localStorage persistence + auto-retry on reconnect)
- Camera flash/torch toggle
- Batch ownership API (replaces N+1 per-card fetches)
- Visibility pause (detection loop stops when tab is backgrounded)
Convoy: scanner-rebuild
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-13 09:42:58 -04:00
|
|
|
if (count <= 0) return null;
|
|
|
|
|
|
|
|
|
|
return (
|
2026-08-14 21:20:43 -04:00
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
onClick={handleClick}
|
|
|
|
|
className="rounded-full px-4 py-2 text-sm font-semibold transition-transform active:scale-95 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2"
|
|
|
|
|
style={{
|
|
|
|
|
background: 'var(--gradient-primary)',
|
|
|
|
|
color: 'var(--text-primary-dark)',
|
|
|
|
|
boxShadow: 'var(--ember-rim-pronounced)',
|
|
|
|
|
minHeight: 44,
|
|
|
|
|
minWidth: 44,
|
|
|
|
|
'--tw-ring-color': 'var(--accent-ember)',
|
|
|
|
|
'--tw-ring-offset-color': 'transparent',
|
|
|
|
|
}}
|
|
|
|
|
aria-label={`Review ${count} scanned cards`}
|
|
|
|
|
>
|
|
|
|
|
Review {count}
|
|
|
|
|
</button>
|
feat(scanner): rebuild as mobile-first three-phase flow
Replace the desktop-first, everything-at-once scanner layout with a
phased mobile-optimized experience: Setup → Scanning → Review.
Phase 1 (Setup): destination picker, game filter, deck mode toggle,
scan history (last 5 sessions).
Phase 2 (Scanning): full-screen camera with auto-start, haptic + sound
feedback on card detection, torch/flash toggle, count pill, bottom-sheet
disambiguation (replaces full-screen modal).
Phase 3 (Review): card list with inline condition/foil/qty edits,
batch confirm, 30-second undo, deck progress indicator.
New features:
- Deck mode (progress toward 40/60/99 card target)
- Scan history (persisted to localStorage)
- Sound feedback (Web Audio oscillator, configurable)
- Offline queue (localStorage persistence + auto-retry on reconnect)
- Camera flash/torch toggle
- Batch ownership API (replaces N+1 per-card fetches)
- Visibility pause (detection loop stops when tab is backgrounded)
Convoy: scanner-rebuild
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-13 09:42:58 -04:00
|
|
|
);
|
|
|
|
|
}
|