Correct the PRD's claim of an until control, and stop the form erasing one

The PRD said a reader's rule could optionally stop on a date; the until
control was deliberately descoped from the form during planning, and the
PRD was written as though it shipped. Corrected the PRD to describe what
actually ships, and noted that the field still exists in the schema —
reachable today only by importing a file that carries one.

That gap had a second-order bug behind it: because the edit form rebuilt
`repeat` from scratch on every save, hard-coding `until: null`, a rule that
already carried a non-null `until` had it silently reset to eternal on any
edit at all, including a pure title fix. Extracted the `repeat`-building
logic into `repeatFrom`, which now carries `initial?.repeat?.until` forward,
and is exported so the behaviour is provable without a submit nothing in
this suite's renderToStaticMarkup tests can click.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
Lucas Winther
2026-08-28 05:04:39 +02:00
co-authored by Claude Opus 5
parent d433eeee50
commit e3c4fae1b9
3 changed files with 71 additions and 7 deletions
+11 -3
View File
@@ -324,9 +324,17 @@ Four constraints, each protecting something that already exists:
no server to restore from.
A reader's event may also state how it comes round again — every N days, weeks
or months, optionally stopping on a date. The rule is stored; its occurrences
are derived, and each one is an ordinary event everywhere in the app: its own
countdown, its own completion, its own daily checklist.
or months. The rule is stored; its occurrences are derived, and each one is an
ordinary event everywhere in the app: its own countdown, its own completion,
its own daily checklist.
**The schedule can stop on a date (`until`), but the form has no control for
setting one.** The field exists in the schema — descoped from the form during
planning rather than removed from the data — so a rule already carrying one,
reachable today only by importing a file that has it, keeps it: editing such a
rule preserves its `until` rather than resetting it to "never" on save. There
is simply no way for a reader to give a rule an end date through the form
itself.
**An occurrence need not state its end.** With none, it runs until the next one
opens. That is not the app inventing a date to fill a form — it is entailed by