fix(ui): F8-07 cargo-route picker — torus-wrap overlay + thinner arrows #63

Merged
developer merged 2 commits from feature/issue-50-cargo-picker-torus into development 2026-05-27 08:08:10 +00:00
Owner

Closes #50.

Summary

  • Pick overlay (anchor / cursor line / hover outline) was rendered into the single origin torus copy, so any view of a wrap copy lost it. Now the overlay is replicated across all nine copies, matching how primitives and fog already render — the user sees the overlay in whatever tile they're panned over.
  • Cursor line endpoint now uses torusShortestDelta, so the line draws the wrap-short way (currently it took the long path across the canvas).
  • Cargo-route arrow strokes reduced: COL/CAP/MAT 2→0.6 wu, EMP 1→0.4 wu (≈3 / ≈2 screen px at typical zoom).

Repro from the issue (map 201×201, A1=(184,137), A2=(191,145), A3=(1.44,146))

  • Picker on A1/A2 — panning right across the seam no longer leaves A3 wrap copies unhighlighted.
  • Picker on A3 — anchor stays around the source in whichever wrap copy is visible (no more “его начало уходит куда-то далеко влево viewport”), both home planets are obviously selectable.
  • After picking, the resulting route arrow is now noticeably thinner.

Test plan

  • cd ui/frontend && npm test — 803 passed (16 in map-pick-mode including the new torus seam cases on both axes + the anchor / hover-outline coord guard).
  • cd ui/frontend && npm run check — clean.
  • cd ui/frontend && npm run build — clean.
  • ui-test.yaml on gitea (run #422) — success.
  • Manual browser verification by owner against the original repro on the dev environment after merge.

Doc sync

  • ui/docs/renderer.md Pick-mode lifecycle section updated to describe the per-copy overlay and the torus-shortest line endpoint contract.
Closes #50. ## Summary - Pick overlay (anchor / cursor line / hover outline) was rendered into the single origin torus copy, so any view of a wrap copy lost it. Now the overlay is replicated across all nine copies, matching how primitives and fog already render — the user sees the overlay in whatever tile they're panned over. - Cursor line endpoint now uses `torusShortestDelta`, so the line draws the wrap-short way (currently it took the long path across the canvas). - Cargo-route arrow strokes reduced: COL/CAP/MAT 2→0.6 wu, EMP 1→0.4 wu (≈3 / ≈2 screen px at typical zoom). ## Repro from the issue (map 201×201, A1=(184,137), A2=(191,145), A3=(1.44,146)) - Picker on A1/A2 — panning right across the seam no longer leaves A3 wrap copies unhighlighted. - Picker on A3 — anchor stays around the source in whichever wrap copy is visible (no more “его начало уходит куда-то далеко влево viewport”), both home planets are obviously selectable. - After picking, the resulting route arrow is now noticeably thinner. ## Test plan - [x] `cd ui/frontend && npm test` — 803 passed (16 in `map-pick-mode` including the new torus seam cases on both axes + the anchor / hover-outline coord guard). - [x] `cd ui/frontend && npm run check` — clean. - [x] `cd ui/frontend && npm run build` — clean. - [x] `ui-test.yaml` on gitea (run #422) — success. - [ ] Manual browser verification by owner against the original repro on the dev environment after merge. ## Doc sync - `ui/docs/renderer.md` Pick-mode lifecycle section updated to describe the per-copy overlay and the torus-shortest line endpoint contract.
developer added 2 commits 2026-05-27 07:54:25 +00:00
Pick overlay (anchor ring, cursor line, hover outline) was drawn into a
single Pixi container — copies[ORIGIN_COPY_INDEX] — so any view of a wrap
copy lost it: picker from A1/A2 to the right (across the seam) showed no
hover highlight on A3's wrap copy, and the picker on A3 (x≈1.44, near the
left edge) put its anchor far left of the viewport. Fix replicates the
overlay across all nine torus copies (matching how primitives and fog
already render) and switches the cursor-line endpoint to torus-shortest
geometry via torusShortestDelta. Anchor and hover-outline coordinates
stay canonical; the per-copy replication renders them under the user's
view in whatever tile is on screen.

Also reduces cargo-route arrow strokes: COL/CAP/MAT 2->0.6 wu and EMP
1->0.4 wu (~3 / ~2 screen px at typical zoom) per the owner's request.

Tests cover the new torus path: source near the left edge with cursor on
the wrap copy across the seam (x axis), source near the top edge with
cursor across the y seam, and a guard that anchor / hover-outline coords
stay canonical regardless of the world argument.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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>
owner approved these changes 2026-05-27 08:07:20 +00:00
developer merged commit 8e8b34d112 into development 2026-05-27 08:08:10 +00:00
developer deleted branch feature/issue-50-cargo-picker-torus 2026-05-27 08:08:11 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: developer/galaxy-game#63