Repository navigation
Beta: read barcodes from a photo or screenshot - #14
Merged
Merged
Conversation
Desktops rarely have a camera, so the Scan tab and a recipe's Scan ingredient dialog get a "Barcode from Image" button. On a computer a photo can also be dropped onto Log Food or a screenshot pasted. The image is decoded with the native BarcodeDetector where the browser has one, else ZXing at a few sizes and angles; slower tryHarder reads must agree across two passes, which stops blurry codes being misread as another product. A barcode number typed into Search (valid GTIN check digit) is looked up directly and shown first. With no camera, the Scan tab hides the empty viewfinder and points to the image option instead of a permissions error. Adds a smoke test with a photo fixture; CI installs @zxing/library so the test can serve it locally. Version 2026-10-07.3, docs updated. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017wFUsVAFFzEVnLmxe6TiLk
Brings master up to date on beta along with the feature. The changelog keeps the Beta entry above the v2026-10-07.3 release. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017wFUsVAFFzEVnLmxe6TiLk
The new smoke test timed out on all three WebKit devices in CI while passing on Chromium. WebKit can expose BarcodeDetector without a working backend, and detect() never settling would leave the image scan stuck. Only use the native detector for formats it reports, and give up on it after 3 seconds and fall back to ZXing. The test now reports the scan status if the sheet doesn't open. Version 2026-10-07.4. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017wFUsVAFFzEVnLmxe6TiLk
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017wFUsVAFFzEVnLmxe6TiLk
4 of 5 tasks
With the status now reported, the WebKit failure reads "Couldn't open that image": Playwright's WebKit routes blob: URLs (it only skips data: and about:), and a blob URL has no hostname, so the block-everything- external route aborted the photo's object URL. Only http(s) requests are checked now. Real browsers were never affected. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017wFUsVAFFzEVnLmxe6TiLk
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017wFUsVAFFzEVnLmxe6TiLk
…a branch Conflicts: the Scan tab's new camera/label halves (Barcode from Image stays in the camera half), the version (2026-10-07.4 from the feature branch), the docs summary (now mentions both changes) and the changelog. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017wFUsVAFFzEVnLmxe6TiLk
Log Food opens on Search on desktop once the desktop pages land (#11/#12), which hides the Barcode from Image button. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017wFUsVAFFzEVnLmxe6TiLk
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017wFUsVAFFzEVnLmxe6TiLk
5 tasks done
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.
Requested by Oliver · project thread
Checks
index.htmlorsw.jswithout understanding the PWA cache implicationsindex.htmlhas been bumped (comes from master as 2026-10-07.4; the beta publish stamps its own-betaversion)manifest.jsonis still valid JSON (unchanged)What this changes
Before: beta.macroslog.co.uk could only scan barcodes with a live camera.
After: merging this publishes the barcode-from-image feature from #13 to beta so it can be tried before master: Barcode from Image on the Scan tab and in a recipe's Scan ingredient dialog, drag a photo onto Log Food or paste a screenshot on a computer, and type a barcode number into Search.
How:
claude/beta-barcode-imageisbetawith the #13 branch merged in, which also brings beta up to date with master (#1 to #6). It is now up to date with beta after #12 (desktop pages) merged: the button and hint sit in the camera half of #12's split Scan tab, the docs summary mentions both features, and the changelog keeps the Beta entry above v2026-10-07.4. The smoke test now opens the Scan tab first, because desktop Log Food opens on Search. Beta's themes and sync are untouched.Testing done
On this merged tree: the 29 end-to-end checks from #13 and the smoke suite pass (Chromium locally, Chromium and WebKit in CI).
🤖 Generated with Claude Code
https://claude.ai/code/session_017wFUsVAFFzEVnLmxe6TiLk