From f3388ceb707ef10ea787efa9798ddb0fba47126c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Tue, 16 Jun 2026 21:32:58 +0200 Subject: [PATCH] =?UTF-8?q?feat(cycle):=20redesign=20the=20log-day=20sheet?= =?UTF-8?q?=20=E2=80=94=20phase=20header,=20field=20info,=20wider=20dialog?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Anchor the capture surface to the ring and lower its cognitive load: - A hue-tinted phase-context strip (day-of-cycle + phase) at the top of the sheet, on the wellness-tile surface, honesty-gated the same way the phase- education card is — no phase claim until prediction is on, not raw-chart, and at least three cycles observed; otherwise a neutral day header. - Inline field explainers (FieldInfo) on the clinical fields: BBT, cervical mucus, ovulation test, spotting, pregnancy/progesterone test, intercourse, protection — factual, descriptive-only, reachable by keyboard and screen reader. - BBT is now the shadcn Input rather than a bare element, with a morning- timing hint, so it matches every other control. - The symptothermal section (Temperature & ovulation) auto-expands for fertility goals and for an edited day that already holds a fertility sign, so a pre-filled value is never hidden behind a collapsed section. - Desktop dialog widened to lg so the form breathes. The payload builders and the form-hydration reconciliation are unchanged, so the wire contract and their unit tests are untouched. --- .../cycle/__tests__/field-info.test.tsx | 36 +++ .../cycle/__tests__/phase-day-header.test.tsx | 73 +++++ src/components/cycle/cycle-view.tsx | 6 + src/components/cycle/log-day-sheet.tsx | 254 ++++++++++++++++-- 4 files changed, 344 insertions(+), 25 deletions(-) create mode 100644 src/components/cycle/__tests__/field-info.test.tsx create mode 100644 src/components/cycle/__tests__/phase-day-header.test.tsx diff --git a/src/components/cycle/__tests__/field-info.test.tsx b/src/components/cycle/__tests__/field-info.test.tsx new file mode 100644 index 000000000..c97a58e63 --- /dev/null +++ b/src/components/cycle/__tests__/field-info.test.tsx @@ -0,0 +1,36 @@ +import { describe, it, expect } from "vitest"; +import { renderToStaticMarkup } from "react-dom/server"; + +import { FieldInfo } from "../field-info"; +import { I18nProvider } from "@/lib/i18n/context"; + +function render(node: React.ReactNode) { + return renderToStaticMarkup( + {node}, + ); +} + +describe("", () => { + it("is a real focusable button carrying the accessible label", () => { + const html = render( + , + ); + // A real