Validate labels: the user agrees with all the labels of a finished analysis, each gets review (the date)

A change of the labels afterwards (an edit in the page, the analyst after a message) removes it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
maximeandClaude Opus 5.5 committed 2026-11-17 10:12:14 +01:00
1 parent a733575d65
commit b31371a241
4 files changed
+72 -4

No files matched your search

+7 -1
View File
@@ -539,6 +539,9 @@ function Analysis({ name, dark, done, close }) {
async function optimize() {
if (await call(`/api/analyses/${name}/optimize`, "POST") != null) setTurn(t => t + 1);
}
async function validate() {
if (await call(`/api/analyses/${name}/validate`, "POST") != null) { setTurn(t => t + 1); done(); }
}
if (!a) return <Loader size="sm" />;
const d = a.request, o = a.optimization, busy = a.state === "running", optimizing = o?.state === "running";
const end = new Date(Date.parse(d.end.slice(0, 10)) + 864e5).toISOString().slice(0, 10);
@@ -552,6 +555,9 @@ function Analysis({ name, dark, done, close }) {
{busy && <Loader size="xs" />}
</Group>
<Group gap="xs">
{a.validated ? <Badge color="green" variant="light">labels validated {a.validated}</Badge>
: a.state === "done" && <Tooltip label="I agree with all the labels of this analysis: they become reference labels">
<Button size="xs" color="green" variant="light" onClick={validate} disabled={optimizing}>Validate labels</Button></Tooltip>}
{a.state === "done" && <Tooltip label="Improve the detectors (Optimizer), then the reading tools (tool-builder), from this analysis">
<Button size="xs" variant="light" onClick={optimize} disabled={optimizing}>Optimize the detectors</Button></Tooltip>}
<ActionIcon variant="subtle" color="gray" aria-label="Close the report" onClick={close}><IconX size={16} /></ActionIcon>
@@ -560,7 +566,7 @@ function Analysis({ name, dark, done, close }) {
{d.hints && <Text size="sm" c="dimmed">Hints: {d.hints}</Text>}
{a.state === "interrupted" && <Text size="sm" c="orange">Stopped with the server before the end.{a.dialogue
? " Its session is kept: write “continue” below to resume it where it left off." : ""}</Text>}
{a.submitted !== null && a.state === "done" && <Text size="sm">{a.submitted} label(s) of this analysis in labeling/auto/{d.station}.jsonl, to review.</Text>}
{a.submitted !== null && a.state === "done" && <Text size="sm">{a.submitted} label(s) of this analysis in labeling/auto/{d.station}.jsonl{a.validated ? ", validated" : ", to validate"}.</Text>}
{a.report && <Page title="Report" src={`/api/analyses/${name}/report.html?dark=${dark}&v=${a.report}`} />}
<Thread lines={a.lines} />
{a.dialogue && (