← Back to Pull requests

MIN-6670: iOS reports every QR code in view with its corners #50

Open
unknown opened this pull request with 255 lines diff across 3 files
View on GitHub
unknown unknown commented on Oct 23, 2026 11:08 UTC
Author

Native half of MIN-6670: the app now outlines QR codes in the camera and acts only on the one held still, like retail barcodes (app PR linked below once open).

What was wrong


On iOS the hardware AVCaptureMetadataOutput reader sent a QR code to Dart only as its bare stringValue (the MIN-3077 contract), so the app had no geometry to outline a QR with and, with several in view, could only act on whichever string came first.

What changed


  • SingleCameraPreview.m: each metadata callback's QR codes also go out, with corners normalised to the preview layer (same barcodePayloads path as retail barcodes, format qr), under a new qrCodes key of the map event. Both barcodes and qrCodes are present only while their kind is in view, plus one empty list on the callback that loses them (new _qrCodesVisible flag, mirroring _barcodesVisible).

  • The plain QR string event is unchanged, so listenQrCodes() (the app's QR field scanner) sees exactly what it did before.

  • camerawesome_plugin.dart: new listenQrCodeOutlines() (Stream<List<NativeBarcode>> of the qrCodes key). listenBarcodes() now only emits for events that carry barcodes, so a QR-only event is not turned into an empty barcode list. Both go through the new NativeBarcode.listFromEvent(event, key).
  • Tests


  • test/native_barcode_test.dart (new): string events carry no geometry, an event splits into barcodes/qrCodes by key, QR-only events aren't barcode events, empty lists pass through and malformed entries are skipped. flutter test test/native_barcode_test.dart: 4/4 pass.

  • flutter analyze lib/camerawesome_plugin.dart test/native_barcode_test.dart: only the 2 pre-existing unawaited_return_in_try_block warnings (lines 636/655, untouched).

  • Native: not compiled or run here (no device or simulator build). It needs a check on an iPhone/iPad with the app PR.
  • 🤖 Generated with Claude Code

    https://claude.ai/code/session_01ULTHELCnQYErX2Coboy92N

    Diff: 255 lines (+191 / -64) across 3 files Reviewer: claude[bot] Review duration: 1m
    All Vouch review confidence checks passed
    Residual risk 0.32 = Change Risk (0.39) × (1 − Review Confidence (0.18)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 255 lines diff across 3 files
    0.39
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 20% · Reviewer familiarity: 35%
    18%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.332
    Real PR Conversation Timeline
    1 comments
    "Review active on #50"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 18.1% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 39.1% (MEDIUM) · Higher = larger blast radius
    39.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 18.1% · Lower = rushed or shallow review
    18.1%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 32% · Safe to merge
    32%