refactor: split CalendarView controller from rendering #397

Merged
barrettruth merged 1 commit from issue-367-calendar-view-controller-split into main 2026-05-12 13:45:28 +00:00
Owner

Problem

CalendarView owned navigation state, FullCalendar synchronization, optimistic recurrence state, drag/drop handlers, keybindings, popover state, and rendering in one component.

Solution

  • Extract CalendarView controller wiring into focused calendar hooks for navigation, event derivation, keyboard handling, and FullCalendar callbacks.
  • Add pure calendar view-model helpers for visible ranges, header titles, draft events, and optimistic recurrence exdate merging.
  • Keep the FcCalendar rendering contract and FullCalendar adapter behavior unchanged.

Verification

  • nix develop --command pnpm vitest run tests/lib/calendar-view-model.test.ts tests/lib/fullcalendar-adapter.test.ts tests/lib/fullcalendar-range.test.ts --reporter=verbose
  • nix develop --command pnpm typecheck
  • nix develop --command biome check src/components/calendar-view.tsx src/components/calendar/calendar-view-model.ts src/components/calendar/use-calendar-events.ts src/components/calendar/use-calendar-keyboard.ts src/components/calendar/use-calendar-navigation.ts src/components/calendar/use-calendar-view-controller.ts tests/lib/calendar-view-model.test.ts
  • nix develop --command just ci

Closes #367

## Problem CalendarView owned navigation state, FullCalendar synchronization, optimistic recurrence state, drag/drop handlers, keybindings, popover state, and rendering in one component. ## Solution - Extract CalendarView controller wiring into focused calendar hooks for navigation, event derivation, keyboard handling, and FullCalendar callbacks. - Add pure calendar view-model helpers for visible ranges, header titles, draft events, and optimistic recurrence exdate merging. - Keep the FcCalendar rendering contract and FullCalendar adapter behavior unchanged. ## Verification - nix develop --command pnpm vitest run tests/lib/calendar-view-model.test.ts tests/lib/fullcalendar-adapter.test.ts tests/lib/fullcalendar-range.test.ts --reporter=verbose - nix develop --command pnpm typecheck - nix develop --command biome check src/components/calendar-view.tsx src/components/calendar/calendar-view-model.ts src/components/calendar/use-calendar-events.ts src/components/calendar/use-calendar-keyboard.ts src/components/calendar/use-calendar-navigation.ts src/components/calendar/use-calendar-view-controller.ts tests/lib/calendar-view-model.test.ts - nix develop --command just ci Closes #367
refactor: split calendar view controller
All checks were successful
quality / Test (pull_request) Successful in 17s
quality / Lint (pull_request) Successful in 21s
quality / Build (pull_request) Successful in 43s
95cf0c0897
barrettruth deleted branch issue-367-calendar-view-controller-split 2026-05-12 13:45:28 +00:00
Sign in to join this conversation.
No reviewers
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
barrettruth/delta!397
No description provided.