From 84fbecaeac54dbdf2ad7c3419c25583d60631240 Mon Sep 17 00:00:00 2001 From: BigSimmo <87357024+BigSimmo@users.noreply.github.com> Date: Sat, 11 Jul 2026 22:12:01 +0800 Subject: [PATCH] refactor(ui): compact mode-home heroes, cards, and headings Shrink the shared ModeHomeHero (icon, heading, subtitle) and action cards (~45% shorter) and tighten mode-home spacing so every mode home reads more compact. Optimise headings and copy: Forms title "What do you need from forms?" -> "Forms", pills "Common tasks" -> "Browse by type", and fragment the action-card descriptions across Forms, Services, Differentials, Medication, and Documents; trim the Favourites and Tools subtitles. Update ui-tools.spec.ts to the new headings and the compact hero sizing baseline (44px icon, 23.2px heading), and harden the flaky Answer->Services mode-toggle test with the same toPass re-click guard already used for the Forms switch. Co-Authored-By: Claude Opus 4.8 --- src/components/applications-launcher-page.tsx | 7 ++--- .../clinical-dashboard/differentials-home.tsx | 8 ++--- .../document-search-results.tsx | 6 ++-- .../clinical-dashboard/favourites-hub.tsx | 4 +-- .../medication-prescribing-workspace.tsx | 2 +- src/components/forms/forms-home-page.tsx | 10 +++---- src/components/mode-home-template.tsx | 30 +++++++++---------- .../services/services-home-page.tsx | 4 +-- tests/ui-tools.spec.ts | 30 +++++++++++-------- 9 files changed, 52 insertions(+), 49 deletions(-) diff --git a/src/components/applications-launcher-page.tsx b/src/components/applications-launcher-page.tsx index 72751025d..40438397f 100644 --- a/src/components/applications-launcher-page.tsx +++ b/src/components/applications-launcher-page.tsx @@ -99,8 +99,7 @@ const launcherApps: LauncherApp[] = toolCatalogRecords.map((record) => ({ const toolsLauncherCopy = { heading: "Tools", - description: - "Open the clinical tools and connected workflows you use for assessment, prescribing, documents, and saved work.", + description: "Assessment, prescribing, documents, and saved work.", allSectionLabel: "All tools", countNoun: "tools", emptyTitle: "No tools match", @@ -734,14 +733,14 @@ export function ApplicationsLauncherWorkspace({ className={cn( "mx-auto w-full max-w-[90rem] overflow-x-hidden px-4 pb-8 text-[color:var(--text)] sm:px-6 lg:px-8", "pb-[calc(12rem+env(safe-area-inset-bottom))] sm:pb-8", - "pt-7 sm:pt-10 lg:pt-14", + "pt-5 sm:pt-8 lg:pt-10", className, )} >
-
+
({ title: prompt.label, - description: "Open a prescribing-focused search.", + description: "Prescribing-focused search.", icon: prompt.icon, onClick: () => onSuggestedSearch(prompt.label), disabled: loading, diff --git a/src/components/forms/forms-home-page.tsx b/src/components/forms/forms-home-page.tsx index 03a6495c1..a5a6be5e7 100644 --- a/src/components/forms/forms-home-page.tsx +++ b/src/components/forms/forms-home-page.tsx @@ -30,19 +30,19 @@ import { countVerifiedRegistryRecords, useRegistryRecords } from "@/lib/use-regi const taskCards: ModeHomeAction[] = [ { title: "Find a form", - description: "Search by number, pathway, clock, or keyword.", + description: "Number, pathway, clock, keyword.", icon: Search, href: appModeHomeHref("forms", { focus: true }), }, { title: "Readiness checks", - description: "Review maker, clock, copies, and source.", + description: "Maker, clock, copies, source.", icon: ClipboardCheck, href: `/forms/${defaultFormSlug() ?? ""}`, }, { title: "Browse pathways", - description: "Before, current, parallel, and after forms.", + description: "Before, current, parallel, after.", icon: Route, href: appModeHomeHref("forms", { query: "forms pathway before current parallel after", @@ -113,13 +113,13 @@ export function FormsHomePage() { - -
+
{title}

@@ -219,7 +219,7 @@ export function ModeHomeTemplate({

@@ -235,20 +235,20 @@ export function ModeHomeTemplate({ {actions?.length ? (
{actions.map((action, index) => { const ActionIcon = action.icon; const content = ( <> - -