feat: add optimizations to QR code scanning process#43372
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b3a286e. Configure here.
Builds ready [b3a286e]
⚡ Performance Benchmarks (Total: 🟢 18 pass · 🟡 7 warn · 🔴 0 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Builds ready [709722f]
⚡ Performance Benchmarks (Total: 🟢 22 pass · 🟡 2 warn · 🔴 0 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
709722f to
db86a0b
Compare
Builds ready [db86a0b] [reused from 709722f]
⚡ Performance Benchmarks (Total: 🟢 22 pass · 🟡 2 warn · 🔴 0 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|

Description
This PR adds optimizations for QR code scanning which we're using in QR hardware wallet flows.
Changelog
CHANGELOG entry: null
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/MUL-1851
Manual testing steps
Screenshots/Recordings
Before
No UI changes. Nothing to show here.
After
No UI changes. Nothing to show here.
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Changes are confined to QR reader tuning and scan-loop efficiency in the hardware popover; behavior is covered by updated unit tests with no auth or transaction logic touched.
Overview
Improves QR hardware wallet scanning by tuning the camera reader and reducing redundant UR decoding work.
EnhancedQrReadernow starts the stream viadecodeFromConstraintswith 720p ideal resolution, adds ZXingTRY_HARDERand UTF-8 hints, and uses faster scan intervals (80ms between attempts, 50ms after success). Stream start failures are caught so they do not surface as unhandled rejections, and the preview uses a square aspect ratio withobject-fit: cover.useDecoderLifecycleignores consecutive identical QR payloads so animated UR frames are not fed to the decoder repeatedly, and it skips progress updates when a scan completes in one frame. Tests cover the new reader settings and decoder behavior.Reviewed by Cursor Bugbot for commit db86a0b. Bugbot is set up for automated code reviews on this repo. Configure here.