Review follow-ups: PR #584 — feature: Gambit G in label QR codes + full GCN printed under the QR #822
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Non-blocking findings from the auto code review of PR #584 (feature: Gambit G in label QR codes + full GCN printed under the QR) — captured for batch cleanup rather than blocking the PR.
Commit
2c66e21· https://github.com/Gambit-Inc/gambit/pull/584SHOULD-FIX:
mobile/rork-recon-card-scanner/expo/components/GambitQrLayer.tsx:5(alsolib/niimbot/gambitQr.test.ts:19,label.test.ts:16): the app now importsqrcodedirectly, butpackage.jsononly declaresreact-native-qrcode-svg. Its own comment concedes the dependency is transitive. If the package manager nestsqrcodeunderreact-native-qrcode-svg, or the version drifts away from 1.5.x, the app bundle and themo_unitstep inverify.sh(which CI installs withnpm --legacy-peer-deps) fail to resolve it. Declareqrcodeexplicitly inpackage.jsonand pin it to the version the web app uses. I could not confirm the layout becausenode_modulesis not installed here.backend/app/services/zpl.py:233(2x1 label): the price field has no width bound. Atpf=52a price like$12,345.67is roughly 260 dots wide from x=6. That runs into the QR box, which starts at x=228 with the symbol at x≈243. The old layout had the QR further right. Cap the price with^FB, or step the font down by length in more than two tiers.backend/app/services/zpl.py:224(2x1 label): the card-number field at^FO6,155also has no width limit. A long number (up to 30 characters at 18 dots) can run past x=228 into the QR's lowest rows and the GCN caption, which sit at y≈159–184.backend/app/services/zpl.py:161,219,~297(all three builders): whengambit_qr_zplreturns""(payload too large for 2 dots per square), the label prints with no QR. The old short GCN text is also gone, because the branded branch has replaced it. Fall back to the legacy path when the result is empty, so the label still carries an identifier.backend/app/services/gambit_mark.py:96-104:zxingcpp.create_barcode(..., ec_level=...)andto_imageare called with no error handling. A failure other thanImportError(an API change or an encode error) raises straight through label generation instead of falling back to segno. The fallback only triggers on import failure. Catch exceptions around the zxing call and use segno in that case.NITS:
backend/app/services/zpl.py:216-218: inbuild_tcg_label, the existingnumber_fieldis computed before the branded early return, and the branded branch recomputes its ownnumber. This is duplicated dead work on that path. Reusenumber_fieldinstead.Filed from a Claude Code session