chore: use io-ts to parse vault keycard box + update keycard formatting and QR headers#9225
chore: use io-ts to parse vault keycard box + update keycard formatting and QR headers#9225s84krish wants to merge 1 commit into
Conversation
e4495b2 to
5cde131
Compare
|
Claude finished @s84krish's task —— View job Code Review Complete ✅Todo List:
Review SummaryThis PR successfully addresses the followups from the previous discussion and implements several improvements to vault keycard generation. The changes are well-structured and maintain backward compatibility while adding the new part-based QR encoding. ✅ Strengths1. io-ts Integration (
|
| * does not affect PDF-based recovery. | ||
| */ | ||
| function encodeQrCodePart(fragment: string, index: number, total: number): string { | ||
| return total > 1 ? `${index + 1}/${total}|${fragment}` : fragment; |
There was a problem hiding this comment.
Wondering what the best way to do this parts encoding would be - if it is even necessary.
There was a problem hiding this comment.
Pull request overview
This PR updates the key-card module’s vault keycard UX and data handling by (1) switching vault box parsing to io-ts validation, (2) updating vault-specific Box D wording/copy, and (3) introducing QR “part headers” for split vault QR payloads while refining the PDF layout around multipart QRs.
Changes:
- Add
io-ts-based decoding forparseVaultKeycardBox, and adjust unit tests accordingly. - Update vault keycard wording (Box D title/description and “vault password” language) and plumb vault/wallet entity wording through passcode QR generation.
- Add opt-in QR fragment part headers (enabled for vault keycards) and reposition multipart notes under the QR column with improved row-height calculation.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| modules/key-card/test/unit/vaultQrData.ts | Updates vault QR data expectations (vault wording) and loosens malformed box parsing assertions; adds a “well-formed box” decode check. |
| modules/key-card/src/types.ts | Adds useQrPartHeaders option and clarifies page break behavior docs. |
| modules/key-card/src/parseKeycard.ts | Switches parseVaultKeycardBox to io-ts validation and updates Box D title matching to support vault wording. |
| modules/key-card/src/index.ts | Enables QR part headers for vault keycard generation. |
| modules/key-card/src/generateQrData.ts | Adds wallet/vault entity wording to Box D generation; updates vault box descriptions to “vault password”. |
| modules/key-card/src/drawKeycard.ts | Implements QR part headers (opt-in) and adjusts multipart QR layout/note placement and row-height calculations. |
| modules/key-card/package.json | Adds runtime deps needed for io-ts decoding (fp-ts, io-ts, io-ts-types). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5cde131 to
f8dc5c4
Compare
pranishnepal
left a comment
There was a problem hiding this comment.
added my commentary - will defer to folks involve in the project for a thorough review
f8dc5c4 to
1bf1a2c
Compare
1bf1a2c to
4cacf1c
Compare
Ticket: WCN-1193
Description
This PR addresses followups from #9209 (comment) as well as makes improvements to the formatting and copy of vault keycards. Also includes a new part-based encoding for the QRs. Mock below:
Type of change
How Has This Been Tested?
Generated PDFs locally for vault and wallet keycards using mock data.
vault-keycard.pdf
keycard-ed25519Multisig.pdf