From 32d6d87c8fba129e2cad3d535c78a5e93927f0b9 Mon Sep 17 00:00:00 2001 From: BigSimmo <87357024+BigSimmo@users.noreply.github.com> Date: Thu, 13 Aug 2026 02:15:10 +0800 Subject: [PATCH 01/37] fix(forms): expand details without repeated preview --- src/components/forms/form-detail-page.tsx | 4 ++++ src/components/ui/disclosure.tsx | 17 ++++++++++++++--- tests/forms-information-disclosure.dom.test.tsx | 2 ++ tests/ui-forms-section-nav.spec.ts | 17 +++++++++++++++++ 4 files changed, 37 insertions(+), 3 deletions(-) diff --git a/src/components/forms/form-detail-page.tsx b/src/components/forms/form-detail-page.tsx index 667175ca07..35e057ad48 100644 --- a/src/components/forms/form-detail-page.tsx +++ b/src/components/forms/form-detail-page.tsx @@ -844,6 +844,10 @@ function formInformationItems(rows: Array<{ label: string; value?: string | null ), description: value, + // The collapsed line is a preview of this same value. Opening the row + // replaces that preview with the fully wrapped answer instead of echoing + // it in a visually separate, bordered panel. + extendDescription: true, content:

{value}

, }; }); diff --git a/src/components/ui/disclosure.tsx b/src/components/ui/disclosure.tsx index 3d343d1087..0a610b121e 100644 --- a/src/components/ui/disclosure.tsx +++ b/src/components/ui/disclosure.tsx @@ -10,6 +10,8 @@ export type DisclosureProps = { /** Right-aligned summary that stays visible while collapsed — a count, a status. */ meta?: ReactNode; description?: ReactNode; + /** Replace the collapsed preview with the panel when open, so the copy reads as one continuous answer. */ + extendDescription?: boolean; defaultOpen?: boolean; /** Controlled mode. Omit both to let the component own its state. */ open?: boolean; @@ -48,6 +50,7 @@ export function Disclosure({ children, meta, description, + extendDescription = false, defaultOpen = false, open: controlledOpen, onOpenChange, @@ -101,7 +104,7 @@ export function Disclosure({ trigger stays label-sized. Full copy lives in the panel for SR once expanded. Wrap from sm+ so desktop scanners are not forced through a tap the way phone truncation requires. */} - {description ? ( + {description && !(extendDescription && open) ? (