v0.15.0 — ISS-002 hovering a plane or package in the side panels highlights it on the map #15

Merged
kamilkrzywda merged 4 commits from feat/map-hover-highlight into master 2026-09-19 12:57:45 +02:00
Owner

What (issue #2)

When hovering over any plane, route or airport on any of left or right panels it should be visualized on the map.

  • New shared HoverTarget type (components/hoverTypes.ts): {kind:'plane', id} | {kind:'package', originIcao, destIcao}
  • Shell (app/page.tsx) owns useState<HoverTarget|null> and prop-drills it (established pattern — no contexts in this codebase)
  • Left pane: fleet rows set plane hover on mouseenter/leave
  • Right pane: open-package rows → package hover; "On board" blocks → plane hover (handlers on the block, not cargo rows — React enter/leave don't fire when moving to a child, so this covers the whole block without flicker)
  • Map (components/Map.tsx): three top-most highlight layers added inside idempotent ensureLayers() so they survive style switches:
    • planes-highlight (circle r=10, #38bdf8 fill + white stroke), filter by plane id
    • routes-highlight (line w=6, #ef4444), filter by route planeId — highlights the leg of a flying hovered plane
    • airports-highlight (circle r=8 ring, #facc15 stroke), filter matching both endpoint ICAOs of a hovered package
    • Consumption mirrors the existing state pattern: hoveredRef + [hovered] effect calling map.setFilter; empty-string sentinel matches nothing; ensureLayers re-applies the current filter at its end

E2E (new e2e/hover.spec.ts, 3 tests)

  1. hovering a fleet row highlights the plane on the map
  2. hovering an open package highlights its endpoint airports (hook-created EDDF→LEMD)
  3. hovering an on-board block of a flying plane highlights its route (sim paused mid-flight per established pattern, resumed + fly-home in cleanup)

Each asserts the highlight appears via queryRenderedFeatures and clears on mouseleave.

Version

  • package.json → 0.15.0
  • CHANGELOG.md — v0.15.0 entry

Checks (local)

  • tsc --noEmit clean; unit 238/238 green (no lib changes); playwright test --list = 33 tests in 9 files
  • e2e not run locally by design — CI verifies against the isolated dind stack
## What (issue #2) *When hovering over any plane, route or airport on any of left or right panels it should be visualized on the map.* - New shared `HoverTarget` type (`components/hoverTypes.ts`): `{kind:'plane', id}` | `{kind:'package', originIcao, destIcao}` - Shell (`app/page.tsx`) owns `useState<HoverTarget|null>` and prop-drills it (established pattern — no contexts in this codebase) - **Left pane**: fleet rows set plane hover on mouseenter/leave - **Right pane**: open-package rows → package hover; "On board" blocks → plane hover (handlers on the block, not cargo rows — React enter/leave don't fire when moving to a child, so this covers the whole block without flicker) - **Map** (`components/Map.tsx`): three top-most highlight layers added inside idempotent `ensureLayers()` so they survive style switches: - `planes-highlight` (circle r=10, #38bdf8 fill + white stroke), filter by plane `id` - `routes-highlight` (line w=6, #ef4444), filter by route `planeId` — highlights the leg of a flying hovered plane - `airports-highlight` (circle r=8 ring, #facc15 stroke), filter matching both endpoint ICAOs of a hovered package - Consumption mirrors the existing state pattern: `hoveredRef` + `[hovered]` effect calling `map.setFilter`; empty-string sentinel matches nothing; `ensureLayers` re-applies the current filter at its end ## E2E (new `e2e/hover.spec.ts`, 3 tests) 1. hovering a fleet row highlights the plane on the map 2. hovering an open package highlights its endpoint airports (hook-created EDDF→LEMD) 3. hovering an on-board block of a flying plane highlights its route (sim paused mid-flight per established pattern, resumed + fly-home in cleanup) Each asserts the highlight appears via `queryRenderedFeatures` and clears on mouseleave. ## Version - `package.json` → **0.15.0** - `CHANGELOG.md` — v0.15.0 entry ## Checks (local) - `tsc --noEmit` clean; unit 238/238 green (no lib changes); `playwright test --list` = 33 tests in 9 files - e2e not run locally by design — CI verifies against the isolated dind stack
kamilkrzywda added 1 commit 2026-09-19 11:42:14 +02:00
kamilkrzywda added 1 commit 2026-09-19 12:06:50 +02:00
kamilkrzywda added 1 commit 2026-09-19 12:35:38 +02:00
kamilkrzywda added 1 commit 2026-09-19 12:51:19 +02:00
kamilkrzywda merged commit e6d7e03934 into master 2026-09-19 12:57:45 +02:00
kamilkrzywda deleted branch feat/map-hover-highlight 2026-09-19 12:57:45 +02:00
Sign in to join this conversation.