Calendar view mode (month/week/day) and current date don't persist after reload #25

Open
opened 2026-04-21 11:42:00 +00:00 by AhmedHanafy725 · 1 comment
Member

Changing the calendar view mode via the properties panel (or navigating with Prev/Today/Next buttons, or clicking the in-header nav arrows) does not persist — after a page reload the calendar reverts to its original month view on today's date.

Only double-clicking the calendar to cycle view modes currently saves the change; all the other entry points mutate group._calState and redraw but never call WhiteboardSync.onUpdate(group), so the server never learns about the change.

Affected code paths:

  • properties.jsprop-cal-viewmode change handler, prop-cal-prev / prop-cal-next / prop-cal-today click handlers.
  • calendar.jsnavigateNext, navigatePrev, cycleViewMode, and navigateCalendar (the helper used by the in-header arrow clicks).

Fix: call WhiteboardSync.onUpdate(node) at the end of every calendar state mutation path.

Changing the calendar view mode via the properties panel (or navigating with Prev/Today/Next buttons, or clicking the in-header nav arrows) does not persist — after a page reload the calendar reverts to its original `month` view on today's date. Only double-clicking the calendar to cycle view modes currently saves the change; all the other entry points mutate `group._calState` and redraw but never call `WhiteboardSync.onUpdate(group)`, so the server never learns about the change. Affected code paths: - `properties.js` — `prop-cal-viewmode` change handler, `prop-cal-prev` / `prop-cal-next` / `prop-cal-today` click handlers. - `calendar.js` — `navigateNext`, `navigatePrev`, `cycleViewMode`, and `navigateCalendar` (the helper used by the in-header arrow clicks). Fix: call `WhiteboardSync.onUpdate(node)` at the end of every calendar state mutation path.
Author
Member

Pull request opened: #26

Pull request opened: https://forge.ourworld.tf/lhumina_code/hero_whiteboard/pulls/26
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_whiteboard#25
No description provided.