From 32da5bf079c45ae103ba90b4dae39e2185f996f3 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Sun, 19 Jul 2026 16:03:57 +0100 Subject: [PATCH] feat(reporting): restyle scenario filter descriptions to match MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Apply the new structured tooltip treatment to the scenario filters, so their descriptions read like the cost figures': a summary line plus a subtle footnote, in the same larger, rounded ⓘ card. - Extract the tooltip body into a shared `tipContent.tsx` (TipBody + TipSpec); costHelp now consumes it instead of its own copy. - FilterChips: the two toggle chips use the shared `InfoDot`; the "skip already-compliant" popover reuses the same structured copy. Filter help now lives in one `FILTER_HELP` map. Copy/present only — no filter behaviour changed. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../reporting/components/FilterChips.tsx | 66 +++++++++---------- .../reporting/components/costHelp.tsx | 51 +------------- .../reporting/components/tipContent.tsx | 52 +++++++++++++++ 3 files changed, 88 insertions(+), 81 deletions(-) create mode 100644 src/app/portfolio/[slug]/(portfolio)/reporting/components/tipContent.tsx diff --git a/src/app/portfolio/[slug]/(portfolio)/reporting/components/FilterChips.tsx b/src/app/portfolio/[slug]/(portfolio)/reporting/components/FilterChips.tsx index 177b3cd0..41af66c3 100644 --- a/src/app/portfolio/[slug]/(portfolio)/reporting/components/FilterChips.tsx +++ b/src/app/portfolio/[slug]/(portfolio)/reporting/components/FilterChips.tsx @@ -1,12 +1,6 @@ "use client"; -import { X, Info, ChevronDown } from "lucide-react"; -import { - Tooltip, - TooltipContent, - TooltipProvider, - TooltipTrigger, -} from "@/app/shadcn_components/ui/tooltip"; +import { X, ChevronDown } from "lucide-react"; import { Popover, PopoverContent, @@ -20,6 +14,30 @@ import { SelectValue, } from "@/app/shadcn_components/ui/select"; import { EPC_BANDS } from "@/lib/epc/bands"; +import { InfoDot } from "./primitives"; +import { TipBody, type TipSpec } from "./tipContent"; + +/** Structured "what this filter does" copy — same shape/look as the cost ⓘs. */ +const FILTER_HELP: Record< + "reachTarget" | "lodgedBaseline" | "complianceWindow", + TipSpec +> = { + reachTarget: { + summary: + "Counts only homes whose modelled result reaches this scenario's target band.", + note: "Homes still short of target after the works drop out of every figure, so costs and outcomes cover the fully-compliant homes only.", + }, + lodgedBaseline: { + summary: + "Decides which homes need work from their official lodged EPC band on the government register, not Domna's modelled current band.", + note: "Use it to match what the register says a home needs.", + }, + complianceWindow: { + summary: + "Leaves out homes whose official (lodged) EPC already meets the band below and stays valid past the date.", + note: "The government counts these as compliant beyond then, so costs and outcomes show only the works on the remaining homes.", + }, +}; /** * Inline scenario filter chips (Screen B). State is always visible and @@ -49,12 +67,12 @@ function ToggleChip({ on, onToggle, label, - help, + tip, }: { on: boolean; onToggle: () => void; label: string; - help: string; + tip: React.ReactNode; }) { return ( } - - - - - - - {help} - - - + ); } @@ -118,7 +121,7 @@ export function FilterChips({ onChange({ ...filters, hideNonCompliant: !filters.hideNonCompliant }) } label="Only homes that reach target" - help="Counts only the homes whose modelled result actually reaches this scenario's target band. Homes still short of target after the works drop out of every figure — so costs and outcomes cover the fully-compliant homes only." + tip={} /> {/* Compliance window — editable band + date */} @@ -142,12 +145,9 @@ export function FilterChips({
Skip already-compliant homes
-

- Leave out homes whose official (lodged) EPC already meets the band - below and stays valid past the date — homes the government counts as - compliant beyond then. The costs and outcomes then show only the - works on the remaining homes. -

+
+ +