Give every year of a repeating period its own row
A repeating period was a single row that the planner expanded into one window per year at read time, so no year had anywhere to differ from the others. Editing one year rewrote them all, and removing a year in the middle had to split the wish in two. Neither survives contact with the thing this app is for: Easter moves, and the cheapest week is not the same week every year. Each year is now its own row, linked by a series id. Editing one year touches one row; editing the series re-projects the rest from it. Removing a year is one delete. The weekday snap is worked out once, when the rows are made, and stored, so a row now says what it means rather than being re-derived on every read. Recurrence stops being a stored field and becomes what it always was in practice — an instruction at create and update time; whether a period repeats is whether it belongs to a series. Migration 004 rebuilds the table and expands the existing rows, keeping each original row as its first year so the days already planned against it still point somewhere. A Feb 29 anchor recurring into a common year used to raise out of the allocator; it clamps now. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ei7gCZzdd751uZtPzb1Pep
This commit is contained in:
@@ -178,8 +178,8 @@ test('a drag saved without opening Advanced creates a planner-funded wish, and t
|
||||
|
||||
// Open the wish-linked band. Its own three-way remove: "this day" cannot
|
||||
// be expressed for a wish (it would just reappear on the next sync) and
|
||||
// is disabled; "this period" on a `recurrence: 'once'` wish (there is
|
||||
// only one occurrence) removes the whole thing, same as "every year".
|
||||
// is disabled; "this period" on a standalone (non-repeating) wish — one
|
||||
// row, no series — removes the whole thing, same as "every year".
|
||||
await wishBand.first().click()
|
||||
await expect(page.getByTestId('period-popover__content')).toBeVisible()
|
||||
await expect(page.getByTestId('period-delete-day-button')).toBeDisabled()
|
||||
|
||||
Reference in New Issue
Block a user