feat: add QR code download and native share functionality to receive …#79
Merged
Miracle656 merged 1 commit intoMiracle656:mainfrom Apr 17, 2026
Merged
Conversation
|
@ezedike-evan is attempting to deploy a commit to the miracle656's projects Team on Vercel. A member of the Team first needs to authorize it. |
Miracle656
approved these changes
Apr 17, 2026
Owner
Miracle656
left a comment
There was a problem hiding this comment.
Clean work @ezedike-evan — approving this.
What I liked:
QRCodeSVG→QRCodeCanvasswap is the right call for PNG export- The padded canvas approach gives a polished download output
- Web Share API with clipboard fallback is exactly how this should be handled
- QR image upload on the send page is a nice bonus — good error handling for unsupported browsers and invalid QR content
iconBtnStyleextraction keeps things DRY
Minor notes (non-blocking):
- Two files lost their trailing newline at EOF — not a big deal but worth a quick fix if you touch those files again
- The
package-lock.jsonhas a lot ofpeerflag churn — looks like a different npm version. No functional impact but heads up for future PRs: try to match the repo's npm version to keep lock diffs minimal
Merging as-is. Thanks for the contribution! 🤝
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
summary
Users can now fill the recipient address field by uploading a QR code image
from their device — a screenshot, camera roll photo, or saved PNG from the
Receive page. This complements the existing camera scanner and is especially
useful on desktop where live camera scanning is awkward, or when a user has
a saved QR image they want to paste in directly.
Changes
Core Implementation
handleImageFile(file: File)— new async handler that:createImageBitmap(noserver round-trip, works fully offline)
<canvas>to produce a scannable sourceBarcodeDetectorwith{ formats: ['qr_code'] }G...orC..., 56 characters) before populating the recipient fieldre-selected if needed
Upload button — image/upload icon button placed next to the existing
camera scan button in the recipient address row; shows an inline spinner
while decoding; hidden
<input type="file" accept="image/*">triggeredprogrammatically via
useRefto avoid native input styling issuesimgErrorstate — inline error shown below the address field withspecific messages for three failure cases:
BarcodeDetector(with manual fallback hint)iconBtnStyleconstant — shared style object extracted so thecamera scan button and the new upload button are visually identical
without duplicating inline style props
No new dependencies
BarcodeDetectorandcreateImageBitmapare Web APIs already referencedin the existing codebase. No additional packages required.
Related Issues
Companion to the Receive page share/download QR feature.
Type of Change
Checklist
Additional Notes
BarcodeDetectoris supported in Chrome 83+, Edge 83+, and Chrome forAndroid. Safari does not support it — the upload button will show a clear
"not supported in this browser" error message rather than silently failing.
The existing camera scanner (
QrScannercomponent) remains the primarypath for Safari users.
closes #72