Skip to content

fix(events): preserve event color during pending recurring time edits - #5189

Merged
tyler-dane merged 10 commits into
mainfrom
cursor/pending-recurring-color-041c
Nov 9, 2026
Merged

tyler-dane merged 10 commits into
mainfrom
cursor/pending-recurring-color-041c

Conversation

@tyler-dane

@tyler-dane tyler-dane commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Tyler’s macOS report: recurring Google “Devotion” turns default gray while a time replace is pending; siblings stay colored.

Google sync shape (Devotion): googleColorIdToSlot("4") → Compass slot coral; fill at render is EventColorSlotHex.hex(.coral) → #E67C73. Stored as content.color: "coral" (slot), not colorHex, unless the event uses eventLabelId custom labeling instead of colorId.

Web (kept): optimistic merge + mergeEditableContentColor; strip-before-merge for explicit slot clears.

macOS (Tyler’s repro): editDraft copies color: coral; old overlay set colorHex = nil when draft.color != nil → fillColorHex == nil → default gray during drag/keyboard/form pending. presentationColorHex fixes that. Stale loadedEvents after commit keeps salmon at the old start time (not gray); presentOptimisticCache moves time + color together while replace is in flight.

Root cause evidence

Layer Symptom Mechanism
Web Pending gray color: null wiped colorHex in optimistic merge
Mac overlay Tyler’s gray overlay nulled hex for slot drafts
Mac stale cache Wrong time, still salmon slot survives on stale row
Mac cache refresh New time + salmon in flight presentOptimisticCache

Fails on main: NativeCalendarRootModelPendingRecurringColorTests (keyboard + form edit overlays); EventsStorePendingPresentationColorTests.testDraftOverlayResolvesSlotColorBeforeSave.

Verify

Head: d83e0bf83d46d2ee285613df2f12eb87c3570dbe

CI on d83e0bf83: Unit (required), E2E (required), static, swift-packages, macos-build green (last poll).

Open in Web Open in Cursor 

Align optimistic replace color merging with sync mergeUpdateContent so
schedule-only edits no longer strip provider colorHex or slot fills while
the write is in flight. Native draft optimistic payloads use the same rules.

Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Boot bundle: 572.7 KB gzip (+0.0 KB vs main)

cursoragent and others added 8 commits November 9, 2026 12:45
Refresh loadedEvents from the repository as soon as replaceOptimistic
writes the cache, instead of rebuilding from stale rows after draft
commit. Resolve draft overlay fills from slot hex so coral-style Google
events do not fall back to gray during drag or save.

Add native regression tests and broaden web/sync pending color coverage
for thisAndFollowing/all scopes and explicit user color clears.

Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
Document that Google colorId 4 lands as coral slot (salmon #E67C73 via
EventColorSlotHex), not stored colorHex. Add NativeCalendarRootModel
tests for keyboard nudge overlay and in-flight replace fill + schedule.
Correct stale-cache test naming; allow injecting EventsAPI in test env.

Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
@tyler-dane
tyler-dane added this pull request to the merge queue Nov 9, 2026
Merged via the queue into main with commit 5285aac Nov 9, 2026
38 checks passed
@tyler-dane
tyler-dane deleted the cursor/pending-recurring-color-041c branch November 9, 2026 15:09
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