Show "Goal exceeded" instead of negative remaining minutes
All checks were successful
Deploy / deploy (push) Successful in 1m38s
All checks were successful
Deploy / deploy (push) Successful in 1m38s
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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(<DataPanel {...baseProps} remainingMinutes={-50} />);
|
||||
|
||||
expect(screen.getByText(/Remaining: -50 min/)).toBeInTheDocument();
|
||||
expect(screen.getByText(/Goal exceeded by 50 min/)).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -76,7 +76,11 @@ export function DataPanel({
|
||||
/>
|
||||
</div>
|
||||
</li>
|
||||
<li>Remaining: {remainingMinutes} min</li>
|
||||
<li>
|
||||
{remainingMinutes >= 0
|
||||
? `Remaining: ${remainingMinutes} min`
|
||||
: `Goal exceeded by ${Math.abs(remainingMinutes)} min`}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user