Repository navigation
fix(scanner): repair both scanner apps (null of 2 + camera not available) - #2905
Merged
Merged
Conversation
…outer Root cause (verified live via Playwright on DEV): - All contestant> bindings were relative (claimedCount) not absolute (/claimedCount). With no binding context on the contestant JSONModel, they resolved to null -> prizeCount rendered 'null of 2' while the model held 0; identity/stats blank; visible-state expressions wrong. Injecting the absolute path on the live control: 'null of 2' -> '0 of 2' -> '1 of 2'. - manifest declared the App view as BOTH rootView AND routing target 'main' (same id) -> 'adding element with duplicate id container-scanner---App' throw on router init. App has a single screen; dropped the router and its Component.js getRouter().initialize() call. Untouched by #2902 (badge-scanner v2 only covered the Vue island + backend).
Root cause (confirmed live on DEV): useBarcodeScanner gated isSupported on
'BarcodeDetector' in window. That API is Chromium/Android-only — absent on
iOS Safari AND desktop Edge/Chrome in this deployment — so every such browser
fell through to showManualInput ('Camera scanning not available') despite
having a working camera (getUserMedia present, secure context).
- isSupported now = getUserMedia available in a secure context
(extracted to camera-support.ts, unit-tested).
- Scan loop uses native BarcodeDetector when present, else decodes
getUserMedia frames with jsQR (new dep, ~15KB) over a canvas.
- Manual-paste path retained as the fallback for no-camera/insecure cases.
Tests: hugo-apps/src/scanner-vue/__tests__/camera-support.test.ts (8 pass).
Follow-up to #2902 (badge-scanner v2), which shipped the BarcodeDetector-only gate.
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.
Problem
Both scanner surfaces broke; #2902 (badge-scanner v2) only touched the Vue island + backend, leaving two separate defects.
1.
/scanner-ui/(UI5) — "null of 2" + dead scanRoot cause verified live on DEV via Playwright: every
contestant>binding inApp.view.xmlwas relative (claimedCount) not absolute (/claimedCount). With no binding context on thecontestantJSONModel they resolved tonull, soprizeCountrenderednull of 2while the model held0; identity/stats were blank and thevisibleexpressions mis-evaluated (card showed at idle). Injecting the absolute path on the live control:null of 2→0 of 2→1 of 2.Also removed a duplicate view instantiation: the manifest declared the
Appview as bothrootViewand routing targetmain(same id) →adding element with duplicate id container-scanner---Appon router init. Single-screen app; dropped the router.2.
/scanner-vue/— "Camera scanning not available"Root cause:
useBarcodeScannergatedisSupportedon'BarcodeDetector' in window, which is absent on iOS Safari and desktop Edge/Chrome in this deployment. Now gates ongetUserMediain a secure context and decodes frames with a jsQR fallback when the native detector is missing. Manual-paste retained for no-camera cases.Tests
hugo-apps/src/scanner-vue/__tests__/camera-support.test.ts— 8 pass (new gating logic)scanner-vueisland with jsQR bundledVerification still pending
Not yet confirmed on a deployed DEV build (UI5 view file + real-camera scan). Requires DEV deploy after merge, then re-check in browser.