Repository navigation
Scanner: Address mode + street-type/house-number checks (Android first) - #6
Merged
Merged
Conversation
…ions
- Scanner has an Eircode | Address switch. Address mode takes one photo, boxes every line of text, and the rider
taps the lines of the address (one line from a page of addresses, or 2-3 lines of a label). An Eircode among the
chosen lines goes the Eircode way. No new native package: vision-camera photo output, ocr-plus PhotoRecognizer
and expo-image-manipulator are already in the build.
- lib/scan/address.ts: spacing fixes ("26shanecastle"), OCR slips in short forms ("C1" -> "Cl"), Irish street
types and short forms in one table, St/Dr as Saint/Doctor after the house number, house number parsing.
- Add stops: short forms are written out for the map search only (the field keeps the rider's text); suggestions
on a different street type or house number go last and say so ("Park, not Grove"); Add no longer saves a map
match on a different street type or number without asking.
- Tests: tests/address.test.ts, tests/photoLines.test.ts (the client's four Shanecastle streets included).
- docs/scanner-test.md: the phone test sheet.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FsWYamWsagMdQ7biMYdzSN
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.
Why
Client feedback (via Noman): with no Eircode on the label, the app ends up on the wrong street — "26 Shanecastle Grove" becomes "26 Shanecastle Park". Dr / Cl / Cre / Grove change the whole location. On a page with several addresses the rider must be able to pick the one to add.
Root cause: the scanner only ever read Eircodes. Typed or pasted addresses went straight to Google Autocomplete, which picks the most likely street when the type is missing or unknown ("Cre"), and Add saved the map's match even when it was on a different street.
What changed
1. Scanner: Eircode | Address switch
2. Address text (
lib/scan/address.ts)26shanecastle→26 shanecastle,dublin22→dublin 22(Eircodes,26A,1stuntouched).C1/CI→Cl,5t→St.St/Drright after the house number = Saint / Doctor ("26 St Mary's Rd"), otherwise Street / Drive ("Main St").3. Add stops
Native / release
No new native package: vision-camera photo output, ocr-plus
PhotoRecognizerand expo-image-manipulator are already in the build. This is JS-only and can go out over the air once the build that includes expo-updates is in the stores.Checks
npm test: 51 pass (15 new, incl. the client's four Shanecastle streets).npx tsc --noEmit: clean.npx expo lint: clean.rider-app/docs/scanner-test.md(page test + one-by-one; handwritten, printed, on a screen). Android first; iPhone later.Not in this PR
Generated by Claude Code