Skip to content

Add repeated calendar items#136

Merged
CodeDoctorDE merged 6 commits intodevelopfrom
feature/repeated-events
Apr 26, 2026
Merged

Add repeated calendar items#136
CodeDoctorDE merged 6 commits intodevelopfrom
feature/repeated-events

Conversation

@CodeDoctorDE
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread app/lib/pages/calendar/pending.dart Outdated
Comment thread app/lib/pages/calendar/month.dart Outdated
Comment thread app/lib/pages/calendar/item.dart Outdated
Comment thread app/lib/pages/calendar/item.dart
Comment thread api/lib/models/event/item/model.dart Outdated
Comment thread api/lib/services/migration.dart
@CodeDoctorDE
Copy link
Copy Markdown
Member Author

@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>
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 26, 2026

@copilot apply changes based on the comments in this thread

Applied all changes from the review thread in commit b1ced8d:

  • pending.dart / month.dart: Changed ValueKey from List to String using interpolation (@ / | separators) for stable widget identity across rebuilds.
  • model.dart: Added AutoCalendarItem and auto to the fromDatabase type check so legacy rows are decoded correctly as RepeatingCalendarItem.
  • migration.dart: Fixed the <4 migration to use explicit column names in the INSERT INTO calendarItems_temp (...) statement, excluding the removed autoGroupId, searchStart, and autoDuration columns to prevent a column-count mismatch when upgrading directly from DB versions older than 4.
  • item.dart + app_en.arb: Added 15 new localization keys (repeat, repeatFrequency, repeatInterval, repeatIntervalHelper, repeatDaily/Weekly/Monthly/Yearly, repeatWeekdays, repeatMonthDays, repeatOccurrences, repeatOccurrencesHelper, repeatUntil, and the 7 weekday short names) and wired up all hard-coded repeat UI strings to use AppLocalizations.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread app/lib/pages/calendar/item.dart Outdated
Comment thread api/lib/models/event/item/database.dart Outdated
Comment thread api/lib/models/event/item/database.dart Outdated
Comment on lines +176 to +183

final fixedItems = await _queryItems(
where: fixedWhere,
whereArgs: fixedWhereArgs,
);
final repeatingDefinitions = await _queryItems(
where: repeatingWhere,
whereArgs: repeatingWhereArgs,
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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,

Copilot uses AI. Check for mistakes.
@CodeDoctorDE CodeDoctorDE merged commit 0fab4ea into develop Apr 26, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 📕 Todo

Development

Successfully merging this pull request may close these issues.

3 participants