feat(desktop): #142 slice 4 — recovery notification routing + owner cancel (KEY-17) #152

Merged
amiryahaya merged 2 commits from feat/recovery-notification-routing into main 2026-11-11 08:40:12 +01:00
Owner

The last #142 slice — closes the loop on recovery notification UX and the KEY-17 owner-cancel path.

The gap: recovery notifications (recovery_alert / recovery_request / recovery_cancelled) had icons and filters but clicking did nothing, and the anti-abuse answer to "a thief initiates recovery on your account" existed only as a server endpoint — no client surface at all.

Landed (frontend-only — the server always attached action_type + action_resource_id to recovery_alert; the client type dropped them)

  • useNotificationRouting hook: type → destination map (recovery_* → /settings#recovery, share_received → shared-with-me); marks read, then routes. Wired into BOTH surfaces — the full NotificationsPanel and the header dropdown.
  • Owner cancel (KEY-17): recovery_alert items carrying the server's action_resource_id (the request id, attached by both initiation paths) render a destructive "Not me — cancel" button → confirm dialog ("cancelling immediately invalidates the request — trustees can no longer approve it") → cancel_recovery_request (client command landed in PR #141). Success toast; failures (409 already-decided, cooldown) surface without clearing the notification.
  • SettingsPage: /settings#recovery anchor with smooth scroll as the routing target.
  • The notificationStore's Notification type now carries action_type / action_resource_id.

Tests (6 new): click-routing to /settings#recovery, cancel-button presence gated on the resource id (non-owner alerts get none), the confirm→cancel flow invoking cancel_recovery_request with the request id, failure surfacing, plus the route-map contract.

vitest 1301/1skip; typecheck clean; lint clean (0 warnings). No server or Rust changes.

The last #142 slice — closes the loop on recovery notification UX and the KEY-17 owner-cancel path. **The gap**: recovery notifications (recovery_alert / recovery_request / recovery_cancelled) had icons and filters but clicking did nothing, and the anti-abuse answer to "a thief initiates recovery on your account" existed only as a server endpoint — no client surface at all. **Landed (frontend-only — the server always attached `action_type` + `action_resource_id` to recovery_alert; the client type dropped them)** - **`useNotificationRouting` hook**: type → destination map (`recovery_*` → `/settings#recovery`, `share_received` → shared-with-me); marks read, then routes. Wired into BOTH surfaces — the full NotificationsPanel and the header dropdown. - **Owner cancel (KEY-17)**: `recovery_alert` items carrying the server's `action_resource_id` (the request id, attached by both initiation paths) render a destructive **"Not me — cancel"** button → confirm dialog ("cancelling immediately invalidates the request — trustees can no longer approve it") → `cancel_recovery_request` (client command landed in PR #141). Success toast; failures (409 already-decided, cooldown) surface without clearing the notification. - **SettingsPage**: `/settings#recovery` anchor with smooth scroll as the routing target. - The notificationStore's `Notification` type now carries `action_type` / `action_resource_id`. **Tests** (6 new): click-routing to `/settings#recovery`, cancel-button presence gated on the resource id (non-owner alerts get none), the confirm→cancel flow invoking `cancel_recovery_request` with the request id, failure surfacing, plus the route-map contract. vitest 1301/1skip; typecheck clean; lint clean (0 warnings). No server or Rust changes.
feat(desktop): #142 slice 4 — recovery notification routing + owner cancel (KEY-17)
All checks were successful
Security CI / security-scan (pull_request) Successful in 2m37s
16d442e67f
The last #142 slice. Recovery notifications (recovery_alert /
recovery_request / recovery_cancelled) rendered with icons and filters
but clicking them did nothing, and the KEY-17 owner-cancel path - the
anti-abuse answer to a thief initiating recovery - existed only as a
server endpoint with no client surface.

- useNotificationRouting hook: type -> destination map (recovery_* ->
  /settings#recovery, share_received -> /shared-with-me); marks read
  then routes. Wired into BOTH notification surfaces (full panel and
  the header dropdown).
- Owner cancel (KEY-17): recovery_alert items carrying the server's
  action_resource_id (the request id - InitiateRecoveryRequest and
  CreateRecoveryRequest both attach it) render a destructive
  "Not me - cancel" button; confirm dialog explains that cancelling
  invalidates the request for trustees; calls cancel_recovery_request
  (landed client-side in PR #141); success toast + failure surfacing
  (409 already-decided etc.).
- SettingsPage: /settings#recovery deep-link anchor with smooth scroll.
- notificationStore Notification now carries action_type /
  action_resource_id (the server list projection always had them; the
  client type dropped them).

No server or Rust changes - the pieces all existed; this wires them.

vitest 1301/1skip (6 new); typecheck clean; lint clean (0 warnings).
fix(desktop): 3s first-load waitFor in the share-page suites (timing half of the CI flake)
All checks were successful
Security CI / security-scan (pull_request) Successful in 2m28s
430212a82f
Slice 3 fixed the DATA half of the share-page CI flake (persistent
mocks); CI still failed intermittently on the TIMING half - waitFor's
1s default expires before the async list renders on saturated 2-core
runners, leaving zero buttons in the DOM. All waitFor call sites in
MySharesPage/SharedWithMePage now use a 3s waitForLoaded helper (the
#141 precedent).

vitest 1301/1skip; typecheck + lint clean.
amiryahaya deleted branch feat/recovery-notification-routing 2026-11-11 08:40:13 +01:00
Sign in to join this conversation.
No description provided.