From 50d61a78d5181691c0894e7c5ec3d54872c6e57c Mon Sep 17 00:00:00 2001 From: josh Date: Mon, 4 May 2026 19:22:10 -0400 Subject: [PATCH] Simplify consume modal: asset ID scan only Remove eyebrow header, dropdown picker, and SKU matching. Require scanning the physical asset ID to mark consumed. Co-Authored-By: Claude Opus 4.6 --- web/src/components/modals/ConsumeFlow.tsx | 24 +++-------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/web/src/components/modals/ConsumeFlow.tsx b/web/src/components/modals/ConsumeFlow.tsx index 8e9b99d..29f4cfd 100644 --- a/web/src/components/modals/ConsumeFlow.tsx +++ b/web/src/components/modals/ConsumeFlow.tsx @@ -2,10 +2,9 @@ import { useState } from "react"; import { useMutation, useQueryClient } from "@tanstack/react-query"; import type { Bootstrap, Item } from "../../types.js"; import { helpers, TODAY_STR, enrichItems } from "../../types.js"; -import { remainingShort } from "../../stats.js"; import { fmt } from "../../format.js"; import { api } from "../../api.js"; -import { Btn, Field, Icon, Input, Select, Textarea } from "../primitives/index.js"; +import { Btn, Field, Icon, Input, Textarea } from "../primitives/index.js"; import { ScanField, type ScanResult } from "../ScanField.js"; import { ModalBackdrop, ModalHeader, ModalFooter } from "./ModalChrome.js"; import { useToast } from "../Toast.js"; @@ -44,11 +43,6 @@ export function ConsumeFlow({ const handleScan = (result: ScanResult) => { if (result.kind === "item") { setItemId(result.item.id); - } else { - const candidate = active - .filter((i) => i.productId === result.product.id) - .sort((a, b) => +new Date(b.purchaseDate) - +new Date(a.purchaseDate))[0]; - if (candidate) setItemId(candidate.id); } }; @@ -68,28 +62,16 @@ export function ConsumeFlow({ boxShadow: "var(--shadow-lg)", }} > - +
-
- - - -
-