Skip to content

Add stops: voice Eircodes, remove Pin, Import checks addresses before adding - #7

Merged
alisulmanpro merged 1 commit into
scanner-address-modefrom
add-stops-voice-import
Oct 27, 2026
Merged

alisulmanpro merged 1 commit into
scanner-address-modefrom
add-stops-voice-import

Conversation

@alisulmanpro

Copy link
Copy Markdown
Owner

Builds on #6 (scanner). Merge #6 first; this PR's base is scanner-address-mode, so it shows only its own changes.

Why

Testing on Android showed three problems in Add stops:

  1. Voice: saying the Eircode P12FY70 put P1 2 FY 70 in the field, which the map cannot use.
  2. Pin in the bottom row is not wanted.
  3. Import opened on a dark screen that did not match Add stops, and added every row as typed: nothing was checked, so a wrong street or an unknown address became a stop.

What changed

Voice

  • An Eircode said character by character is joined into one code: P1 2 FY 70, p 12 f y 7 0, P one two FY seven zero, double/triple → P12 FY70. Words around it are kept; a plain address is left as heard.
  • The voice panel uses the light colours on Add stops (its pale grey text was hard to read) and the hint says to spell the Eircode.

Pin

  • Removed from the Scan / Voice / Import row. "Drop pin" stays inside the "couldn't find this address" box, as the only way to place an address the map does not know.

Import (rebuilt)

  1. Choose file (light screen, same style as Add stops).
  2. Every address is checked on the map, with a progress bar (one batch request per 100 rows).
  3. Rows the map places at the door, on the street and number the file names, and not already a stop (or higher up in the file), are added straight away.
  4. Every other row waits on a card that says why: Not found, Different address ("The map found 26 Shanecastle Park… Park, not Grove"), Area only, Already added, Address missing, Not checked. The rider can edit the address and Check again (added at once if it is now fine), Use map address / Use the area / Add anyway, or Skip.
  5. If the server refuses the batch (e.g. a parcel ID already used), rows are retried one by one so only the refused ones wait.
  6. Summary at the top: added · need a fix · in the file. Done says how many were not added.

Backend

  • POST /api/v1/deliveries/geocode-check-batch — up to 300 addresses, nothing saved; each different address looked up once, 6 at a time; a provider failure is reported for that address only (error: true).
  • Rate limiter check(key, cost): a batch counts once against the per-IP limit and once per address against the rider's daily lookups (DB, Redis and in-memory stores).

Stop cards

  • No longer show the address twice when the map's text only differs by short forms (Church St, Co. Offaly vs Church Street, County Offaly).

Checks

  • Rider app: npm test 62 pass (new: voice, import checks, stop card text); tsc and expo lint clean.
  • Backend: ruff clean. New tests test_geocode_check_batch_checks_every_address_once_and_saves_nothing and test_a_batch_counts_as_many_hits_as_it_costs. Not run locally (the Prisma engine download is blocked in this environment) — CI runs them on this PR.
  • Not tested on a phone yet.

Notes

  • Each imported address costs one Google lookup (~$0.005; cached addresses are free). A 200-row file uses 200 of the rider's 600 daily lookups.
  • Customer name / phone from the file are still not saved on the stop (same as before); a follow-up if wanted.

Generated by Claude Code

… before adding

- Voice: an Eircode said character by character ("P1 2 FY 70") is joined into one code ("P12 FY70"); the voice
  panel uses the light theme's colours on Add stops (its grey text was unreadable there).
- Pin button removed from Add stops ("Drop pin" stays as a fix when an address is not found).
- Import rebuilt on the light theme: read the file, check every address on the map (new batch endpoint), add the
  rows placed at the door on the street the file names at once, and list the rest (not found, different street or
  number, area only, already added) for the rider to fix and check again, accept, or skip. A batch the server refuses
  is retried row by row so only the refused rows wait.
- Backend: POST /deliveries/geocode-check-batch (up to 300, each different address looked up once, 6 at a time; a
  failed lookup is reported per address). Rate limiters can count a request as several hits (cost), so a batch uses
  one hit of the per-IP limit and one daily lookup per address.
- Stop cards no longer show the address twice when the map's text only differs by short forms (St / Street).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FsWYamWsagMdQ7biMYdzSN
@alisulmanpro alisulmanpro self-assigned this Oct 27, 2026
@alisulmanpro
alisulmanpro merged commit 1749294 into scanner-address-mode Oct 27, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants