Give a reader their own events back
An event of theirs that had ended was on no surface at all. Every list and the board drop a row once its end has passed, and settings only counted the events a game held rather than naming them — so a one-off became unreachable the day it finished: impossible to edit, and impossible to delete out of a store nothing else can see. Repeating events escaped only because their occurrences roll forward. So settings names them now, under the game they were filed against, each row opening the same detail sheet a row on the front page does. Nothing about how they are managed changes; what was missing was the way back to them. Two things the index has to get right or it leaves the same hole it closes. The lists hold occurrences, never rules, so a repeating rule's own id opens nothing — nearestOccurrence bridges that, and answers for a finished series too by falling back to the first occurrence, since a rule whose `until` has passed would otherwise be exactly as stuck. And an event filed under a game we track has no row of theirs to nest under; the form allows that, so those get their own heading rather than trailing the list and reading as though they belonged to whichever game came last. Each row says why it is not on the front page — ended and when, or its cadence — because a list of bare titles leaves you guessing which of two entries is the dead one. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5
parent
8671a309b0
commit
3a3b7d9c2f
+11
-1
@@ -30,7 +30,7 @@ import {
|
||||
} from "./state/lens.ts";
|
||||
import { clockFor, formatRemaining } from "../shared/time.ts";
|
||||
import { dailySummary, isDaily, resolveDaily } from "../shared/daily.ts";
|
||||
import { occurrenceForId, strandedOccurrences } from "../shared/recurrence.ts";
|
||||
import { nearestOccurrence, occurrenceForId, strandedOccurrences } from "../shared/recurrence.ts";
|
||||
import { orderGames } from "./state/gameOrder.ts";
|
||||
import { GameMetaProvider, type MetaResolver } from "./state/gameMeta.tsx";
|
||||
import { metaOnTheme, useTheme } from "./state/theme.ts";
|
||||
@@ -650,6 +650,16 @@ export function App() {
|
||||
onEditGame: custom.editGame,
|
||||
onRemoveGame: custom.removeGame,
|
||||
onAddEvent: custom.addEvent,
|
||||
now,
|
||||
// The index lists rules; the sheet opens rows. A repeating rule's
|
||||
// own id is never a row — the lists hold its occurrences — so it is
|
||||
// resolved to whichever occurrence is nearest before opening.
|
||||
onOpen: (id) => {
|
||||
const record = custom.events[id];
|
||||
const occurrence =
|
||||
record === undefined ? null : nearestOccurrence(record, now);
|
||||
setOpenId(occurrence === null ? id : occurrence.id);
|
||||
},
|
||||
}}
|
||||
onExport={() =>
|
||||
exportProgress(prog.progress, daily.logs, ignored.marks, prefs, {
|
||||
|
||||
Reference in New Issue
Block a user