Skip to content

feat(expo): full-screen scan UX, debug ROI preview, and encode save/print actions#33

Merged
TriForMine merged 1 commit into
mainfrom
feat/expo-scan-overlay-debug-fixes
May 29, 2026
Merged

feat(expo): full-screen scan UX, debug ROI preview, and encode save/print actions#33
TriForMine merged 1 commit into
mainfrom
feat/expo-scan-overlay-debug-fixes

Conversation

@TriForMine

@TriForMine TriForMine commented May 29, 2026

Copy link
Copy Markdown
Owner

This PR improves the Expo mobile UX for scanning and encoding, adds practical debugging tools for scan failures, and hardens fallback behavior when native modules are unavailable.

Highlights

  • Full-screen scanner experience

    • Removed scroll-heavy layout for scan screen.
    • Camera now occupies the full screen area with overlay controls.
    • Added top GlyphNet label anchored with safe-area positioning.
  • Better scan guidance + targeting

    • Replaced page-sized guide with a ribbon-like GlyphNet frame.
    • Scan request now includes normalized ROI (roiX/roiY/roiW/roiH) so decode focuses on intended area.
    • Added torch toggle in overlay for low-light capture.
  • Scan result UX improvements

    • Result shown in modal popup (instead of inline long block).
    • Clear success/fail state with payload/error cards.
    • Added Scan Again and Close actions.
    • Added light vibration feedback for scan outcomes.
    • Added timing metrics:
      • capture latency (captureMs)
      • scan latency (scanMs)
  • In-app debug mode for scan

    • Added Debug toggle in scanner overlay.
    • Stores and displays last captured frame in result modal.
    • Draws ROI overlay on debug capture preview.
    • Keeps raw JSON output visible for diagnostics.
  • Encode screen quality-of-life

    • Switched SVG preview rendering to react-native-svg (SvgXml) for Android reliability.
    • Added Save SVG and Print actions.
    • Sharing is now lazy-loaded dynamically (import("expo-sharing")) to avoid runtime/bundle breakage in unsupported contexts (e.g. Expo Go variants).
  • Native/JNI robustness

    • JNI scan now supports imageBase64 direct decode path.
    • JNI applies normalized ROI crop before decode.
    • JNI SVG encode output injects explicit white background for consistent visibility across themes.
  • Runtime fallback safety

    • Scanner adapter now safely falls back to mock adapter when native GlyphNetScanner module is unavailable.

Config / Dependencies

  • Added Android keyboard behavior for overlay UX:
    • android.softwareKeyboardLayoutMode = "pan"
  • Installed Expo modules used by new features:
    • expo-print
    • expo-sharing (loaded lazily at runtime)
    • react-native-svg

Why

  • Reduce real-world scan failures caused by off-target framing and background noise.
  • Improve mobile ergonomics and speed during scan attempts.
  • Make debug iteration possible directly on device without desktop tooling.
  • Keep app usable even when native scanner module is absent in a given runtime/build.

Copilot AI review requested due to automatic review settings May 29, 2026 06:29
@coderabbitai

coderabbitai Bot commented May 29, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@TriForMine, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 17 minutes and 41 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a39bd30c-204b-472a-abab-d0bc358fab4a

📥 Commits

Reviewing files that changed from the base of the PR and between e5d0717 and e1525c0.

⛔ Files ignored due to path filters (1)
  • apps/expo-glyphnet/bun.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • apps/expo-glyphnet/app.json
  • apps/expo-glyphnet/package.json
  • apps/expo-glyphnet/src/features/encode/EncodePanel.tsx
  • apps/expo-glyphnet/src/features/scan/ScanPanel.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/expo-scan-overlay-debug-fixes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@TriForMine TriForMine changed the title feat(expo): full-screen scan UX, debug ROI preview, and encode feat(expo): full-screen scan UX, debug ROI preview, and encode save/print actions May 29, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@github-actions

Copy link
Copy Markdown

Burst reliability (loss sweep)

PR gate status: PASS

  • Gating rows: 4 pass / 0 fail
  • Non-gating rows: none
Drop rate Gating PR success Base success Delta PR median frames Base median frames
10% Yes 100.0% 100.0% 0.0pp 14 14
20% Yes 100.0% 100.0% 0.0pp 16 16
30% Yes 100.0% 100.0% 0.0pp 19 19
40% Yes 50.0% 50.0% 0.0pp 18 18

@TriForMine TriForMine merged commit c264fa7 into main May 29, 2026
10 of 11 checks passed
@TriForMine TriForMine deleted the feat/expo-scan-overlay-debug-fixes branch May 29, 2026 06:32
@github-actions

Copy link
Copy Markdown

Scanner perf (ribbon + matrix fixtures)

PR gate status: PASS

  • Ribbon budget: 25.000 ms (allowed 75.000 ms)
  • Matrix budget: 20.000 ms (allowed 60.000 ms)
  • Tolerance: 200.0%
  • Ribbon gating benches: 3 pass / 0 fail
  • Matrix gating benches: 1 pass / 0 fail
Benchmark Gating PR median (ms) Base median (ms) Delta (ms) Delta %
scan_generated_ribbon_canvas_small (RibbonPrint) Yes 47.818 47.835 -0.017 -0.04%
scan_generated_ribbon_canvas_medium (RibbonPrint) Yes 7.138 7.149 -0.011 -0.15%
scan_generated_ribbon_canvas_large (RibbonPrint) Yes 25.723 25.743 -0.020 -0.08%
scan_generated_matrix_roi (MatrixCompat) Yes 3.027 3.032 -0.004 -0.15%
scan_generated_matrix_canvas (MatrixCompat) No 183.421 185.089 -1.668 -0.90%
scan_real_debugger_screenshot (RibbonPrint) No 283.185 282.308 0.877 0.31%

Matrix subset

Benchmark Gating PR median (ms) Base median (ms) Delta (ms) Delta %
scan_generated_matrix_roi (MatrixCompat) Yes 3.027 3.032 -0.004 -0.15%
scan_generated_matrix_canvas (MatrixCompat) No 183.421 185.089 -1.668 -0.90%

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.

2 participants