From 6543c79a04373d7ea6df39a9aae6994db80858a2 Mon Sep 17 00:00:00 2001 From: Petru Paler Date: Sat, 17 Jan 2026 07:27:32 +0000 Subject: [PATCH] Show "Goal exceeded" instead of negative remaining minutes When weekly intensity exceeds the phase goal, display "Goal exceeded by X min" instead of the confusing "Remaining: -X min". Co-Authored-By: Claude Opus 4.5 --- src/components/dashboard/data-panel.test.tsx | 4 ++-- src/components/dashboard/data-panel.tsx | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/dashboard/data-panel.test.tsx b/src/components/dashboard/data-panel.test.tsx index 3c77e63..58f1703 100644 --- a/src/components/dashboard/data-panel.test.tsx +++ b/src/components/dashboard/data-panel.test.tsx @@ -142,10 +142,10 @@ describe("DataPanel", () => { expect(screen.getByText(/Remaining: 0 min/)).toBeInTheDocument(); }); - it("displays negative remaining minutes", () => { + it("displays goal exceeded message for negative remaining minutes", () => { render(); - expect(screen.getByText(/Remaining: -50 min/)).toBeInTheDocument(); + expect(screen.getByText(/Goal exceeded by 50 min/)).toBeInTheDocument(); }); }); diff --git a/src/components/dashboard/data-panel.tsx b/src/components/dashboard/data-panel.tsx index 04812b9..2379d9a 100644 --- a/src/components/dashboard/data-panel.tsx +++ b/src/components/dashboard/data-panel.tsx @@ -76,7 +76,11 @@ export function DataPanel({ /> -
  • Remaining: {remainingMinutes} min
  • +
  • + {remainingMinutes >= 0 + ? `Remaining: ${remainingMinutes} min` + : `Goal exceeded by ${Math.abs(remainingMinutes)} min`} +
  • );