Skip to content

feat(ui): a person plans a walking route by clicking two points (T-110) - #99

Merged
CLYEH merged 4 commits into
developfrom
feat/ui-t110-human-route
Sep 2, 2026
Merged

CLYEH merged 4 commits into
developfrom
feat/ui-t110-human-route

Conversation

@CLYEH

@CLYEH CLYEH commented Sep 2, 2026

Copy link
Copy Markdown
Owner

What

T-110 — a person plans a walking route by clicking two points. Until now routing existed only as the agent's plan_route; the human had no way to do the same thing. Parity gap of the T-102 kind, the other way round.

  • A fourth pill, Route, beside Draw · Note · Share. Click a start (a draft pin appears), click an end, and the walk is drawn as a source: "user" line labelled with the service's own numbers — walking route · 3.8 km · 47 min (whole metres under 1 km, one decimal under 10 km, minutes rounded up; ≤ 72 chars, inside MAX_LABEL_CHARS).
  • The same planWalk the tool uses, through the same module-level 1 request/second throttle — not re-implemented. A new unit test finds the shared queue still busy after a hand-planned walk, so a private clock would fail the suite rather than the FOSSGIS policy (mutation-checked).
  • A refusal (NoRoute, throttle, timeout) shows the service's sentence in the hint and leaves the person in route mode: "… Click a new start, or Esc." Nothing is drawn. The same point clicked twice is refused without a request.
  • Escape cancels at any step, including mid-flight: a planning ticket invalidates the in-flight answer so a walk nobody is still asking for never lands.
  • A human route latches the FOSSGIS credit in the attribution exactly as an agent's does.
  • Human gesture, so no activity row; FX is the rose human effect via human-events.ts (now four gestures).
  • RoutePill carries an accessible name (its text label is hidden ≤ 600 px); the route hint is visible at the phone tier where the polygon hint is not.

Nothing under src/lib/** changes; tool outputs are byte-identical. remove_from_map keeps refusing human marks, so an agent cannot remove a human's route.

Docs: CONTRIBUTING.md's one approved external call now names both callers of the routing service and the shared throttle. The README half (lines saying "only plan_route calls an external service") ships in T-111 right behind this PR.

New data-testids: route-toggle, route-draft-pin, draw-hint[data-mode]; draw-mode grew a third value route. No dependency, lockfile, .github/** or src/lib/** changes.

How verified

  • Reviewer (adversarial, read-only): no blockers; six should-fix items, all addressed here or in T-111 (see commit fix(ui): the hand-planned walk proves it shares plan_route's second). Race/cancel/store hygiene mutation-verified by the reviewer: removing the planning guard or the ticket check each fails a named test.
  • pnpm check: 63 files / 1,461 tests, 0 skipped, no test.fail().
  • e2e/route-human-gesture.spec.ts (new, 7 tests) pins the contract: happy path with exactly one request to routing.openstreetmap.de carrying both click coordinates; agent plan_route untouched on the same page and remove_from_map refusing drawing:1 by id; NoRoute refusal text and unchanged map; same point twice → 0 requests; Escape after one click and Escape while planning; feature taps suppressed in route mode; phone tier hint visible and clear of the search box and tools. qa ran it --repeat-each=2: 14/14; full pnpm test:e2e on the branch before assembly: 143 passed, 4 skipped (opt-in live-basemap), 0 failed.
  • After assembly (rebase onto develop + qa spec): pnpm check green; route-human-gesture + note-human-gestures specs 19/19.
  • Live probe earlier in the task: one OSRM request per walk, label and credit as above.

Task: T-110

CLYEH and others added 4 commits September 2, 2026 13:50
Planning a walk was the last thing on this map only an agent could do. The
service, the rate limit and the refusal wording already existed in
`lib/map-tools/route.ts`; what was missing was a hand on the same lever, so a
person watching the map had to ask for a route rather than draw one.

Route is a fourth pill beside Draw. Two clicks make the walk: the first is
marked with a rose pin, the second asks the same FOSSGIS OSRM service the tool
asks and stores the answer as an ordinary `source: "user"` line, labelled with
the service's own figures ("walking route · 1.2 km · 16 min" — minutes always
rounded up, because rounding a duration down tells a person they have time they
do not have). From there it is a drawing like any other: `get_map_state` lists
it, `measure` sizes it, `remove_from_map` takes it off.

The rest is about the second in between. A walk the person cancelled while the
service was answering never lands (the pending call holds a ticket the next
gesture invalidates); a second click while "Planning the walk…" is up is
ignored rather than spending another of the one-per-second requests; two clicks
inside the same metre ask for an end instead of asking the service. A refusal
is the service's own sentence, in the hint the person was already reading —
never a toast and never an alert — and the map stays in route mode for the next
attempt. FOSSGIS' credit is latched by hand as well as by activity row, because
a hand gesture writes no row and the licence does not care who clicked.

Task: T-110
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GvdrJcKNZkfREdb7QGRYYH
…T-110 review)

Review follow-ups before merge:
- A test that plans a walk by hand and then finds the shared one-request-
  per-second queue still busy, so a re-implemented private clock would fail
  the suite rather than the FOSSGIS policy.
- `RoutePill` carries an accessible name; below 600px its text label is
  hidden and the button had none.
- `human-events.ts` header counts four gestures, not three.
- CONTRIBUTING.md's one approved external call now names both callers of the
  routing service and the shared throttle.

Task: T-110
Cover the Route pill end to end: two-click plan/draw with the human
"source: user" line, the FOSSGIS attribution and zero activity rows;
the agent's plan_route staying independently usable on the same page;
the service's verbatim NoRoute refusal and retry; the same-point guard;
Esc cancelling both mid-draft and mid-flight; a bundled feature tap
being suppressed and counted as the route's start instead; and the
phone-tier hint's exemption from the polygon hint's display:none.
@vercel

vercel Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
glassmap Building Building Preview Sep 2, 2026 5:53am UTC

@CLYEH
CLYEH merged commit cfdb9c3 into develop Sep 2, 2026
3 checks passed
@CLYEH
CLYEH deleted the feat/ui-t110-human-route branch September 2, 2026 05:58

This branch was successfully deployed

1 active deployment
Preview — 2f3de7b8 Deployed Sep 2, 2026 by vercel[bot]
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.

1 participant