feat(labs): give the lab-scan review stage the width a large screen offers

The review stage is a list of readings to compare and correct, but it sat in
the default 448 px dialog, so with several readings it only grew taller.

- ResponsiveSheet gains an opt-in 6xl width tier (72rem). Nothing else
  changes width; the Sheet branch on phones ignores the tier as before.
- The review stage uses it. The picking stage stays narrow.
- Each row lays out from the width of its container, not the window:
  stacked in a narrow dialog, and once the dialog is wide enough the reading
  sits on the left with its fields on the right.
- The field grid (value, unit, date) is a container of its own, so it takes
  three columns when the fields have room for them, whatever the window
  width. The result-text span follows the same query.
- The dialog-overflow e2e spec covers the review stage at 390, 560, 768,
  1280, 1920 and 3440 px. 560 is wider than a phone's field grid needs but
  below the window sm breakpoint, which is what tells a container query from
  a window one.

Refs #1056
This commit is contained in:
BernhardBuckel committed 2026-10-02 09:14:51 +02:00
1 parent 23b813f447
commit a2a3414b29
6 files changed
+516 -220

No files matched your search

@@ -82,3 +82,36 @@ describe("<OcrRowEditor> required-field marking", () => {
expect(render({ date: true }, "de")).toContain("Bitte ein Datum angeben.");
});
});
describe("<OcrRowEditor> layout", () => {
it("lays out from the width of its container, not the window", () => {
const html = render(undefined);
expect(html).toContain('class="@container"');
// Two columns only once the container is wide; stacked below that.
expect(html).toContain("@3xl:grid-cols-");
});
it("sizes the field grid from its own container, never from the window", () => {
const numeric = render(undefined);
expect(numeric).toContain("@md:grid-cols-3");
expect(numeric).not.toMatch(/(?<![@\w-])sm:grid-cols/);
// A qualitative result spans the grid's columns; the span has to follow
// the same query as the columns, or it would open a column of its own.
const qualitative = render(undefined, "en", {
...baseRow,
value: null,
valueText: "negative",
unit: null,
});
expect(qualitative).toContain("@md:col-span-3");
expect(qualitative).not.toMatch(/(?<![@\w-])sm:col-span/);
});
it("keeps every field of the row, however the columns fall", () => {
const html = render(undefined);
for (const id of ["-val", "-unit", "-date", "-lo", "-hi", "-refText"]) {
expect(html, `field ${id}`).toContain(`${id}"`);
}
});
});