From 053d678ac78ee6be5d15fc7df46d616d4a97f8c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Fri, 15 May 2026 16:44:39 +0200 Subject: [PATCH] refactor(dashboard): promote GLP-1 schedule dates to a header pill row and drop the green seam The faint dracula-green left-seam on the outer wrapper was decoration without a semantic tie to the schedule rows beside it. The Syringe-icon in the title row already carries the 'active therapy' signal at a glance. Replace the
grid with a soft-green pill bar that groups Last- and Next-Injection as one cohesive 'therapy schedule' unit. Each pill keeps its data-slot anchor (glp1-tile-last / glp1-tile-next) so existing tests stay in lockstep; new test asserts the data-slot='glp1-tile-schedule' wrapper renders and the border-l-dracula-green/60 + border-l-2 classes no longer appear on the outer wrapper. --- .../dashboard/__tests__/glp1-tile.test.tsx | 40 ++++++++++ src/components/dashboard/glp1-tile.tsx | 79 +++++++++++-------- 2 files changed, 85 insertions(+), 34 deletions(-) diff --git a/src/components/dashboard/__tests__/glp1-tile.test.tsx b/src/components/dashboard/__tests__/glp1-tile.test.tsx index ff9fc6548..40cbae02c 100644 --- a/src/components/dashboard/__tests__/glp1-tile.test.tsx +++ b/src/components/dashboard/__tests__/glp1-tile.test.tsx @@ -321,6 +321,46 @@ describe("", () => { ); }); + it("v1.4.27 B1 — promotes the schedule to a pill row and drops the green seam", () => { + queryReturn = { + data: { + active: true, + medications: [ + { + name: "Mounjaro", + genericName: "tirzepatide", + medicationId: "med-1", + currentDose: { + value: 7.5, + unit: "mg", + since: "2026-04-01", + weeksOnDose: 6, + }, + doseHistory: [], + lastInjection: { date: "2026-05-10", site: null, weeksAgo: 0 }, + nextInjection: { date: "2026-05-17", daysAway: 3 }, + startWeight: 92.0, + currentWeight: 87.8, + weightDeltaKg: -4.2, + weightSeries: [{ date: "2026-05-13", weight: 87.8 }], + injectionDates: ["2026-05-10"], + }, + ], + }, + isPending: false, + }; + const html = render(); + // Schedule wrapper is the new pill row, not the old
. + expect(html).toContain('data-slot="glp1-tile-schedule"'); + expect(html).not.toContain(" { // Some legacy meds don't have a Medication.id surfaced through the // dashboard route (the route returns medicationId: null). The diff --git a/src/components/dashboard/glp1-tile.tsx b/src/components/dashboard/glp1-tile.tsx index 7b11ac9f1..1470f7e39 100644 --- a/src/components/dashboard/glp1-tile.tsx +++ b/src/components/dashboard/glp1-tile.tsx @@ -246,11 +246,12 @@ export function Glp1Tile() { data-medication-id={med.medicationId ?? ""} className={cn( "bg-card/65 relative overflow-hidden rounded-xl border px-4 py-4 shadow-sm backdrop-blur-sm", - // A faint green seam on the left edge so the tile reads as - // "active therapy" at a glance without needing to read the - // header. The same green is used for the injection-day markers - // below — visual consistency across the tile. - "border-l-dracula-green/60 border-l-2", + // v1.4.27 B1 — the green left-seam drops. The Syringe-icon in + // the title row already carries the "active therapy" signal; + // the seam was decoration without a semantic tie to the + // schedule dates next to it. The schedule pill row below now + // groups the two dates visually so the user reads them as one + // cohesive unit. )} >
@@ -280,43 +281,53 @@ export function Glp1Tile() { )}
-
- {med.lastInjection && ( -
-
- )} - {med.nextInjection && ( -
-
- )} -
+ + )} + + )} {/* v1.4.27 B1 — chart pane carrying a two-tab segmented control (Drug-Level default / Weight) plus a 7d / 30d / 90d / All