Repository navigation
feat(ui): a person plans a walking route by clicking two points (T-110) - #99
Merged
Merged
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Sep 2, 2026
This branch was successfully deployed
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.
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.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, insideMAX_LABEL_CHARS).planWalkthe 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).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.Escapecancels at any step, including mid-flight: a planning ticket invalidates the in-flight answer so a walk nobody is still asking for never lands.human-events.ts(now four gestures).RoutePillcarries 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_mapkeeps 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_routecalls an external service") ships in T-111 right behind this PR.New
data-testids:route-toggle,route-draft-pin,draw-hint[data-mode];draw-modegrew a third valueroute. No dependency, lockfile,.github/**orsrc/lib/**changes.How verified
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, notest.fail().e2e/route-human-gesture.spec.ts(new, 7 tests) pins the contract: happy path with exactly one request torouting.openstreetmap.decarrying both click coordinates; agentplan_routeuntouched on the same page andremove_from_maprefusingdrawing:1by id;NoRouterefusal text and unchanged map; same point twice → 0 requests;Escapeafter one click andEscapewhile 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; fullpnpm test:e2eon the branch before assembly: 143 passed, 4 skipped (opt-in live-basemap), 0 failed.pnpm checkgreen;route-human-gesture+note-human-gesturesspecs 19/19.Task: T-110