diff --git a/src/app/insights/medikamente/page.tsx b/src/app/insights/medikamente/page.tsx index 0f3aefd1e..92e6149ca 100644 --- a/src/app/insights/medikamente/page.tsx +++ b/src/app/insights/medikamente/page.tsx @@ -8,7 +8,7 @@ import { useAuth } from "@/hooks/use-auth"; import { useTranslations } from "@/lib/i18n/context"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; -import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; +import { Card, CardContent } from "@/components/ui/card"; import { EmptyState } from "@/components/ui/empty-state"; import { Progress } from "@/components/ui/progress"; import { ComplianceHeatmap } from "@/components/charts/compliance-heatmap"; @@ -16,6 +16,7 @@ import { CoachLaunchButton } from "@/components/insights/coach-launch-button"; import { InsightStatusCard } from "@/components/insights/insight-status-card"; import { SubPageShell } from "@/components/insights/sub-page-shell"; import { TherapyTimeline } from "@/components/insights/therapy-timeline"; +import { MedicationCardHeader } from "@/components/medications/MedicationCardHeader"; /** * v1.4.25 W4 — `/insights/medikamente`. @@ -155,31 +156,31 @@ export default function InsightsMedikamentePage() { > {medications.map((med) => { const medicationSummary = medicationSummaryById.get(med.id); + // UI-H3 — route every medication-list row (medications page + // + insights/medikamente) through `` + // so the surface stays one shape: `{name} {dose}` on line 1 + // + outline category badge on line 2. The streak chip rides + // the `stateBadges` slot so a strong streak still surfaces. + const categoryLabel = + med.category === "BLOOD_PRESSURE" + ? t("medications.categoryBloodPressure") + : med.category === "VITAMIN" + ? t("medications.categoryVitamin") + : t("medications.categoryOther"); + const streakBadge = + med.streak > 0 ? ( + + {t("insights.dayStreak", { count: med.streak })} + + ) : null; return ( - - {/* v1.4.27 MB7 / MA2-F8 — `min-w-0` on the title - wrapper + `truncate` on the CardTitle keeps long - medication names (e.g. "Semaglutid Wegovy 0.5 mg - weekly") from pushing the streak badge off the - card on Galaxy Fold / Pixel 5. The Pill icon - + CardTitle pair shrinks to fit; the badge stays - on the right at its natural width. */} -
-
- - - {med.name} - -
- {med.streak > 0 && ( - - {t("insights.dayStreak", { count: med.streak })} - - )} -
-

{med.dose}

-
+
diff --git a/src/components/targets/__tests__/target-coach-button.test.tsx b/src/components/targets/__tests__/target-coach-button.test.tsx index 25bfd10f5..752811b1b 100644 --- a/src/components/targets/__tests__/target-coach-button.test.tsx +++ b/src/components/targets/__tests__/target-coach-button.test.tsx @@ -6,8 +6,8 @@ import { TargetCoachButton } from "../target-coach-button"; /** * v1.4.25 W3e — gate test for the per-card Coach CTA. The button - * MUST disappear when `aiEnabled` is false (Marc directive: no - * broken-button state for users with no AI provider configured). + * MUST disappear when `aiEnabled` is false (the maintainer's rule: + * no broken-button state for users with no provider configured). */ function render(props: Parameters[0]) { @@ -33,8 +33,12 @@ describe("", () => { // still surface "Ask Coach" / "Coach fragen". expect(html).toContain('aria-label="Ask Coach"'); expect(html).toContain('title="Ask Coach"'); - // No visible text label — only the chat-bubble glyph. + // No visible text label — only the Sparkles glyph. expect(html).not.toMatch(/>Ask Coach { diff --git a/src/components/targets/target-coach-button.tsx b/src/components/targets/target-coach-button.tsx index beb09f2a0..0f043577b 100644 --- a/src/components/targets/target-coach-button.tsx +++ b/src/components/targets/target-coach-button.tsx @@ -1,6 +1,6 @@ "use client"; -import { MessageCircle } from "lucide-react"; +import { Sparkles } from "lucide-react"; import { Button } from "@/components/ui/button"; import { cn } from "@/lib/utils"; @@ -24,8 +24,11 @@ import type { CoachScope, CoachScopeSource } from "@/lib/ai/coach/types"; * a status pill, range bar, consistency strip, headline number, edit * cog and a source link, the labelled pill dominated the visual * hierarchy. Dropping the label retains the affordance via the - * chat-bubble glyph + `aria-label` while shrinking the optical weight - * to a per-card icon button. + * Sparkles glyph + `aria-label` while shrinking the optical weight + * to a per-card icon button. UI-H2 — the glyph is the same Sparkles + * the hero strip, the inline pill and the layout-level FAB use, so + * the per-card Coach launch reads on one icon vocabulary across the + * app. */ export interface TargetCoachButtonProps { /** @@ -85,7 +88,7 @@ export function TargetCoachButton({ // Coach drawer cluster). Glyph stays `size-4`. className={cn("min-h-11 min-w-11", className)} > -