Skip to content

fix: improve barcode scanner compatibility#3

Merged
lexmarcos merged 4 commits into
mainfrom
indexdb
May 21, 2026
Merged

fix: improve barcode scanner compatibility#3
lexmarcos merged 4 commits into
mainfrom
indexdb

Conversation

@lexmarcos
Copy link
Copy Markdown
Owner

No description provided.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0002f66f0f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +27 to +40
export const barcodeScannerFormats: BarcodeScannerFormatList = [
"codabar",
"code_128",
"code_39",
"code_93",
"databar",
"databar_expanded",
"databar_limited",
"ean_13",
"ean_8",
"itf",
"upc_a",
"upc_e",
];
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Restore QR support in shared scanner formats

The new shared barcodeScannerFormats list no longer includes "qr_code", but every replaced call site previously passed "qr_code" explicitly. This changes runtime behavior across PDV, transfer validation, and modal scanners: QR labels that worked before this commit now never trigger onScan. If operators use QR-encoded product/transfer labels, scanning is a hard regression rather than a compatibility improvement.

Useful? React with 👍 / 👎.

Comment thread components/product/barcode-scanner.tsx Outdated
Comment on lines +101 to +105
const timeoutId = window.setTimeout(() => {
if (hasDetectedSinceCameraChange.current) return;

selectNextCameraConfiguration();
}, BARCODE_SCANNER_CAMERA_RETRY_DELAY_MS);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid unconditional camera fallback after fixed timeout

The scanner now switches configuration after 5.5s whenever no code has been detected, even if there was no camera error. In normal flows (permission prompt delay, slow alignment, dim lighting), this forces a remount and downgrades to compatible constraints prematurely, which can repeatedly disrupt acquisition before the first successful scan. The fallback should be tied to concrete failure signals, not elapsed time alone.

Useful? React with 👍 / 👎.

@lexmarcos lexmarcos merged commit c777cb7 into main May 21, 2026
1 check passed
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.

1 participant