Unnecessary Checkbox removal

This commit is contained in:
sriram
2026-09-23 11:22:51 +05:30
parent 7f601cc919
commit 5315f20ea9

View File

@@ -9,15 +9,21 @@ import { api } from '../api/client';
* A brand NAME -> the same 11-stage pipeline the spreadsheet uploader drives.
*
* Two steps, and the gap between them is the feature. Discover reads Open Food
* Facts and (optionally) the local language model and shows what it found,
* writing nothing. The operator unticks whatever looks wrong. Only then is the
* selection staged, as an ordinary catalog batch.
* Facts and the brand's own shop and shows what it found, writing nothing. The
* operator unticks whatever looks wrong. Only then is the selection staged, as
* an ordinary catalog batch.
*
* That gap is not ceremony. Open Food Facts rows are real products with real
* GTINs, but the language model can produce a well-formed product that does not
* exist, and nothing downstream can catch one: it resolves a category, gets a
* price band and an SKU, and passes the validation gate. A person reading the
* list is the only check there is, so the list is shown.
* GROUNDED SOURCES ONLY. Discovery used to offer the local language model as a
* third source, behind a "Language model" tick box. It was removed: asked to
* enumerate a brand, a small model invents plausible products, and nothing
* downstream can catch one - a well-formed fiction resolves a category, gets a
* price band and an SKU, and clears the validation gate. The catalog is meant
* to hold products that actually exist, so the only rows offered now are ones
* Open Food Facts or the brand's own storefront can vouch for. `use_llm: false`
* is sent explicitly below; see the note there.
*
* The review step stays regardless. A person reading the list is still the last
* check before anything is written, so the list is shown.
*
* There is no progress UI here on purpose. Ingest returns a BatchOut, and
* AdminPage hands it to BatchCatalogPanel through the `adoptBatch` prop it
@@ -74,7 +80,6 @@ export function BrandDiscoveryPanel({ onBatchStarted }) {
const [selected, setSelected] = useState(() => new Set());
const [useOpenfacts, setUseOpenfacts] = useState(true);
const [useLlm, setUseLlm] = useState(true);
const [requireEvidence, setRequireEvidence] = useState(true);
const [fetchImages, setFetchImages] = useState(true);
// Set by the 409 the ingest route answers with when the brand sits outside
@@ -99,13 +104,16 @@ export function BrandDiscoveryPanel({ onBatchStarted }) {
const body = await api.previewBrandDiscovery({
brand: brand.trim(),
use_openfacts: useOpenfacts,
use_llm: useLlm,
// SENT, NOT OMITTED. DiscoveryPreviewRequest.use_llm defaults to True
// on the server, so leaving the key out would quietly re-enable the
// source this panel no longer exposes.
use_llm: false,
require_evidence: requireEvidence,
});
setResult(body);
// Pre-tick what discovery judged confident. An uncorroborated row from
// the language model arrives unticked rather than hidden, so the operator
// decides rather than the default deciding for them.
// Pre-tick what discovery judged confident. A row nothing corroborates
// arrives unticked rather than hidden, so the operator decides rather
// than the default deciding for them.
setSelected(
new Set(
(body.products || [])
@@ -174,10 +182,11 @@ export function BrandDiscoveryPanel({ onBatchStarted }) {
<h2 className="text-sm font-bold text-ink-950">Brand Discovery</h2>
</div>
<p className="text-xs text-slate-600 max-w-3xl">
Enter any brand - one already in the catalog or a new one. Products are
found in Open Food Facts first, which supplies real names, pack sizes
and barcodes, and the local language model fills the gaps. Nothing is
written until you review the list and press Ingest.
Enter any brand - one already in the catalog or a new one. Products
come from Open Food Facts, which supplies real names, pack sizes and
barcodes, and from the brand's own online shop where one is
registered. Nothing is written until you review the list and press
Ingest.
</p>
<div className="flex flex-wrap items-center gap-2">
@@ -205,19 +214,13 @@ export function BrandDiscoveryPanel({ onBatchStarted }) {
</button>
</div>
<div className="grid gap-3 sm:grid-cols-2 lg:grid-cols-4">
<div className="grid gap-3 sm:grid-cols-2 lg:grid-cols-3">
<Toggle
checked={useOpenfacts}
onChange={setUseOpenfacts}
label="Open Food Facts"
hint="Real products, with barcodes"
/>
<Toggle
checked={useLlm}
onChange={setUseLlm}
label="Language model"
hint="Adds breadth; can invent products"
/>
<Toggle
checked={requireEvidence}
onChange={setRequireEvidence}
@@ -360,10 +363,11 @@ export function BrandDiscoveryPanel({ onBatchStarted }) {
{products.length === 0 && (
<p className="text-xs text-slate-500">
Nothing was found for this brand. Open Food Facts may not carry it -
non-food brands are thin there - and with "Require evidence" on, any
uncorroborated model suggestions were dropped. Try turning that off
to see them, unticked.
Nothing was found for this brand. Open Food Facts may not carry
it - non-food brands are thin there - and no verified storefront
may be registered for it. Discovery only offers products a real
source can vouch for, so an empty list means nothing was found,
not that something was hidden.
</p>
)}
</div>