Make a stored id always name a row
Review found the new settings row opening nothing for a rule whose `until`
precedes its `startsAt`. That parses — nothing ties the two together — and
yields no occurrence at all, so nextOccurrences and the anchor fallback both
come back empty, nearestOccurrence returns null, and openRow cannot resolve
a bare rule id. It was the undeletable record this index exists to rescue,
now with a button that lies about it.
So resolution moves out of App into displayEventFor, with the rule itself as
the floor: a stored id always names something the reader can edit and
delete, whatever the rule does or does not generate. Exported because
nothing here can click and no test renders App, which is exactly how a dead
button shipped — the chain is now covered without a DOM.
Two of the caption tests could not fail, proven by mutation rather than
read: deleting the whole "starts" branch and removing the null-end guard
both left the suite green, because `not.toContain("ended")` was never
watching the branch at risk. They assert what the caption says now.
And a repeating series that has stopped said only how often it repeats — in
the one place whose job is explaining why an event is on no other surface. A
healthy cadence explains nothing; it says when it stopped.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5
parent
3a3b7d9c2f
commit
86ba2ccc1d
+4
-2
@@ -317,8 +317,10 @@ Four constraints, each protecting something that already exists:
|
||||
- **Their events never touch the ingest pipeline.** `sanitize.ts` and `merge.ts` exist for pages we
|
||||
do not control; a reader's own typing is neither untrusted markup nor a second opinion to
|
||||
reconcile. Nothing they enter is fetched, parsed, merged, scored or quarantined.
|
||||
- **They are always reachable.** Settings lists every event the reader has made, whatever state it
|
||||
is in, and opens the same detail sheet a row does. Every other surface drops an event once it has
|
||||
- **They are reachable whenever the app is.** Settings lists every event the reader has made,
|
||||
whatever state it is in, and opens the same detail sheet a row does. "Whenever the app is" is
|
||||
literal: settings renders on the ready path, so a feed that fails to load takes the whole panel
|
||||
with it — a pre-existing limit worth naming rather than implying otherwise. Every other surface drops an event once it has
|
||||
ended, so without this list a one-off of their own became unreachable the day it finished —
|
||||
impossible to edit, and impossible to delete out of a store nothing else can see. Events filed
|
||||
under a game we track are listed too; the form allows that, so the index has to.
|
||||
|
||||
Reference in New Issue
Block a user