Skip to content

Consent approval & spend window UX: approve-once, rich event previews, and keyboard/layout polish - #41

Merged
jjohare merged 1 commit into
mainfrom
ui/consent-and-spend-ux
Nov 28, 2026
Merged

jjohare merged 1 commit into
mainfrom
ui/consent-and-spend-ux

Conversation

@jjohare

@jjohare jjohare commented Nov 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Upgrades the signing approval prompt (popup/approve.*) and polishes the sidestr spend window (popup/spend.*) for clearer consent decisions, better ergonomics, and reliable cleanup.

Signing Approval Prompt (popup/approve.*, src/event-preview.js, src/background.js)

  • Approve once vs. Always trust: Adds an interactive Always trust this site checkbox that dynamically switches the action button between Approve & trust (trust: true) and Approve once (trust: false), letting users approve a single request without granting permanent silent signing/decryption access. Backward-compatible when trust is omitted.
  • Human-readable Nostr event previews: Adds src/event-preview.js to surface plain-English event kind labels (Public note, Relay authentication, HTTP / Solid authentication, etc.) along with key tags (u, method, relay) and content — replacing the bare tag count — plus a collapsible Raw payload inspector.
  • Safer, clearer button & layout ergonomics:
    • Replaces the red danger styling on Approve with a trust-blue button while keeping Deny autofocused on the left, paired with a brief 350ms anti-clickjacking grace delay before Approve enables.
    • Fluid 100% width and a sticky bottom footer so Deny/Approve and countdown are never pushed below the fold.
    • Escape key immediately denies and closes.
    • Replaces the 60fps requestAnimationFrame countdown loop with a lightweight 250ms timer and fixes WCAG AA label contrast (--text-faint → --text-muted).
  • Reliable close cleanup: Tracks approval windowId in src/background.js and denies immediately in chrome.windows.onRemoved if the window is closed abruptly without beforeunload.

Sidestr Spend Window (popup/spend.*)

  • Fluid 100% body width to avoid horizontal scrollbars inside the 440px popup window on Windows/Linux.
  • Escape key rejects/closes from opt-in, review, failure, or signed screens; adds an explicit Close button on the signed confirmation card.
  • Fixes retry state reset and avoids stacking duplicate listeners on #sign / #ack after clicking Forget the old signer.
  • Uses the user's browser locale instead of hardcoded 'en-GB' and improves pending-step contrast.

Testing

  • npm run build
  • npm test (249/249 passing, including test/event-preview.test.js and new consent-approval.test.js cases for approve-once and windows.onRemoved)
  • npm run lint + npx eslint popup/

@jjohare
jjohare merged commit e5387e4 into main Nov 28, 2026
2 checks passed
@jjohare
jjohare deleted the ui/consent-and-spend-ux branch November 28, 2026 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant