Skip to content

feat(calendar): Implement Recurring Events with Multi-Day/Date Patterns, Notification Engine and Granular Deletion Options#64

Merged
eedali merged 2 commits into
Kobar-Project:masterfrom
arindam-sahoo:feat/calendar-recurring-events
Jun 3, 2026
Merged

feat(calendar): Implement Recurring Events with Multi-Day/Date Patterns, Notification Engine and Granular Deletion Options#64
eedali merged 2 commits into
Kobar-Project:masterfrom
arindam-sahoo:feat/calendar-recurring-events

Conversation

@arindam-sahoo

@arindam-sahoo arindam-sahoo commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

Description

This pull request implements a comprehensive client-side event recurrence engine for KoCalendar, supporting daily, weekly, monthly, and yearly recurring events.

Key Features:

  1. Flexible Recurrence Scheduling:
    • Supports daily, weekly, monthly, and yearly intervals.
    • Allows setting ending constraints: "Never", "On Date" (specific end date), or "After N occurrences".
    • Supports complex multi-day weekly selections (e.g. repeat every Mon, Wed, Fri) and comma-separated multi-date monthly selections (e.g. repeat on the 1st and 15th of the month).
  2. Granular Recurring Event Deletion:
    • Only this occurrence: Adds the selected date to recurrenceExceptions so it is omitted without altering other events.
    • This and all following events: Truncates the series by dynamically ending the recurrence series on the day before the deleted occurrence.
    • All events in the series: Deletes the parent event completely.
  3. Background Occurrence Notifications:
    • Integrates a 30-second interval check inside App.tsx that scans for upcoming occurrences of recurring events, scheduling desktop alerts matching user-specified notification offsets. Uses session-level alerting history to guarantee exactly-once delivery.

Bug Fixes Included:

  • Timezone-Safe Following Deletions: Solved a timezone offset bug where deleting "This and all following events" would cause the entire series to be excluded in negative timezones. prevDay's hours are now set to 23:59:59.999 local time to preserve the correct boundary when converted to/from ISO string.
  • Unique Virtual DOM Keys: Fixed a bug where deleted occurrences persisted in the "Upcoming Events" view until page refresh or adding a new event. Replaced duplicate key={ev.id} keys with unique composite key={${ev.id}-${ev.startTime}} keys for React's diffing engine.
  • Consistent ISO Parsing: Replaced inconsistent new Date() parses with parseISO from date-fns for event times to align platform-wide time interpretations.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • UI/UX improvement (visual changes or enhancements)
  • Documentation update

Screenshots / Video

KoBar.PR.64.mp4

Checklist

  • I have tested my code locally and it works flawlessly.
  • I am strictly sure that my changes DO NOT break KoBar's "Ghost Window" (transparent window) and click-through logic.
  • I have added necessary descriptions and comments to my code.
  • My code does not generate any new warnings or errors in the console.

This commit introduces a new feature that provides desktop notifications for upcoming calendar events.

Changes include:
- **Event Notifications:** A background process (useEffect in App.tsx) periodically checks for local events with notifications enabled. If an event is scheduled to start soon (based on `notificationMinutes`), a desktop notification is triggered.
- **Calendar Event Properties:** Added `notificationEnabled` and `notificationMinutes` to `CalendarEvent` interface, allowing users to configure notifications per event.
- **Calendar Utilities (`calendarUtils.ts`):** Introduced a set of comprehensive utility functions to handle recurring events, calculate specific occurrences on a given date, and retrieve upcoming events. These functions consolidate logic previously spread across multiple components.
- **Component Integration:** Updated `KoCalendarPopup` and `KoCalendarWidget` to utilize the new `calendarUtils` for event display and management.
- **Internationalization:** Added new translation keys for notification messages and recurrence deletion options.

This enhancement significantly improves the user experience by proactively informing them about important events.
The `key` prop for event items rendered within the `KoCalendarPopup` component was updated. Previously, the key was based solely on `ev.id`. This could lead to React warnings about duplicate keys and potential rendering inconsistencies if `ev.id` was not unique for all items in the list.

The key has been updated to `${ev.id}-${ev.startTime}` to provide a more robust and unique identifier for each event item. This ensures rendering stability and prevents React warnings related to non-unique list keys.
@arindam-sahoo arindam-sahoo self-assigned this Jun 1, 2026
@arindam-sahoo arindam-sahoo requested a review from eedali June 1, 2026 04:47
@arindam-sahoo arindam-sahoo marked this pull request as ready for review June 1, 2026 04:47
@arindam-sahoo

Copy link
Copy Markdown
Collaborator Author

@eedali I have unit tested the feature. However, I guess you will be better at testing the UI stuffs. And, there are many permutations and combinations possible for this feature. Maybe I missed any, so let me know if you find any. After this PR, I will raise a fix PR for KoCalendar and then proceed with Integration of Google Calendars and other Calendars if possible.

@eedali

eedali commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

@eedali I have unit tested the feature. However, I guess you will be better at testing the UI stuffs. And, there are many permutations and combinations possible for this feature. Maybe I missed any, so let me know if you find any. After this PR, I will raise a fix PR for KoCalendar and then proceed with Integration of Google Calendars and other Calendars if possible.

Hey @arindam-sahoo! 👋

Thanks so much for putting in the work and unit testing this. I will definitely dive in, test the UI, and check all the possible permutations as soon as I can.

However, before we move forward with the KoCalendar fixes and the Google Calendar integration, I think it would be best to temporarily pause core feature development and put all our energy into finalizing the new modular plugin ecosystem.

I've been making massive changes over in PR #58. I've actually started decoupling our existing core features and turning them into standalone plugins! So far, I have successfully extracted:

ClipboardManager

PinWindowToTop

Screenshot

Shortcuts

SnippetVault

ToDoList

The plan is that once I convert all the necessary features into plugins, I am going to open separate, dedicated repositories for each of them under our GitHub organization. I believe continuing development this way will keep the core app incredibly lightweight and make maintaining features much easier.

If you're up for it, I would absolutely love for you to jump in and help me finalize PR #58 instead! Once we get this modular architecture rock solid, building out that Google Calendar integration as its own independent plugin is going to be amazing.

Let me know what you think about this roadmap! 🚀

@eedali eedali merged commit 9771661 into Kobar-Project:master Jun 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants