nvrsion: Add: Align streak card lightning bolt to left side of card, remove streak freeze counter, fix push notification wording to reflect correct session status, adjust push notification logic to recall only the approval request’s notification without affecting live activities, and investigate Live Activity Session Load.

Nucleic-Promote: 1
Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
2026-07-06 15:10:07 -07:00
co-authored by Nucleic
parent 43a9784aa1
commit 844549b443
11 changed files with 612 additions and 13 deletions
@@ -108,21 +108,15 @@ final class NotificationRouter: NSObject {
center.removePendingNotificationRequests(withIdentifiers: [identifier])
}
/// Recall the shared "waiting for your approval" attention notification once nothing is pending
/// anywhere. This is the remote wake tickle (delivered under `approvalTickleIdentifier`) that a
/// prior push left on the lock screen — the counterpart to the per-approval `withdrawApproval`.
/// Arrives two ways: the relay's silent `clear` push (phone was away), or the store's own
/// reconcile when a live socket sees the last approval resolve. Also sweeps any per-approval
/// locals a live socket posted but hasn't individually withdrawn, so the lock screen ends clean.
/// Recall the generic remote wake tickle ("A session is waiting for your approval") once no
/// approval is pending anywhere. This targets *only* the shared tickle (delivered under
/// `approvalTickleIdentifier`, its APNs collapse-id) — the content-free push a phone gets while
/// away. Per-approval notifications are each recalled by `withdrawApproval(_:)` as they resolve,
/// so a still-pending approval's own banner is never swept away by this.
func withdrawApprovalAttention() {
let center = UNUserNotificationCenter.current()
center.removeDeliveredNotifications(withIdentifiers: [Self.approvalTickleIdentifier])
center.removePendingNotificationRequests(withIdentifiers: [Self.approvalTickleIdentifier])
center.getDeliveredNotifications { delivered in
let stale = delivered.map(\.request.identifier).filter { $0.hasPrefix("approval-") }
guard !stale.isEmpty else { return }
UNUserNotificationCenter.current().removeDeliveredNotifications(withIdentifiers: stale)
}
}
/// Keep the app-icon badge equal to the NEEDS YOU count (UX_IOS §8).