From c51ec6a04c49707052a625d5421fca78e1cbe758 Mon Sep 17 00:00:00 2001 From: varutasu <104105839+varutasu@users.noreply.github.com> Date: Thu, 28 May 2026 14:45:55 -0500 Subject: [PATCH] Normalize collector numbers in catalog match and harden scanner adds. (#53) Share card-number normalization across reconcile and identify paths, retry set/name matches when OCR uses leading-zero collector numbers, and extend in-flight locks to all scanner destination actions with disabled Mark Owned feedback. Co-authored-by: Cursor --- components/ScannedCardItem.js | 6 +- lib/card-catalog-match.js | 80 ++++++++++++------- lib/card-import/reconcile-submissions.js | 23 +----- lib/card-number-utils.js | 35 ++++++++ pages/scanner.js | 51 ++++++++++-- .../card-import-reconcile-submissions.test.js | 8 -- test/lib/card-number-utils.test.js | 35 ++++++++ 7 files changed, 170 insertions(+), 68 deletions(-) create mode 100644 lib/card-number-utils.js create mode 100644 test/lib/card-number-utils.test.js diff --git a/components/ScannedCardItem.js b/components/ScannedCardItem.js index ba76275..292ee66 100644 --- a/components/ScannedCardItem.js +++ b/components/ScannedCardItem.js @@ -15,6 +15,7 @@ export default function ScannedCardItem({ onAddToCollection, onAddToDeck, onRemove, + isAdding = false, }) { const [ownedQuantity, setOwnedQuantity] = useState(null); @@ -217,11 +218,12 @@ export default function ScannedCardItem({