From ad9c9cd0cde9c9f28506cce50728078df5b03a68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Tue, 20 Oct 2026 04:23:32 +0200 Subject: [PATCH] fix(day): head the since-last-visit card with TileHeader at the compact density The card hand-built an uppercase h3 and ran a density of its own. It now takes TileHeader size="sm" (which gains an h3 heading for a card under a section that owns the h2) and the compact card rhythm. --- src/components/day/since-last-visit.tsx | 32 +++++++++++-------- .../__tests__/visits-section.test.tsx | 15 +++++++++ src/components/insights/tile-header.tsx | 15 +++++---- 3 files changed, 42 insertions(+), 20 deletions(-) diff --git a/src/components/day/since-last-visit.tsx b/src/components/day/since-last-visit.tsx index c799199b3..7793771ba 100644 --- a/src/components/day/since-last-visit.tsx +++ b/src/components/day/since-last-visit.tsx @@ -17,7 +17,8 @@ import { } from "lucide-react"; import { Button } from "@/components/ui/button"; -import { Card, CardContent } from "@/components/ui/card"; +import { Card, CardContent, CardHeader } from "@/components/ui/card"; +import { TileHeader } from "@/components/insights/tile-header"; import { QueryErrorRow } from "@/components/ui/query-error-row"; import type { EncounterDTO } from "@/lib/encounters/dto"; import { apiGet } from "@/lib/api/api-fetch"; @@ -35,7 +36,7 @@ import { import { getUnitForType } from "@/lib/measurements/unit-map"; import { queryKeys } from "@/lib/query-keys"; -import { DAY_SECTION_LABEL, dayTitle, useNotableText } from "./day-sections"; +import { dayTitle, useNotableText } from "./day-sections"; import { DayLink } from "./day-link"; import { dateKeyOfInstant } from "./day-url"; import { tileKeyOf } from "./day-values-model"; @@ -212,24 +213,27 @@ export function SinceLastVisit({ const nextDay = dateKeyOfInstant(next.occurredAt, timeZone); return ( - + + + + {tCount("day.sinceLastVisit.count", rows.length)} + + } + /> +
-
-

- {t("day.sinceLastVisit.title", { date: lastLabel })} -

- - {tCount("day.sinceLastVisit.count", rows.length)} - -
    {visible.map((row) => (
  • since the last visit", () => { expect(html).toContain('data-slot="since-last-visit"'); expect(html).toContain('data-slot="since-last-visit-row"'); expect(upcomingCards(html)).toBe(upcomingCards(baseline) + 1); + // The card heads like every compact card: TileHeader at the small size, + // a real heading under the section's own, at the compact density. + const card = html.slice( + html.lastIndexOf( + '