Skip to content

feat(sync): CloudKit sync status indicator + crisper card hover#21

Merged
pseudobun merged 2 commits intomainfrom
feat/cloudkit-sync-indicator
Apr 14, 2026
Merged

feat(sync): CloudKit sync status indicator + crisper card hover#21
pseudobun merged 2 commits intomainfrom
feat/cloudkit-sync-indicator

Conversation

@pseudobun
Copy link
Copy Markdown
Owner

Summary

  • Adds a small CloudKit sync status indicator to the TossesView toolbar (principal on macOS, top-leading on iOS). Shows a spinner while .import/.export events are in flight and an exclamationmark.icloud icon with a tooltip on error, auto-clearing on the next successful event. .setup events are filtered so cold launches don't spin.
  • Implemented via a new @MainActor CloudSyncMonitor in TossKit that subscribes to NSPersistentCloudKitContainer.eventChangedNotification — the Apple-documented path for observing sync in a SwiftData + CloudKit stack (SwiftData's ModelContainer is still backed by NSPersistentCloudKitContainer and posts this notification globally).
  • The indicator uses a fixed 18pt frame so the toolbar never reflows between idle and syncing, and opts out of the macOS/iOS 26 shared Liquid Glass background via .sharedBackgroundVisibility(.hidden) (gated with #available for older OSes).
  • Replaces the 0.5% scaleEffect hover feedback on TossCard with a stronger shadow, an inner accent-colored border overlay, and a pointing-hand cursor. The fractional scale was forcing subpixel resampling and making the card look faintly blurry on hover.

Why

CloudKit sync is currently invisible to the user — when it silently broke recently (iOS↔macOS CloudKit environment mismatch) there was no signal at all. Apple's own guidance is that event notifications describe activity, not definitive "fully synced" truth, so the UX is deliberately minimal: transient spinner only, auto-clearing error icon, nothing persistent, no "last synced at X" text.

Test plan

  • Launch on macOS; toolbar looks unchanged at idle (no bezel, no empty slot).
  • Add a toss on the Mac; spinner appears briefly in the toolbar between "Tosses" and +, then disappears.
  • Add a toss on a second device on the same iCloud account; first Mac shows a spinner when the .import event arrives and the toss appears in the list.
  • Sign out of iCloud, add a toss; orange exclamationmark.icloud shows with tooltip. Sign back in and add another toss; icon auto-clears.
  • Cold-launch several times; no spinner during .setup (filtered).
  • Hover a toss card on macOS; border + shadow + cursor change, no blur.
  • Build on iOS — .topBarLeading placement looks correct.

🤖 Generated with Claude Code

pseudobun and others added 2 commits April 14, 2026 10:55
Observe NSPersistentCloudKitContainer.eventChangedNotification through a
new @mainactor CloudSyncMonitor in TossKit and surface a small indicator
in the TossesView toolbar (principal on macOS, topBarLeading on iOS). The
indicator shows a spinner while import/export events are in flight and an
exclamationmark.icloud icon with a tooltip on error, auto-clearing on the
next successful event. Setup events are filtered so cold launches don't
spin. The indicator uses a fixed 18pt frame so the toolbar never reflows,
and opts out of the macOS/iOS 26 shared Liquid Glass background via
.sharedBackgroundVisibility(.hidden).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace the 0.5% scaleEffect with a stronger shadow, an inner accent
border overlay, and a pointing-hand cursor. The fractional scale was
forcing subpixel resampling that made the card look faintly blurry on
hover; the new feedback is pixel-aligned and more clearly signals the
hover target.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@pseudobun pseudobun merged commit 772cadd into main Apr 14, 2026
3 checks passed
@pseudobun pseudobun deleted the feat/cloudkit-sync-indicator branch April 14, 2026 08:57
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