feat(sync): CloudKit sync status indicator + crisper card hover#21
Merged
feat(sync): CloudKit sync status indicator + crisper card hover#21
Conversation
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>
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.
Summary
TossesViewtoolbar (principal on macOS, top-leading on iOS). Shows a spinner while.import/.exportevents are in flight and anexclamationmark.icloudicon with a tooltip on error, auto-clearing on the next successful event..setupevents are filtered so cold launches don't spin.@MainActorCloudSyncMonitorinTossKitthat subscribes toNSPersistentCloudKitContainer.eventChangedNotification— the Apple-documented path for observing sync in a SwiftData + CloudKit stack (SwiftData'sModelContaineris still backed byNSPersistentCloudKitContainerand posts this notification globally)..sharedBackgroundVisibility(.hidden)(gated with#availablefor older OSes).scaleEffecthover feedback onTossCardwith 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
+, then disappears..importevent arrives and the toss appears in the list.exclamationmark.icloudshows with tooltip. Sign back in and add another toss; icon auto-clears..setup(filtered)..topBarLeadingplacement looks correct.🤖 Generated with Claude Code