Repository navigation
feat(calendar): pick a Google event color in the event editor (#244) - #246
Merged
Merged
Conversation
Creating or editing a Google event now offers the calendar's own color
plus Google's eleven event colors (Tomato ... Graphite), saved as the
event's colorId.
- API: POST/PATCH /api/calendar-sources/:id/events take an optional
color_id ('1'-'11', or null for the calendar's color on an edit; left
out, the color is untouched; anything else is a 400). Cached events
carry color_id beside event_color, so the editor shows the current one.
- The editor sends the color only when it was picked or changed, so an
edit never touches a custom Google label the event wears.
- Sync resolves a colorId through Google's current palette instead of
the API's /colors endpoint, whose pre-2016 hexes disagree with
Google's UI (Graphite came back near-white). A swatch picked in
HomeGlow is now the color the dashboard and Google both show.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
adamecker
pushed a commit
to adamecker/HomeGlow
that referenced
this pull request
Oct 8, 2026
…orth#245 icon picker, jherforth#246 event colors, theming)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #244.
What
When you create or edit a Google event, the editor now has a Color row:
The choice is saved as the event's Google
colorId. When you edit an event, its current color is already picked.How
API.
POST/PATCH /api/calendar-sources/:id/eventstake an optionalcolor_id:'1'–'11'sets that color;null(on an edit) puts the calendar's color back;Cached events carry
color_idbesideevent_color. It's read from theraw_datathat sync already stores, so there's no migration.Custom labels are protected. The editor sends a color only when it was picked or changed. An event may wear a custom Google label, which the picker can't show, and saving a title change must not strip it. This rule is
eventColorToSendinclient/src/utils/googleEventColors.js, with its own tests.Sync uses Google's current palette. Until now, sync turned a
colorIdinto a hex through the API's/colorsendpoint. That endpoint still returns the pre-2016 colors:So picking Graphite in the editor would have shown a near-white event on the dashboard. Sync now resolves
colorIdthroughEVENT_COLORSinservices/googleCalendar.js, the same eleven hexes the swatches use. A custom label's color still wins, as before. As a side effect, sync makes one fewer Google request per run.Docs.
features.mdandbackend-api.mdare updated. I also put the "Per-event Google colors" bullet infeatures.mdback together; its second half had drifted under "Idle auto-return".Effect on existing installs
Events colored in Google with no label will now show Google's current shade instead of the older one. That means Google's UI and HomeGlow agree, which is the reason sync already preferred label colors. Events on their calendar's color, and non-Google sources, are unchanged.
Tested
Server:
npm testpasses 358/358. There are new tests for:color_idin create and update;null;'red', a hex, or 3.5;parseEventColorId.The sync color tests were moved to the new palette.
Client:
npx vitest runpasses (531 tests), andnpm run check:i18nandnpm run buildsucceed.Browser check: a Google-type source was seeded with a Graphite event and an uncolored one. There's no Google account here, so the save calls were intercepted to capture what the editor sends.
color_id."11", and picking "Calendar color" sendsnull."10".Not tested against a real Google account. It's worth one real create/edit before release. In particular, it should confirm that
colorId: nullon a PATCH puts the calendar's color back.🤖 Generated with Claude Code