From d0b4b1e4cd65b2ffa4892da3046926b709cd9551 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Tue, 30 Jun 2026 12:35:36 +0200 Subject: [PATCH] fix(ui): introduce FieldGroup and unify the add-form rhythm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The measurement add form opened with a horizontal type row (label beside the select) while every field below it stacked label-above-control, so the form read with two competing rhythms. Introduce a small FieldGroup primitive — the long-standing space-y-2 label-above-control idiom in one place — and route the measurement, mood and baseline forms through it so they share one vertical rhythm. The type row now stacks like the rest. Output stays byte-identical for the already-vertical groups; only the type row changes, by design. --- .../measurements/measurement-form.tsx | 76 ++++++++++--------- src/components/mood/mood-form.tsx | 26 ++++--- src/components/onboarding/baseline-form.tsx | 50 ++++++------ src/components/ui/field-group.tsx | 51 +++++++++++++ 4 files changed, 128 insertions(+), 75 deletions(-) create mode 100644 src/components/ui/field-group.tsx diff --git a/src/components/measurements/measurement-form.tsx b/src/components/measurements/measurement-form.tsx index 40b296d82..d415d1c8c 100644 --- a/src/components/measurements/measurement-form.tsx +++ b/src/components/measurements/measurement-form.tsx @@ -12,6 +12,7 @@ import { } from "@/components/ui/dropdown-menu"; import { Input } from "@/components/ui/input"; import { DateTimeField } from "@/components/ui/date-time-field"; +import { FieldGroup } from "@/components/ui/field-group"; import { Label } from "@/components/ui/label"; import { Select, @@ -386,12 +387,9 @@ export function MeasurementForm({ return (
-
- + -
+ {isBpMode ? (
@@ -463,16 +461,16 @@ export function MeasurementForm({
) : ( -
- + -
+ )} {isGlucoseMode && ( -
- + -
+ )} -
- + - {/* v1.17.1 — surface that the timestamp is editable. The picker - already defaults to now and accepts any earlier instant; many - users never notice they can backdate a reading. */} -

- {t("measurements.timestampBackdateHint")} -

-
+ -
-
- + + } + labelAccessory={ {notes.length}/{MAX_COMMENT_LENGTH} -
+ } + > -
+ {error && (
{/* v1.8.5 (C1) — free-text note. */} -
-
- - {/* v1.11.5 — character counter so the `maxLength` cap no + + } + labelAccessory={ + /* v1.11.5 — character counter so the `maxLength` cap no longer truncates silently. Turns destructive (warns) as the - input approaches the limit. */} + input approaches the limit. */ -
+ } + >