Add repeated calendar items#136
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds support for repeated (recurring) calendar items end-to-end: UI for creating/editing recurrence rules, persistence/schema changes, recurrence expansion when querying items, and improved iCal RRULE import/export.
Changes:
- Add repeat configuration UI to the calendar item dialog and persist repeating items as
RepeatingCalendarItem. - Expand repeating calendar items into occurrences when fetching calendar items for a date/range, and bump DB schema version with a v5 migration.
- Improve iCal RRULE parsing/serialization to include BYDAY/BYMONTHDAY variations, and adjust UI list keys to differentiate occurrences.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| app/lib/pages/calendar/pending.dart | Updates list tile keys to include start/end for repeated occurrences. |
| app/lib/pages/calendar/month.dart | Updates day dialog list tile keys to include occurrence start/end. |
| app/lib/pages/calendar/item.dart | Adds repeat rule editing UI and converts dialog state into persisted repeating items on save. |
| app/lib/pages/calendar/day.dart | Adjusts internal resize keying to account for repeated occurrences (start/end). |
| app/lib/api/storage/remote/caldav.dart | Formatting-only changes and minor cleanup around calendar object updates. |
| api/lib/services/migration.dart | Adds DB migration to v5 for updated calendarItems runtimeType handling. |
| api/lib/services/database.dart | Bumps database version to 5. |
| api/lib/models/user/model.mapper.dart | Generated mapper update (new ignore). |
| api/lib/models/resource/model.mapper.dart | Generated mapper update (new ignore). |
| api/lib/models/note/model.mapper.dart | Generated mapper update (new ignore). |
| api/lib/models/note/database.dart | Formatting-only changes in linker methods. |
| api/lib/models/model.mapper.dart | Generated mapper update (new ignore). |
| api/lib/models/label/model.mapper.dart | Generated mapper update (new ignore). |
| api/lib/models/group/model.mapper.dart | Generated mapper update (new ignore). |
| api/lib/models/extra.mapper.dart | Generated mapper update (new ignore). |
| api/lib/models/event/model.mapper.dart | Generated mapper update (new ignore). |
| api/lib/models/event/item/model.mapper.dart | Updates generated calendar item mapping; removes AutoCalendarItem mapper. |
| api/lib/models/event/item/model.dart | Adds exceptions decoding, bitmask helpers for BYDAY/BYMONTHDAY, and DB (de)serialization tweaks. |
| api/lib/models/event/item/database.dart | Implements recurrence expansion for repeating items in getCalendarItems and updates schema (drops auto* columns). |
| api/lib/models/cached.mapper.dart | Adjusts generated copyWith typing/behavior for calendar items. |
| api/lib/converters/ical.dart | Adds BYDAY/BYMONTHDAY parsing and RRULE formatting with variation support. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot apply changes based on the comments in this thread |
…model/migration Agent-Logs-Url: https://github.com/LinwoodDev/Flow/sessions/d7a3f06a-e184-4acf-aff0-c5949b226fd8 Co-authored-by: CodeDoctorDE <20452814+CodeDoctorDE@users.noreply.github.com>
Applied all changes from the review thread in commit b1ced8d:
|
…e calendar item management
…on keys Co-authored-by: Copilot <copilot@github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 26 out of 26 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| final fixedItems = await _queryItems( | ||
| where: fixedWhere, | ||
| whereArgs: fixedWhereArgs, | ||
| ); | ||
| final repeatingDefinitions = await _queryItems( | ||
| where: repeatingWhere, | ||
| whereArgs: repeatingWhereArgs, |
There was a problem hiding this comment.
When a temporal filter is provided, getCalendarItems fetches all matching fixed items and all repeating definitions via _queryItems without passing offset/limit, then expands/sorts/paginates in memory. This can become expensive for large datasets (lots of fixed rows in the window or many repeating definitions) and can negate DB-side pagination. Consider applying a DB-side cap (e.g., fetch (offset+limit) plus a small buffer), or restructure the merge/expansion to avoid materializing the full result set before pagination.
| final fixedItems = await _queryItems( | |
| where: fixedWhere, | |
| whereArgs: fixedWhereArgs, | |
| ); | |
| final repeatingDefinitions = await _queryItems( | |
| where: repeatingWhere, | |
| whereArgs: repeatingWhereArgs, | |
| // Avoid fetching the entire candidate set when pagination is requested. | |
| // We still expand and merge in memory, but we bound the number of rows | |
| // read from the database to the requested page plus a small buffer. | |
| final candidateLimit = (offset < 0 ? 0 : offset) + | |
| (limit < 0 ? 0 : limit) + | |
| 50; | |
| final fixedItems = await _queryItems( | |
| where: fixedWhere, | |
| whereArgs: fixedWhereArgs, | |
| limit: candidateLimit, | |
| ); | |
| final repeatingDefinitions = await _queryItems( | |
| where: repeatingWhere, | |
| whereArgs: repeatingWhereArgs, | |
| limit: candidateLimit, |
No description provided.