-
Notifications
You must be signed in to change notification settings - Fork 12
feat(google-calendar): add color-coded events support #614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
- Add colorId and backgroundColor fields to CalendarEvent interface - Fetch event colors from Google Calendar Colors API with caching - Apply event-specific colors to all calendar views (daily, weekly, schedule) - Fallback to default color when colorId is not specified
PR Reviewer Guide 🔍(Review updated until commit d45082a)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to d45082a
Previous suggestionsSuggestions up to commit 0dc730f
|
There was a problem hiding this 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 color-coded events in the Google Calendar Edge App by fetching event colors from the Google Calendar Colors API and applying them across all calendar views.
Changes:
- Added
colorIdandbackgroundColorfields to theCalendarEventinterface - Created a new
colors.tsutility module with color fetching and caching functionality - Updated event fetching logic to retrieve and map colors to events with graceful fallback to defaults
- Modified all three calendar views (daily, weekly, schedule) to dynamically apply event background colors
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| edge-apps/blueprint/ts/constants/calendar.ts | Added optional colorId and backgroundColor fields to CalendarEvent interface |
| edge-apps/google-calendar/src/colors.ts | New utility file implementing color fetching from Google Calendar API with module-level caching |
| edge-apps/google-calendar/src/events.ts | Integrated color fetching and mapping into event retrieval logic with error handling |
| edge-apps/blueprint/ts/components/calendar/DailyCalendarView.vue | Applied backgroundColor to event styles and updated cache key to include color |
| edge-apps/blueprint/ts/components/calendar/WeeklyCalendarView.vue | Applied backgroundColor to event styles and updated cache key to include color |
| edge-apps/blueprint/ts/components/calendar/ScheduleCalendarView.vue | Applied backgroundColor as dot color in schedule view |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| let cachedColors: CalendarColors | null = null | ||
|
|
||
| export const fetchCalendarColors = async ( | ||
| accessToken: string, | ||
| ): Promise<CalendarColors> => { | ||
| if (cachedColors) { | ||
| return cachedColors | ||
| } |
Copilot
AI
Jan 18, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The module-level cache for calendar colors never gets invalidated. This means if a user changes their color preferences in Google Calendar, the app won't reflect those changes until it restarts. Consider implementing a cache invalidation strategy, such as using the 'updated' field from the API response to determine if the cache is stale, or adding a time-based expiration (e.g., cache colors for 1 hour).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
…ar colors - Add 1-hour cache expiration for color mappings - Track cache timestamp to determine staleness - Implement isCacheValid() helper function - Ensure color changes in Google Calendar are reflected within 1 hour
|
Persistent review updated to latest commit d45082a |
|
@salmanfarisvp, please review this PR. Here are the screenshots that reflect the changes: Weekly View
Daily View
Schedule View
|



User description
This PR adds support for color-coded events in the Google Calendar Edge App.
Changes
colorIdandbackgroundColorfields toCalendarEventinterfacecolorIdis not specifiedImplementation Details
colors.tsutility to fetch and map Google Calendar color definitionsevents.tsto include color information when fetching eventsTesting
colorIdsetcolorIdis missingPR Type
Enhancement
Description
Add
colorIdandbackgroundColorevent propertiesFetch calendar colors with one-hour cache
Map events to colors in
fetchCalendarEventsFromGoogleAPIApply event background styles in calendar views
Diagram Walkthrough
File Walkthrough
calendar.ts
Extend CalendarEvent interface with colorsedge-apps/blueprint/ts/constants/calendar.ts
colorIdpropertybackgroundColorpropertycolors.ts
Implement calendar color fetching and cachingedge-apps/google-calendar/src/colors.ts
fetchCalendarColorsAPI callisCacheValidgetEventBackgroundColorfallback logicevents.ts
Integrate color mapping in event fetchedge-apps/google-calendar/src/events.ts
fetchCalendarColorscolorId&backgroundColorto eventsDailyCalendarView.vue
Style daily view events with background coloredge-apps/blueprint/ts/components/calendar/DailyCalendarView.vue
backgroundColorbackground-colorstyle if availableScheduleCalendarView.vue
Color-code dots in schedule viewedge-apps/blueprint/ts/components/calendar/ScheduleCalendarView.vue
:styleusingbackgroundColorWeeklyCalendarView.vue
Style weekly view events with background coloredge-apps/blueprint/ts/components/calendar/WeeklyCalendarView.vue
backgroundColorbackground-colorstyle if available