Notifications chiclet (persisted + synced) + archive-on-import - #52
Merged
Merged
Conversation
…tions Implements the Overview Notifications chiclet (B3) and import archive suggestions (B4). (Rebuilt cleanly on main after the stacked base branch was deleted; supersedes #50.) New synced model AppNotification (id, kind, title, message, contactId, isRead, isDismissed + sync/provenance). Additive migration — no schema-version bump (which would wipe the store); AppNotification has no Contact relationship (scalar contactId), so SwiftData migrates additively and existing data is preserved. Wired end-to-end like the other synced models: ModelSyncApply (toDict/applyRemote), client LocalServerSyncService push/pull/flip, server BackupServer pull/push/applySyncDeletes, both schemas + TestHelpers. Generation (NotificationService, deduped one-per-contact-per-kind, idempotent): - Fading: contacts with 0 < score < fading threshold (mirrors the Dashboard fading definition; capped 10/run), generated each sync pull after the score recalc. - Archive (B4): ContactSyncService.mergeOrInsert, full Import All only, flags active contacts whose cnContactIdentifier left the live address-book set. UI: bell chiclet + count badge in the Overview toolbar -> sheet NotificationsView (swipe-leading open / trailing dismiss / inline Archive). DashboardView keeps its manual-fetch (no @query) crash-safe pattern. Tests: NotificationsTests (generation, dedup, sync round-trip + conflict). Full macOS suite green (232 tests). macOS app + BlackbookServer build clean. Co-Authored-By: Claude Opus 4.8 <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.
The final two requested features (B3 + B4). Rebuilt cleanly on `main` (supersedes #50, which was orphaned when the stacked base branch was deleted on #48's merge). #48 and #51 are already merged.
New synced model: `AppNotification`
`id, kind, title, message, contactId, isRead, isDismissed` + standard sync/provenance. Wired like the other synced models: client + server schema, `ModelSyncApply`, `LocalServerSyncService` push/pull/flip, `BackupServer` push/pull/deletes.
Data safety: additive schema — no `currentSchemaVersion` bump (that path wipes the store). `AppNotification` has no relationship to `Contact` (scalar `contactId`), so SwiftData migrates additively; existing data is preserved.
Generation (`NotificationService`, deduped, idempotent)
UI
Bell chiclet + count badge in the Overview toolbar → sheet listing non-dismissed notifications newest-first: tap / swipe-leading open, swipe-trailing dismiss, archive rows get inline Archive. `DashboardView` keeps its no-`@Query` crash-safe fetch.
Tests
`NotificationsTests` (generation scope/idempotency, archive dedup, sync round-trip + conflict). Full macOS suite green: 232 tests. macOS app + BlackbookServer build clean.
Rebuild + reinstall `/Applications/BlackbookServer.app` (Release) so the server relays `appNotifications` (not on TestFlight; additive migration runs on first launch).
🤖 Generated with Claude Code