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:
co-authored by
Claude Opus 5.5
parent
8a6110396a
commit
21a0460ea6
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user