fix: dim only finished events in the timeline
The bar tested for an entry in the progress store, but an entry appears there the moment a reader records an effort or a note. Recording "this looks like a grind" greyed the event out as though it were already done. Ask whether it is done instead. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5
parent
b1df7b2581
commit
ad3647bee2
+1
-6
@@ -260,12 +260,7 @@ export function App() {
|
||||
)}
|
||||
</>
|
||||
) : (
|
||||
<Timeline
|
||||
rows={visible}
|
||||
now={now}
|
||||
onOpen={setOpenId}
|
||||
completions={prog.progress}
|
||||
/>
|
||||
<Timeline rows={visible} now={now} onOpen={setOpenId} isDone={isDone} />
|
||||
)}
|
||||
|
||||
<Controls
|
||||
|
||||
@@ -30,12 +30,17 @@ export function Timeline({
|
||||
rows,
|
||||
now,
|
||||
onOpen,
|
||||
completions,
|
||||
isDone,
|
||||
}: {
|
||||
rows: RowEvent[];
|
||||
now: number;
|
||||
onOpen: (id: string) => void;
|
||||
completions: Record<string, unknown>;
|
||||
/**
|
||||
* Asked rather than derived from the progress store: an entry exists there
|
||||
* the moment a reader records an effort or a note, and dimming a bar for
|
||||
* that would say "finished" about something they have not started.
|
||||
*/
|
||||
isDone: (id: string) => boolean;
|
||||
}) {
|
||||
const scroller = useRef<HTMLDivElement>(null);
|
||||
|
||||
@@ -119,7 +124,7 @@ export function Timeline({
|
||||
const clippedStart = clock.startsMs < min;
|
||||
const left = Math.max(x(clock.startsMs), 0);
|
||||
const right = x(clock.endsMs ?? clock.startsMs + 14 * DAY);
|
||||
const done = completions[event.id] !== undefined;
|
||||
const done = isDone(event.id);
|
||||
return (
|
||||
<button
|
||||
key={event.id}
|
||||
|
||||
Reference in New Issue
Block a user