Skip to content

feat(emergency): add profile print card and wallet pass options - #1205

Merged
llinsss merged 1 commit into
DogStark:mainfrom
comandanto:feat/emergency-profile-print
Oct 30, 2026
Merged

llinsss merged 1 commit into
DogStark:mainfrom
comandanto:feat/emergency-profile-print

Conversation

@comandanto

Copy link
Copy Markdown

Summary

Adds a print card and a wallet pass option to the emergency QR panel on the pet page. Both are built only from public fields (pet name, public emergency link, public message) and show the code status and expiration. Closes #1120

Key Changes

  • EmergencyPassOptions component: printable card (print-only CSS shows just the card), status (Active / Expired / Revoked / Unavailable) and expiration date, "Print card" and "Add to wallet" buttons.
  • emergencyPassStatus.ts: derives status from isActive and expiresAt (revocation wins over expiry, unparseable dates are treated as expired).
  • When the code is expired, revoked or missing, both buttons are disabled, the QR and message are hidden from the card, and a role="status" message explains why.
  • qrcodeAPI.getWalletPass: the pass is requested from the backend (GET /qrcodes/:id/wallet-pass), which keeps authorization and consent decisions. A refusal shows a role="alert" message.
  • EmergencyQR loads the pet's QR record and renders the new section. Emergency contact details are never rendered in the card.
  • Semantic section/heading, real buttons, aria-hidden icons, so keyboard and screen reader navigation work.

Note: the /qrcodes/:id/wallet-pass endpoint is assumed on the backend side; the frontend only requests it.

Verification & Test Output

PASS src/components/Profile/__tests__/EmergencyPassOptions.test.tsx
Tests:       7 passed, 7 total

Checklist (the repo has no PR template, project scripts run):

  • Tests added for primary flow, revoked, expired, missing record and backend failure
  • npx eslint on the changed files: 0 errors
  • npm run lint fully green: n/a, main already has 64 lint errors in other files; this PR adds none (64 before, 64 after)
  • npm run type-check fully green: n/a, main already reports 49 error TS lines (syntax errors in src/pages/clinics/[id].tsx, src/pages/notifications.tsx); none in changed files
  • npm run build green: n/a, fails on main for the same unrelated files (notifications.tsx)
  • src/__tests__/lib/qrcodeAPI.privacy.test.ts passes: n/a, it already fails on main before this change
  • Screenshots: not provided, UI was not run in a browser because main does not build

Add a print card and a wallet pass action to the emergency QR panel.
Both use public fields only (pet name, public link, public message) and
show the code status and expiration. Actions are disabled when the code
is expired, revoked or missing. Wallet pass issuing stays with the
backend via a new qrcodeAPI.getWalletPass call.

Closes DogStark#1120
@comandanto

Copy link
Copy Markdown
Author

hey, friendly ping: is there anything I should change to get this reviewed or merged? happy to rebase or adjust. thx

@llinsss
llinsss merged commit 2123dea into DogStark:main Oct 30, 2026
@comandanto

Copy link
Copy Markdown
Author

Thanks for merging this! Glad it was useful.

One question: this issue was tagged Stellar Wave, and I understand another contributor had applied in wave 10 before the PR. Is there anything I need to do on my side (an application or a wallet) so the contribution is counted for the Wave reward? Happy to do whatever is needed.

Also, if you find my work useful, a star on https://github.com/comandanto/bounty-hunter-monitor would be much appreciated. Thank you!

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.

[Frontend] Add emergency profile print and wallet-pass options

2 participants