From aa0cb78d4095294f250f0f435ea2e7a2a1d3742e Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 18 Jul 2026 06:55:08 +0000 Subject: [PATCH] fix(forms): stop long pathway step codes overflowing the decision context MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The before/parallel/after lists in the decision-context card render each step code in a fixed-width column. `pathwayItems` keeps the raw string as the code when it matches a form-code shape — which includes qualified codes like "6B attachment" (form 6B lists it as a parallel step) — so the code cell overflowed into the title. Add a PathwayStepCode helper that renders only the split head ("6B") in that compact cell (reusing the shared splitFormCode), with truncation. The full code is exposed to assistive tech via an sr-only label with the decorative head marked aria-hidden, and to sighted users via a tooltip, matching FormCodeBadge's pattern; the adjacent title column already shows the full label, so nothing is lost. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01YJY1EzEXiBayz13Q6p2GwL --- src/components/forms/form-detail-page.tsx | 27 +++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/src/components/forms/form-detail-page.tsx b/src/components/forms/form-detail-page.tsx index 1c643182..e2f32132 100644 --- a/src/components/forms/form-detail-page.tsx +++ b/src/components/forms/form-detail-page.tsx @@ -43,7 +43,7 @@ import { toneSuccess, toneWarning, } from "@/components/ui-primitives"; -import { FormCodeBadge } from "@/components/forms/form-code-badge"; +import { FormCodeBadge, splitFormCode } from "@/components/forms/form-code-badge"; import { appModeHomeHref } from "@/lib/app-modes"; import { formCatalogDetails, type FormRecord } from "@/lib/form-ranker"; import type { ServiceChipTone, ServiceContact, ServiceCriterion, ServiceSummaryCard } from "@/lib/service-ranker"; @@ -202,6 +202,25 @@ function DetailCard({ card }: { card: ServiceSummaryCard }) { ); } +// Compact code cell for the pathway before/parallel/after lists. Visually it +// shows only the short head ("6B") so a qualifier like "6B attachment" can't +// overflow the fixed-width column, but the full code is exposed to assistive +// tech via an sr-only label (the decorative head is aria-hidden) and to sighted +// users via a tooltip — matching FormCodeBadge's pattern. +function PathwayStepCode({ code }: { code: string }) { + const { head, qualifier } = splitFormCode(code); + const fullCode = qualifier ? `${head} ${qualifier}` : head; + return ( + + {fullCode} + {head} + + ); +} + function PathwayContextCard({ form, code, @@ -252,7 +271,7 @@ function PathwayContextCard({ key={`${item.code}-${item.title}`} className="grid grid-cols-[3.25rem_minmax(0,1fr)] gap-2 border-b border-[color:var(--border)] p-2.5 last:border-b-0" > - {item.code} +

{item.title}

))} @@ -279,7 +298,7 @@ function PathwayContextCard({ key={`${item.code}-${item.title}`} className="grid grid-cols-[2.75rem_minmax(0,1fr)] gap-2 border-b border-[color:var(--border)] p-2.5 last:border-b-0" > - {item.code} +

{item.title}

))} @@ -294,7 +313,7 @@ function PathwayContextCard({ key={`${item.code}-${item.title}`} className="grid grid-cols-[2.75rem_minmax(0,1fr)] gap-2 border-b border-[color:var(--border)] p-2.5 last:border-b-0" > - {item.code} +

{item.title}

))}