Let the planner fund a hand-drawn period, and remove one at a time

Three changes to calendar editing, too interleaved in the same files to
land separately.

Giving the same days to the second parent rewrote the first parent's
days instead of adding their own. The save looked the existing day up
against whoever was logged in rather than the parent being saved for, so
parent A's leave turned into parent B's vacation. The parent choice now
lives with the lookup, and two parents on the same dates produce two
rows and two bands.

Drawing a period by hand meant naming a day type up front. It now asks
who is off and lets the planner fund it, as a one-off period the sync
places, with double days offered when both parents are off and priced
honestly in the hint. Pinning an exact day type is still there, moved
behind Advanced, and editing a pinned day goes straight back to it.

Removing a period offered only the two extremes. There are now three
choices: this day, this year's period, or every year. Taking one year
out of a repeating period narrows it, or splits it in two when the year
is in the middle; where a scope cannot be expressed it is disabled with
a reason rather than doing something surprising.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ei7gCZzdd751uZtPzb1Pep
This commit is contained in:
2026-09-19 15:14:24 +02:00
parent 11f2a17b43
commit 35e479a005
17 changed files with 1514 additions and 750 deletions
+23
View File
@@ -54,6 +54,13 @@ export const calendar = {
'plannedDayModal.pinnedNotice': 'This day is pinned by you — the planner will not change it automatically.',
'plannedDayModal.dayStatusLabel': 'This day is:',
'plannedDayModal.rangeTitle': 'Plan {count} days',
'plannedDayModal.parentModeLabel': 'Who is this for?',
'plannedDayModal.wantsDubbeldagLabel': 'Allow double days (dubbeldagar)',
'plannedDayModal.wantsDubbeldagHint':
"Both parents are off the same day and each spend one of their own parental-benefit days (no vacation day is used) — only available in the child's first 15 months, capped at 60 dates per child, shared between you.",
'plannedDayModal.wantsDubbeldagRequiresBothHint': 'Requires both parents to be selected above.',
'plannedDayModal.showAdvanced': 'Advanced: pick type and parent manually',
'plannedDayModal.hideAdvanced': 'Hide advanced',
'plannedDayModal.saveButton': 'Save',
'plannedDayModal.saveError': 'Failed to save planned day',
'plannedDayModal.savingButton': 'Saving…',
@@ -115,4 +122,20 @@ export const calendar = {
'calendar.periodDeleteAdHocButton': 'Delete these days',
'calendar.periodCancelButton': 'Cancel',
'calendar.periodCloseAria': 'Close',
// todo.md #9 — three-way remove: this day / this period (this year) / this
// period every year.
'calendar.periodDeleteDayButton': 'This day',
'calendar.periodDeleteYearButton': 'This period',
'calendar.periodDeleteAllYearsButton': 'This period, every year',
'calendar.periodDeleteDayDisabledHint':
"Can't remove a single day from a recurring plan — the planner will add it back on the next sync. Delete the period instead.",
'calendar.periodDeleteAllYearsDisabledHint': 'This period is not linked to a recurring plan.',
'calendar.periodDeleteConfirmDay': 'Are you sure you want to remove this day?',
'calendar.periodDeleteConfirmYear': 'Are you sure you want to remove this period (this year only)?',
'calendar.periodDeleteConfirmAllYears': 'Are you sure you want to remove the period — every year?',
'calendar.wantsDubbeldagLabel': 'Allow double days (dubbeldagar)',
'calendar.wantsDubbeldagHint':
"Both parents are off the same day and each spend one of their own parental-benefit days (no vacation day is used) — only available in the child's first 15 months, capped at 60 dates per child, shared between you.",
'calendar.wantsDubbeldagRequiresBothHint': 'Requires the period to apply to both parents.',
} as const