mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-09 16:14:40 +00:00
Adds AuthApprovalBanner in commons.relayClient.auth — a Compose- Multiplatform composable that renders one row per pending tier-2 NIP-42 AUTH challenge with three actions matching the AuthApprovalScope: [Once] — sign this challenge, don't persist [Always] — sign + persist ALWAYS via the store [Never] — drop + persist BLOCKED via the store Wired into desktop Main.kt as a global top-of-content banner reading authCoordinator.pendingApprovals and calling authCoordinator.resolve. Now tier-2 challenges actually have a UI to resolve — desktop AUTH is end-to-end usable. Up to 3 rows stack inline; the rest collapse into a "+N more pending" row (click-to-expand can come later). Each row shows the relay's display URL plus message-count when multiple challenges from the same relay have coalesced. The composable itself is in commons so Android picks it up free when its AccountAuthApprovals VM wire-up lands — only the Main.kt-level wiring (where to mount the banner in the layout) is platform-specific. Lifecycle: - Banner subscribes to pendingApprovals via collectAsState; recomposes only when the PersistentMap identity changes (per the substrate built in earlier commits). - onResolve calls authCoordinator.resolve(url, scope), which completes the underlying CompletableDeferred + removes the entry from the pending map; the suspended signer wakes up and signs (or doesn't).