From 3c3adcdea9bdcc6fd203ee4754d1fe4ddf36f281 Mon Sep 17 00:00:00 2001 From: dlawler489 <104159223@student.swin.edu.au> Date: Sat, 13 Jun 2026 12:24:38 +1000 Subject: [PATCH] Let resolver process a subset; skip untouched rows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously submitting created a £0 product for every unmatched row the user didn't touch, silently hiding it from the unmatched list. Now rows with no chosen product and no printing cost are skipped and stay unmatched, so items can be resolved a few at a time across syncs. Co-Authored-By: Claude Fable 5 --- .../src/components/MissingProductsModal.tsx | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/client/src/components/MissingProductsModal.tsx b/client/src/components/MissingProductsModal.tsx index 9b5ad6d..44657f7 100644 --- a/client/src/components/MissingProductsModal.tsx +++ b/client/src/components/MissingProductsModal.tsx @@ -86,10 +86,19 @@ export const MissingProductsModal: React.FC = ({ try { const newProducts: any[] = []; const existingMatches: any[] = []; + let skipped = 0; for (const product of missingProducts) { const data = productData[product.title] || {}; - + + // Skip rows the user didn't act on (no existing product chosen and no + // printing cost entered) so they can resolve a few now and the rest + // later — untouched items stay unmatched instead of becoming £0 products + if (!data.useExisting && data.printingCost === undefined) { + skipped++; + continue; + } + // If user selected to use an existing product, save the packing-slip // title as an alias on it so this and all future imports match it // deterministically @@ -166,6 +175,9 @@ export const MissingProductsModal: React.FC = ({ if (existingMatches.length > 0) { toast.success(`Matched ${existingMatches.length} items to existing products`); } + if (skipped > 0) { + toast(`${skipped} item(s) left for later — they'll still show as unmatched`); + } console.log('Products processed successfully, calling onComplete...'); @@ -199,10 +211,12 @@ export const MissingProductsModal: React.FC = ({

- Found unmatched product: "{missingProducts[0]?.title}" + {missingProducts.length} unmatched item{missingProducts.length === 1 ? '' : 's'}

- This product isn't in your database yet. Add printing costs to complete the import. + Match each to an existing product or enter a printing cost to create it. + You don't have to do them all now — rows you leave blank stay unmatched + and you can resolve them next time.