fix: use default camera autofocus for QR scanning - #459
Draft
hermes-alby wants to merge 2 commits into
Draft
hermes-alby wants to merge 2 commits into
hermes-alby wants to merge 2 commits into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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
Remove the
autofocusprop entirely from the shared QR scanner, using Expo's defaults on every platform as requested in review. The production diff is a one-line deletion; no platform conditional, lens/zoom override, new dependency, or UI change.Keep this draft pending iPhone 15 Pro and Android device tests. This removes a one-shot-focus override on iOS, but is not a verified macro/lens-switching fix.
Platform behavior
off.offmaps to continuous autofocus;onfocuses once and locks. Expo's maintainer recommends the default for moving QR scans.OFF; the prop setter only changes it when needed. This leaves CameraX's default focus handling in place. Source inspection of the pinned CameraX 1.6.0 confirms preview defaults to continuous-picture autofocus where supported (State3AControl.kt).cancelFocusAndMetering()restores continuous AF rather than disabling it. Sources: Expo view, CameraX camera2 source archive, CameraX core source archive.offmapping requests manual focus where supported, unlike iOS. It does not preserve the previous web focus override.Other-wallet research
These are implementation comparisons, not device-test results. Our pinned Expo version selects lenses by localized names, and virtual cameras need device-derived zoom normalization. No brittle lens override is added. The upstream reporter still experienced close-range blur after trying the focus setting; a physical lens's minimum focusing distance remains a separate issue.
Verification on the updated code
yarn test --runInBand— 28 passed.yarn test --preset jest-expo/android --runInBand --testMatch '**/__tests__/**/*.[jt]s?(x)'— the same 28 tests passed under the Android preset. The explicit glob matches this repo's existing test filenames.yarn lint:js,yarn tsc:compile,yarn format,git diff --check— passed.CI=1 yarn expo export --platform android --output-dir /tmp/alby-go-default-focus-android— passed.CI=1 yarn expo export --platform ios --output-dir /tmp/alby-go-default-focus-ios— passed.Exports are JavaScript/Hermes bundles, not native APK/Xcode builds. Unit tests check the omitted-prop contract and QR callback, not optics. No Android SDK/device tooling or physical iPhone is available here. The previous fork CI Android build was blocked before compilation by missing Expo authentication; current-head CI must be checked separately.
Device checks before marking ready