Skip to content

feat: add a calendar provider for the next meeting and today's agenda - #25

Merged
Seb-GRAF merged 1 commit into
mainfrom
feat/calendar-provider
Oct 16, 2026
Merged

Seb-GRAF merged 1 commit into
mainfrom
feat/calendar-provider

Conversation

@Seb-GRAF

Copy link
Copy Markdown
Collaborator

Problem

A "next meeting" widget needs a script around icalbuddy today. It can't tell "no events" from "no access", it has to parse text for times and links, and it only updates when it polls. Fixes #18.

Changes

  • A native calendar provider reads EventKit (NativeMetrics.swift). Settings: calendars (calendar names, all by default), lookahead (hours, 24), soon and now (whole minutes, 15 and 5).
  • Output: fields title, start, end, minutes, phase (none, later, soon, now, live), link and access (granted, denied, notDetermined); values.remaining with targets one minute ahead, so a 60-second linear progress overlay shrinks smoothly; lists.today for an agenda popup.
  • link is the first Meet, Zoom or Teams HTTPS URL in the event's URL, location or notes. The pattern ends a link at the first character outside a fixed URL-safe set, so joinCommand (open '<link>') never carries a quote or other shell syntax from event text.
  • Phase and link logic are plain functions (meetingCountdown, meetingLink), so they are tested without EventKit.
  • The provider updates at each minute and phase boundary, and at once on EKEventStoreChanged through the existing provider refresh (BarStore). It stays a polled native provider; it doesn't need Register data sources behind one interface, including event-driven ones #17's event-driven sources.
  • Calendars access is requested the first time a calendar provider updates, not at launch. Resources/Info.plist gains only NSCalendarsFullAccessUsageDescription.
  • All-day events are skipped, so a holiday isn't the live meeting all day.
  • Schema entries, and README: a "Calendar" section under shared providers with a widget, agenda popup and Join example, plus a line in the permissions paragraph.

Testing

  • swift test: 105 passed. New ProviderTests cover phase boundaries, minutes and the next-update delay, remaining and its target, and link extraction against quotes, $(), backticks, pipes and look-alike hosts.
  • StableBar --validate accepts the README example and {"type":"calendar"}, and rejects a fractional soon.
  • Not yet checked in the running app: the access prompt, phase changes, the countdown animation, agenda clicks and Join. Screenshots to follow.

Known gaps:

  • Developer ID builds sign with the hardened runtime but without the com.apple.security.personal-information.calendars entitlement, so they would be denied Calendars access. CI builds are ad-hoc signed and unaffected.
  • Ad-hoc signed rebuilds may ask for Calendars access again after each build, as the issue notes.
  • Not handled: declined or cancelled events still count, start and end show only the time, and calendars are matched by name.

Merging

One commit, so any merge method keeps it in the changelog.

Claude Opus 5.5 via Claude Code

@stablebar-releases

Copy link
Copy Markdown

🎉 This PR is included in version 0.5.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a calendar provider for the next meeting and today's agenda

1 participant