Skip to content

feat(calendar): add Google Calendar widget#886

Open
tylertylerday wants to merge 5 commits intoamnweb:mainfrom
tylertylerday:widget/calendar
Open

feat(calendar): add Google Calendar widget#886
tylertylerday wants to merge 5 commits intoamnweb:mainfrom
tylertylerday:widget/calendar

Conversation

@tylertylerday
Copy link
Copy Markdown

Summary

  • New widget that surfaces the next upcoming Google Calendar event(s) in the bar with a countdown.
  • Left-click joins Meet/Zoom/Teams (priority: hangoutLinkconferenceData.entryPoints[] → regex over location+description); falls back to opening the event page in Google Calendar.
  • Supports merging events across multiple calendars (calendar_ids), and the hover tooltip shows the next N events (default 3).
  • One-time OAuth setup is documented in docs/widgets/(Widget)-Calendar.md; credentials/token paths are configurable.
  • Frame state classes (loading/ok/empty/setup/error + meeting kind + upcoming/live/ended) make it easy to style per state.

Adds three runtime deps to pyproject.toml: google-api-python-client, google-auth-oauthlib, google-auth-httplib2.

Test plan

  • Widget loads cleanly, no errors at startup with calendar widget configured
  • First-run OAuth flow opens browser, writes token.json, fetches events on next tick
  • Refresh token path works on subsequent launches without prompting
  • Multi-calendar merge: events from primary + a shared calendar appear sorted by start time
  • Tooltip shows up to tooltip_event_count events
  • hide_when_empty: true correctly hides the widget when there are no upcoming events
  • Test on machines without the google-* deps installed (pre-uv sync) — widget should emit a clear setup error rather than crash
  • CI lint/format pass on this branch

🤖 Generated with Claude Code

@tylertylerday
Copy link
Copy Markdown
Author

image

tylertylerday and others added 5 commits May 5, 2026 22:03
Surface the next upcoming event(s) from one or more Google Calendars in
the bar, with a left-click that joins Meet/Zoom/Teams meetings or falls
back to the calendar event page. Tooltip lists the next N events
(default 3) merged across all configured calendars.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
cx_Freeze bundles googleapiclient as .pyc inside library.zip but does not
include the discovery_cache JSON data files. With the default
static_discovery=True, build() looks for the missing calendar.v3.json and
raises UnknownApiNameOrVersion instead of falling back to the network.
Force network discovery so the widget works in both dev and packaged installs.
The initial Google Calendar widget commit imported from
core.widgets.services.google_calendar.auth and .auth_dialog but never
committed those files, leaving the PR with a broken import on remote.
Adding them now in their original form so the feature builds end-to-end.
…d sign-in

Round out the Google Calendar widget with the in-progress polish that was
sitting unstaged:

- Popup menu (event_count, blur, round_corners, alignment, direction)
  rendered as a PopupWidget with per-event rows that join meetings or open
  the event page on click.
- Notification dot painted on the icon when an event is live or imminent,
  configurable corner/colour/margin/threshold via notification_dot.
- tooltip_event_count config (default 1) lists the next N upcoming events
  in the hover tooltip, joined with blank lines.
- URL-based sign-in flow: instead of auto-launching the default browser
  (which can hit Google's "Something went wrong" page when an existing
  Google session conflicts), the auth dialog now surfaces the
  authorisation URL with Copy/Open buttons so it can be pasted into an
  incognito or alternate browser.
- Refactored OAuth helpers and dialog into their own service module so
  the widget file stays focused on rendering.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant