Merge branch 'feat/unitless' into release/v1.46.6

This commit is contained in:
Marc-André Bombeck committed 2026-11-02 20:30:41 +01:00
commit 2c6fb82326
55 files changed
+1029 -127

No files matched your search

@@ -37,10 +37,12 @@ import { Checkbox } from "@/components/ui/checkbox";
import { DateField } from "@/components/ui/date-field";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { LabUnitInput } from "@/components/labs/lab-unit-input";
import { MarkerMatchField } from "@/components/labs/marker-match-field";
import type { BiomarkerListResponse } from "@/components/labs/types";
import { apiGet } from "@/lib/api/api-fetch";
import type { DocumentExtractRunResult } from "@/lib/documents/ai-runs/types";
import { withLabUnit } from "@/lib/labs/dimensionless";
import { useTranslations } from "@/lib/i18n/context";
import { queryKeys } from "@/lib/query-keys";
import { cn } from "@/lib/utils";
@@ -81,7 +83,7 @@ function factHeadline(fact: ExtractedFactDto): string {
const data = fact.data as ObservationFactData;
const value =
typeof data.value === "number"
? `${data.value}${data.unit ? ` ${data.unit}` : ""}`
? withLabUnit(String(data.value), data.unit)
: (data.valueText ?? "");
return value ? `${data.label}: ${value}` : data.label;
}
@@ -412,13 +414,12 @@ export function FactRow({
? t("documents.review.fieldUnit")
: t("documents.review.fieldDose")}
</Label>
<Input
<LabUnitInput
id={`fact-unit-${fact.id}`}
value={draft.unit}
onChange={(e) =>
setDraft((d) => ({ ...d, unit: e.target.value }))
}
onChange={(unit) => setDraft((d) => ({ ...d, unit }))}
maxLength={isObservation ? 80 : 120}
allowNoUnit={isObservation}
/>
</div>
) : null}