From 704001eb62a22d9b512fd17060d7e5dfa9455911 Mon Sep 17 00:00:00 2001 From: BigSimmo <87357024+BigSimmo@users.noreply.github.com> Date: Sat, 11 Jul 2026 00:53:16 +0800 Subject: [PATCH 1/2] redesign: full-width forms search results with collapsible refine bar Fix the results table clipping behind the right rail at narrow widths: drop the fixed 320px sidebar (Refine / Next steps / Source snapshot), remove the Next steps and Source snapshot cards, and let Best matches span the full page with fluid minmax(0,...) columns. Refine becomes a collapsible bar beside the tabs with an active-filter count, replacing the disabled mobile Filters stub. Also fix the tab strip forcing the content column wider than the viewport at tablet widths (min-w-0), and polish the mobile result cards. Co-Authored-By: Claude Fable 5 --- .../forms/forms-search-results-page.tsx | 431 +++++++++--------- 1 file changed, 207 insertions(+), 224 deletions(-) diff --git a/src/components/forms/forms-search-results-page.tsx b/src/components/forms/forms-search-results-page.tsx index 208717f02..89ccd0ad4 100644 --- a/src/components/forms/forms-search-results-page.tsx +++ b/src/components/forms/forms-search-results-page.tsx @@ -3,8 +3,8 @@ import Link from "next/link"; import { useRouter } from "next/navigation"; import { + ChevronDown, ChevronRight, - Clock3, ExternalLink, FileText, Loader2, @@ -16,7 +16,7 @@ import { Workflow, type LucideIcon, } from "lucide-react"; -import { useMemo } from "react"; +import { useId, useMemo, useState } from "react"; import { appModeHomeHref } from "@/lib/app-modes"; import { rankFormRecords, type FormSearchMatch } from "@/lib/forms"; @@ -50,6 +50,19 @@ const sourceSnippetCount = 278; const taskCount = 8; const pathwayCount = 12; +const refineFilters: { + icon: LucideIcon; + title: string; + subtitle: string; + enabled: boolean; + danger?: boolean; +}[] = [ + { icon: Shield, title: "High risk only", subtitle: "Show high risk forms", enabled: false, danger: true }, + { icon: FileText, title: "Official forms", subtitle: "Limit to official forms", enabled: true }, + { icon: Workflow, title: "Pathway linked", subtitle: "Show pathway-linked", enabled: true }, + { icon: Search, title: "Source matches", subtitle: "Require source match", enabled: false }, +]; + function resultCode(match: FormSearchMatch, index: number) { return formCodesBySlug[match.service.slug] ?? String(index + 1); } @@ -89,7 +102,7 @@ function ResultTabs({ formsCount }: { formsCount: number }) { return (