mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-10-05 19:28:25 +00:00
The camera already refuses to guess: two codes in frame draw their outlines and wait for a tap, because silently taking one of them is how you scan the poster next to the one you wanted. Both image paths -- the scanner's "Scan a picture" button and the "Scan QR code" share target -- called firstOrNull() instead, so a screenshot of a profile card that also carries a Lightning QR, or a photo of a noticeboard, resolved to whichever code the decoder reported first and gave no sign the others existed. A picture is not on screen to tap, so the codes are listed by what they are. Rows carrying a secret show their kind and nothing else, the same rule the outcome sheet follows. The labels are the chooser's own rather than ScanOutcomeSheet's: that sheet only ever appears for a payload nothing can open, so all its wording is an apology, while most codes offered here are perfectly openable. Decoded texts are de-duplicated first -- a photo of a screen often repeats a code across a reflection -- and one code still resolves with no extra tap. Verified on the emulator through both entry points: the chooser lists both codes, picking either resolves to exactly that code, and a single-code picture still goes straight through. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>