summaryrefslogtreecommitdiffhomepage
path: root/.rules/changelog/2026-03/28/10.md
blob: a5f6de03e6776707f0b9b520e9f4259327f57f0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Phase 2: Calendar State

## Added
- `src/calendar/calendar-state.ts` — observable state container for the calendar view

## Details
- `CalendarState` class with private fields: `displayedMonth`, `today`, `activeFileDate`, `noteIndex`
- Read-only getters for all state fields
- `subscribe(cb)` / unsubscribe pattern using a `Set<() => void>`
- `setDisplayedMonth(m)` — clones and normalizes to start-of-month
- `setActiveFile(file, rootFolder)` — delegates to `getDateFromDailyNote()` from Phase 1
- `reindex(app, rootFolder)` — delegates to `indexDailyNotes()` from Phase 1
- `tick()` — heartbeat that notifies only on day rollover
- `rootFolder` passed as parameter (not stored) for consistency across methods
- No framework dependencies; strict TypeScript, no `any`