This commit is contained in:
@@ -397,6 +397,28 @@ export default function ScanClient({ initialOp, viewer }: { initialOp: ScanOp; v
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{/*
|
||||
Preview what Done will do. Keeps the match in lockstep with the
|
||||
close route's partial-detection logic: units blank or >=
|
||||
remaining means "fully done", anything less is a partial
|
||||
handoff that releases the claim so the next operator can pick
|
||||
it up.
|
||||
*/}
|
||||
{(() => {
|
||||
const typed = units ? Number(units) : 0;
|
||||
const remaining = Math.max(0, totalUnits - op.unitsCompleted);
|
||||
const willPartial = typed > 0 && typed < remaining;
|
||||
return willPartial ? (
|
||||
<div className="rounded-md bg-orange-50 border border-orange-200 text-orange-900 text-xs px-3 py-2">
|
||||
Pressing <span className="font-semibold">Done</span> with {typed} of {remaining}{" "}
|
||||
remaining will mark this step <span className="font-semibold">Partial</span> and
|
||||
release the claim so another operator can resume. Enter{" "}
|
||||
<span className="font-mono">{remaining}</span> (or leave blank) if you actually
|
||||
finished the batch.
|
||||
</div>
|
||||
) : null;
|
||||
})()}
|
||||
|
||||
<div className="grid grid-cols-2 gap-3">
|
||||
<button
|
||||
onClick={onRelease}
|
||||
|
||||
Reference in New Issue
Block a user