diff options
| author | Adam Malczewski <[email protected]> | 2026-03-29 13:44:05 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-03-29 13:44:05 +0900 |
| commit | e8d107e454b3804e089a33ce5fe7c931040d4647 (patch) | |
| tree | 4f8787fae670e86515baed54e00087ce3ef28da6 /.rules/plan/calendar-phase-2.md | |
| parent | 67d7d50ee2b05f66de3ab6aea38ff5d7d56ce839 (diff) | |
| download | ai-pulse-obsidian-plugin-e8d107e454b3804e089a33ce5fe7c931040d4647.tar.gz ai-pulse-obsidian-plugin-e8d107e454b3804e089a33ce5fe7c931040d4647.zip | |
remove calendar and chat history
Diffstat (limited to '.rules/plan/calendar-phase-2.md')
| -rw-r--r-- | .rules/plan/calendar-phase-2.md | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/.rules/plan/calendar-phase-2.md b/.rules/plan/calendar-phase-2.md deleted file mode 100644 index e1e22ff..0000000 --- a/.rules/plan/calendar-phase-2.md +++ /dev/null @@ -1,41 +0,0 @@ -# Phase 2: Calendar State (`src/calendar/calendar-state.ts`) - -**Status:** Not started -**Depends on:** Phase 1 (daily-notes.ts — for `indexDailyNotes`, `getDateFromDailyNote`) -**Output file:** `src/calendar/calendar-state.ts` - ---- - -## Overview - -Simple state container with change notifications — replaces Svelte stores. Holds the displayed month, today's date, active file tracking, and the note index. Notifies subscribers on any state change. - ---- - -## Design - -``` -class CalendarState: - - displayedMonth: Moment (current month being viewed) - - today: Moment (refreshed by heartbeat) - - activeFileDate: string | null (date UID of active file, if daily note) - - noteIndex: Map<string, TFile> (date string → file) - - listeners: Set<() => void> - - Methods: - - subscribe(cb): () => void (unsubscribe function) - - setDisplayedMonth(m: Moment): void - - setActiveFile(file: TFile | null): void - - reindex(app: App, rootFolder: string): void - - tick(): void (refresh today) - - notify(): void (call all listeners) -``` - ---- - -## Notes - -- `reindex()` delegates to `indexDailyNotes()` from Phase 1. -- `setActiveFile()` uses `getDateFromDailyNote()` from Phase 1 to determine if the file is a daily note. -- `tick()` updates `today` and calls `notify()` only if the date has changed (day rollover). -- Subscribers are plain callbacks — no framework dependency. |
