Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / calendar / AGENTS.md
| 1 | # AGENTS.md — calendar/ (':calendar') |
| 2 | |
| 3 | > Scoped supplement. Global rules in root `AGENTS.md` apply. Stay inside `calendar/` + allowed shared modules. Do not root-scan. |
| 4 | |
| 5 | _Install: ./install calendar (dev by default)._ |
| 6 | <!-- last-reviewed: 2026-10-16 --> |
| 7 | - Gradle: :calendar / dir: calendar/ |
| 8 | - Package roots present: ui, data, intents |
| 9 | - Entry files: MainActivity.kt (no Route.kt — single-screen app with dialogs, not nav destinations) |
| 10 | - Deps: :library:widgets |
| 11 | - Metadata: metadata_data/calendar.md (present) |
| 12 | - Rust: no / screenshotTest: yes |
| 13 | |
| 14 | ## Overview |
| 15 | **Purpose:** Fully offline Material You calendar — works with on-device calendars, no account; acts as the system calendar so dates/events from other apps open here. |
| 16 | **Key features:** |
| 17 | - Month/pager/agenda views, event CRUD with recurrence (`RRule`), timezones, per-calendar colors |
| 18 | - `.ics` import (files shared from anywhere) + export; holiday calendars via generated data (`scripts/calendar`) |
| 19 | - Exact-alarm reminders rescheduled after reboot (`ReminderScheduler` + `BootReceiver`) |
| 20 | - Self-refreshing Glance widgets (agenda + month); assistant read/add via `intents/` |
| 21 | **Architecture / data-flow:** `ui/` screens + `ui/dialogs/` editors → `util/CalendarViewModel` (+ `CalendarUiContract`) → `data/` models (`Calendar`/`Event`/`Instance`/`ReminderMirror`); reminders flow ViewModel → `ReminderScheduler` → `ReminderReceiver` → notification, re-armed on boot. |
| 22 | **Entry points + reading order:** `MainActivity.kt` → `ui/CalendarScreen.kt` → `util/CalendarViewModel.kt` → `data/Event.kt` + `data/Instance.kt` → `util/RRule.kt` → `util/ReminderScheduler.kt`. |
| 23 | **Gotchas:** |
| 24 | - `util/` is NOT a closed package root — the `util/`→closed-roots migration is pending; don't add more files there |
| 25 | - Holiday data is generated by `scripts/calendar`, not hand-written — regenerate, don't edit |
| 26 | - Reminder alarms must be re-registered on boot; test the `BootReceiver` path, not just in-app scheduling |
| 27 | |
| 28 | ## Key files |
| 29 | ### Root — entry (no Route.kt) |
| 30 | - com/vayunmathur/calendar/MainActivity.kt |
| 31 | ### data/ — calendar/event/instance models |
| 32 | - com/vayunmathur/calendar/data/Calendar.kt |
| 33 | - com/vayunmathur/calendar/data/Event.kt |
| 34 | - com/vayunmathur/calendar/data/Instance.kt |
| 35 | - com/vayunmathur/calendar/data/ReminderMirror.kt |
| 36 | ### util/ — ViewModel, recurrence, reminders, ICS (pending migration to closed roots) |
| 37 | - com/vayunmathur/calendar/util/CalendarViewModel.kt |
| 38 | - com/vayunmathur/calendar/util/CalendarUiContract.kt |
| 39 | - com/vayunmathur/calendar/util/RRule.kt — recurrence expansion |
| 40 | - com/vayunmathur/calendar/util/RecurrenceParams.kt |
| 41 | - com/vayunmathur/calendar/util/ReminderScheduler.kt |
| 42 | - com/vayunmathur/calendar/util/ReminderReceiver.kt |
| 43 | - com/vayunmathur/calendar/util/BootReceiver.kt |
| 44 | - com/vayunmathur/calendar/util/HolidayCalendarManager.kt |
| 45 | - com/vayunmathur/calendar/util/HolidayData.kt |
| 46 | - com/vayunmathur/calendar/util/IcsExport.kt |
| 47 | - com/vayunmathur/calendar/util/DateFormats.kt |
| 48 | ### ui/ + ui/dialogs/ — views and editors |
| 49 | - com/vayunmathur/calendar/ui/CalendarScreen.kt |
| 50 | - com/vayunmathur/calendar/ui/CalendarMonthView.kt |
| 51 | - com/vayunmathur/calendar/ui/CalendarPagerView.kt |
| 52 | - com/vayunmathur/calendar/ui/AgendaView.kt |
| 53 | - com/vayunmathur/calendar/ui/WeekHeaderRow.kt |
| 54 | - com/vayunmathur/calendar/ui/HourScale.kt |
| 55 | - com/vayunmathur/calendar/ui/EventPositioner.kt |
| 56 | - com/vayunmathur/calendar/ui/CalendarSelector.kt |
| 57 | - com/vayunmathur/calendar/ui/CalendarViewHelpers.kt |
| 58 | - com/vayunmathur/calendar/ui/EditEventScreen.kt |
| 59 | - com/vayunmathur/calendar/ui/EditEventRow.kt |
| 60 | - com/vayunmathur/calendar/ui/EditEventDateTime.kt |
| 61 | - com/vayunmathur/calendar/ui/EditEventReminders.kt |
| 62 | - com/vayunmathur/calendar/ui/EventScreen.kt |
| 63 | - com/vayunmathur/calendar/ui/HolidayCalendarsScreen.kt |
| 64 | - com/vayunmathur/calendar/ui/IcsImport.kt |
| 65 | - com/vayunmathur/calendar/ui/ImportIcsScreen.kt |
| 66 | - com/vayunmathur/calendar/ui/SettingsScreen.kt |
| 67 | - com/vayunmathur/calendar/ui/SummaryEventItem.kt |
| 68 | - com/vayunmathur/calendar/ui/SummaryGrid.kt |
| 69 | - com/vayunmathur/calendar/ui/dialogs/RecurrenceDialog.kt |
| 70 | - com/vayunmathur/calendar/ui/dialogs/RecurrenceDates.kt |
| 71 | - com/vayunmathur/calendar/ui/dialogs/RecurrenceDialogComponents.kt |
| 72 | - com/vayunmathur/calendar/ui/dialogs/CalendarPickerDialog.kt |
| 73 | - com/vayunmathur/calendar/ui/dialogs/CalendarSetDateDialog.kt |
| 74 | - com/vayunmathur/calendar/ui/dialogs/SettingsAddCalendarDialog.kt |
| 75 | - com/vayunmathur/calendar/ui/dialogs/SettingsChangeColorDialog.kt |
| 76 | - com/vayunmathur/calendar/ui/dialogs/SettingsDefaultRemindersDialog.kt |
| 77 | - com/vayunmathur/calendar/ui/dialogs/SettingsDeleteCalendarDialog.kt |
| 78 | - com/vayunmathur/calendar/ui/dialogs/SettingsRenameCalendarDialog.kt |
| 79 | - com/vayunmathur/calendar/ui/dialogs/TimezonePickerDialog.kt |
| 80 | ### glance/ + intents/ — widgets and assistant IPC |
| 81 | - com/vayunmathur/calendar/glance/CalendarGlanceWidget.kt |
| 82 | - com/vayunmathur/calendar/glance/CalendarGlanceWidgetReceiver.kt |
| 83 | - com/vayunmathur/calendar/glance/CalendarMonthGlanceWidget.kt |
| 84 | - com/vayunmathur/calendar/glance/CalendarMonthGlanceWidgetReceiver.kt |
| 85 | - com/vayunmathur/calendar/intents/GetIntent.kt |
| 86 | - com/vayunmathur/calendar/intents/InsertIntent.kt |
| 87 | |
| 88 | ## Verify (this module only) |
| 89 | ``` |
| 90 | ./gradlew :calendar:compileDevKotlin |
| 91 | ./gradlew :calendar:lint |
| 92 | ./gradlew :calendar:checkMetadata |
| 93 | ``` |