Simplify add inventory modal: SKU scan only
Build and push image / build (push) Successful in 50s

Remove product dropdown picker and step headers. Entry is now
scan-a-SKU or create-a-new-product only.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-04 19:16:47 -04:00
parent c88b79b414
commit bae0386766
2 changed files with 12 additions and 45 deletions
+7 -42
View File
@@ -62,11 +62,11 @@ export function AddInventoryFlow({ data, onClose }: { data: Bootstrap; onClose:
: "Saved" : "Saved"
} }
eyebrow={ eyebrow={
step === "select" step === "details"
? "Step 1 · Scan or pick a product" ? "Batch details"
: step === "details" : step === "done"
? "Step 2 · This batch's details" ? "Inventory item created"
: "Inventory item created" : ""
} }
onClose={onClose} onClose={onClose}
/> />
@@ -128,9 +128,6 @@ function SelectProductStep({
const qc = useQueryClient(); const qc = useQueryClient();
const [creating, setCreating] = useState(false); const [creating, setCreating] = useState(false);
const [pickedProductId, setPickedProductId] = useState<string>(
data.products[0]?.id ?? "",
);
// New-product subform // New-product subform
const [newSku, setNewSku] = useState(""); const [newSku, setNewSku] = useState("");
@@ -213,27 +210,6 @@ function SelectProductStep({
matchedLabel={null} matchedLabel={null}
/> />
{data.products.length > 0 && !creating && (
<div style={{ marginTop: 16 }}>
<Field label="Or pick an existing product">
<Select
value={pickedProductId}
onChange={(e) => setPickedProductId(e.target.value)}
>
{data.products.map((p) => {
const strainName =
data.strains.find((s) => s.id === p.strainId)?.name ?? "?";
return (
<option key={p.id} value={p.id}>
{strainName} · {p.sku} ({p.type})
</option>
);
})}
</Select>
</Field>
</div>
)}
{!creating && ( {!creating && (
<div style={{ marginTop: 18 }}> <div style={{ marginTop: 18 }}>
<Btn variant="ghost" icon="plus" onClick={() => setCreating(true)}> <Btn variant="ghost" icon="plus" onClick={() => setCreating(true)}>
@@ -322,13 +298,13 @@ function SelectProductStep({
<div style={{ fontSize: 12, color: "var(--ink-3)" }}> <div style={{ fontSize: 12, color: "var(--ink-3)" }}>
{creating {creating
? "Create the product, then we'll capture this batch's details." ? "Create the product, then we'll capture this batch's details."
: "Scan a SKU, pick a product, or create one."} : "Scan a SKU barcode, or create a new product."}
</div> </div>
<div style={{ display: "flex", gap: 8 }}> <div style={{ display: "flex", gap: 8 }}>
<Btn variant="ghost" onClick={onClose}> <Btn variant="ghost" onClick={onClose}>
Cancel Cancel
</Btn> </Btn>
{creating ? ( {creating && (
<> <>
<Btn variant="ghost" onClick={() => setCreating(false)}> <Btn variant="ghost" onClick={() => setCreating(false)}>
Back Back
@@ -342,17 +318,6 @@ function SelectProductStep({
{create.isPending ? "Creating…" : "Create product"} {create.isPending ? "Creating…" : "Create product"}
</Btn> </Btn>
</> </>
) : (
data.products.length > 0 && (
<Btn
variant="primary"
icon="plus"
disabled={!pickedProductId}
onClick={() => onPickProduct(pickedProductId)}
>
Add inventory
</Btn>
)
)} )}
</div> </div>
</ModalFooter> </ModalFooter>
@@ -102,9 +102,11 @@ export function ModalHeader({
}} }}
> >
<div> <div>
{eyebrow && (
<div className="smallcaps" style={{ color: eyebrowColor ?? "var(--ink-3)" }}> <div className="smallcaps" style={{ color: eyebrowColor ?? "var(--ink-3)" }}>
{eyebrow} {eyebrow}
</div> </div>
)}
<h2 className="serif" style={{ fontSize: 28, margin: "4px 0 0", fontWeight: 500 }}> <h2 className="serif" style={{ fontSize: 28, margin: "4px 0 0", fontWeight: 500 }}>
{title} {title}
</h2> </h2>