docs(ui): F8-07 update renderer.md pick-mode lifecycle for per-copy overlay
Tests · UI / test (pull_request) Successful in 2m55s

Spec described the overlay as a single Graphics in the origin tile,
which was both the bug source and out of date after the F8-07 fix.
Updates the Open / Tick steps to describe the nine-copy replication
and the torus-shortest line endpoint contract.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ilia Denisov
2026-05-27 09:51:06 +02:00
parent 3d8aa91973
commit 175bf25794
+17 -6
View File
@@ -280,14 +280,25 @@ Lifecycle (`RendererHandle.setPickMode(opts)`):
1. **Open** (`opts !== null`): renderer marks `pickModeActive`, 1. **Open** (`opts !== null`): renderer marks `pickModeActive`,
sets `alpha = 0.3` on every primitive whose id is neither the sets `alpha = 0.3` on every primitive whose id is neither the
source nor in `reachableIds`, mounts an overlay `Graphics` in source nor in `reachableIds`, mounts one overlay `Graphics`
the origin tile, and subscribes to pointer-move + hover-change per torus copy (nine total — matching the primitive layer's
+ viewport `clicked` + document `keydown`. wrap-copy layout), and subscribes to pointer-move +
hover-change + viewport `clicked` + document `keydown`. In
no-wrap mode the eight non-origin copies are `visible = false`,
so their overlay children render nothing automatically.
2. **Tick** (every pointer-move and hover transition): the 2. **Tick** (every pointer-move and hover transition): the
renderer asks `computePickOverlay(opts, cursorWorld, renderer asks `computePickOverlay(opts, cursorWorld,
hoveredId, points, allIds)` (`src/map/pick-mode.ts`) for a hoveredId, points, allIds, world)` (`src/map/pick-mode.ts`)
draw spec — anchor ring + cursor line + optional hover for a draw spec — anchor ring + cursor line + optional hover
outline + dim set — and re-paints the overlay. outline + dim set — and re-paints every overlay graphic with
the same world-coord ops. Each copy's container already
applies its `(dx*W, dy*H)` transform, so the overlay shows in
whatever tile the user is panned over. In torus mode the
`world` argument switches the cursor-line endpoint to
`(sourceX + torusShortestDelta(...), sourceY + ...)` so the
line takes the short wrap path; anchor and hover-outline
coordinates stay canonical — the per-copy replication renders
them under the user's view in the matching tile.
3. **Resolve**: a click on a primitive whose id is in 3. **Resolve**: a click on a primitive whose id is in
`reachableIds` calls `opts.onPick(id)` and tears down. A click `reachableIds` calls `opts.onPick(id)` and tears down. A click
on empty space or a non-reachable primitive is a no-op on empty space or a non-reachable primitive is a no-op