Skip to content

Keep holidays/Hebrew-date overlays when changing year - #3

Merged
alontu merged 1 commit into
masterfrom
fix/overlays-persist-on-year-change
Jun 12, 2026
Merged

Keep holidays/Hebrew-date overlays when changing year#3
alontu merged 1 commit into
masterfrom
fix/overlays-persist-on-year-change

Conversation

@alontu

@alontu alontu commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Bug

Enable the holidays + Hebrew-date overlays, then click a year arrow → the overlays vanish. They only persist if you toggle them a second time before navigating.

Cause

changeYear/changeRange preserved the calendars URL param as-is. When the year change fired before the toggle's router.push had committed the new URL, the read-back calendars was stale (missing the overlays), so they were dropped. On the second toggle the URL had caught up, so it worked.

Fix

Rebuild calendars from component state (visibleCalendarIds + the two toggle flags) in changeYear and changeRange, exactly like the toggle handlers — the URL is no longer the source of truth. + regression test.

Verification

  • npm test → 70 passing (incl. new "rebuild overlays from state over a stale URL" regression)
  • npm run build → green

🤖 Generated with Claude Code

changeYear/changeRange preserved the `calendars` URL param verbatim, so a year
change that fired before the toggle's URL update had committed would drop the
overlays (they only stuck on the second toggle, once the URL caught up).

Rebuild `calendars` from component state (visibleCalendarIds + the two toggle
flags) in both, matching the toggle handlers — the URL is no longer trusted as
the source of truth. Adds a regression test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@alontu
alontu merged commit da58efa into master Jun 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant