From ae20ee3d9dd446e5562d4087c67f632c96e3de62 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?=
Date: Wed, 9 Sep 2026 23:16:50 +0200
Subject: [PATCH] Split the onboarding baseline inputs into their own component
The step's profile fieldset moves to `baseline-fields.tsx` unchanged.
The markup can now be rendered against a server answer on its own,
which is where the next commit puts a test.
---
src/components/onboarding/baseline-fields.tsx | 143 ++++++++++++++++++
src/components/onboarding/baseline-form.tsx | 102 +------------
2 files changed, 149 insertions(+), 96 deletions(-)
create mode 100644 src/components/onboarding/baseline-fields.tsx
diff --git a/src/components/onboarding/baseline-fields.tsx b/src/components/onboarding/baseline-fields.tsx
new file mode 100644
index 000000000..59ef5930a
--- /dev/null
+++ b/src/components/onboarding/baseline-fields.tsx
@@ -0,0 +1,143 @@
+"use client";
+
+import { Input } from "@/components/ui/input";
+import { DateField } from "@/components/ui/date-field";
+import { FieldGroup } from "@/components/ui/field-group";
+import {
+ Select,
+ SelectContent,
+ SelectItem,
+ SelectTrigger,
+ SelectValue,
+} from "@/components/ui/select";
+import { HeightFieldControl } from "@/components/profile/height-field-control";
+import { useTranslations } from "@/lib/i18n/context";
+import type {
+ HeightDraft,
+ HeightUnitAdapter,
+} from "@/lib/profile/height-unit-display";
+
+/**
+ * The four profile inputs of the onboarding baseline step.
+ *
+ * Split out of `baseline-form.tsx` so the markup can be rendered on its
+ * own against a server answer. The step's whole defect lived between
+ * the response and these inputs — the server named a field it refused
+ * and nothing on screen changed — so the seam a test needs is exactly
+ * here: field values in, markup out.
+ */
+
+export interface BaselineFieldValues {
+ displayName: string;
+ height: HeightDraft;
+ dateOfBirth: string;
+ gender: string;
+}
+
+const IDS = {
+ displayName: "ob-baseline-display-name",
+ heightCm: "ob-baseline-height",
+ dateOfBirth: "ob-baseline-dob",
+ gender: "ob-baseline-gender",
+} as const;
+
+export function BaselineFields({
+ value,
+ onChange,
+ heightAdapter,
+}: {
+ value: BaselineFieldValues;
+ onChange: (
+ key: K,
+ next: BaselineFieldValues[K],
+ ) => void;
+ heightAdapter: HeightUnitAdapter;
+}) {
+ const { t } = useTranslations();
+
+ return (
+
+ );
+}
diff --git a/src/components/onboarding/baseline-form.tsx b/src/components/onboarding/baseline-form.tsx
index 7576be392..8d81811dc 100644
--- a/src/components/onboarding/baseline-form.tsx
+++ b/src/components/onboarding/baseline-form.tsx
@@ -8,17 +8,7 @@ import { toast } from "sonner";
import { Loader2 } from "lucide-react";
import { Button } from "@/components/ui/button";
-import { DateField } from "@/components/ui/date-field";
-import { FieldGroup } from "@/components/ui/field-group";
-import { Input } from "@/components/ui/input";
-import {
- Select,
- SelectContent,
- SelectItem,
- SelectTrigger,
- SelectValue,
-} from "@/components/ui/select";
-import { HeightFieldControl } from "@/components/profile/height-field-control";
+import { BaselineFields } from "@/components/onboarding/baseline-fields";
import { useUnitDisplay } from "@/hooks/use-unit-display";
import {
EMPTY_HEIGHT_DRAFT,
@@ -201,91 +191,11 @@ export function BaselineForm() {
-
+