fix(ui): keep one lit meter tick while an event is still running

Forty minutes left of a two-week event is under half a tick, so the
meter rounded it down to an empty strip. The most urgent rows and the
headline looked like events that were already over.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Lucas Winther
2026-10-01 04:18:13 +02:00
co-authored by Claude Opus 5.5
parent 8a6110396a
commit 21a0460ea6
2 changed files with 8 additions and 3 deletions
+5 -2
View File
@@ -33,9 +33,12 @@ interface MeterProps {
*/
export function Meter({ progress, urgency, animate = true, label }: MeterProps) {
const unknown = progress === null;
const remainingTicks = unknown
// Never rounds a running event down to an empty strip. Forty minutes left of
// a two-week event is under half a tick, and drawing it as fully spent made
// the most urgent rows on the page look like the ones already over.
const remainingTicks = unknown || progress >= 1
? 0
: Math.max(0, Math.round((1 - progress) * TICKS));
: Math.max(1, Math.round((1 - progress) * TICKS));
return (
<div