Skip to content

fix(explorer): selection wins over hover, no hover while moving, relationship names on lit links - #73

Open
CMaintz wants to merge 3 commits into
mainfrom
fix/selection-wins-over-hover
Open

CMaintz wants to merge 3 commits into
mainfrom
fix/selection-wins-over-hover

Conversation

@CMaintz

@CMaintz CMaintz commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

Owner-approved fix for the bug found while recording the README GIF, plus the owner's relationship-names addition. Decision A97a (an amendment under A97; also amends A86/A93).

What changes

  • Selection wins (2D + 3D). While a term is selected (or a route is shown), its highlight stays: its links stay lit and everything else stays dimmed. Hovering another term only brings that term forward. In 3D it is no longer receded. In 2D, .pv is added to the term and to its link to the selection. With nothing selected, hover behaves as before.
  • No hover while moving. A motion gate ignores hover (no restyle, no hover card) while the map moves, and keeps ignoring it until the pointer itself moves after motion has stopped.
    • 3D: any camera change between frames counts as motion. That covers auto-rotate, the fly-in, focus glides, orbit/pan/wheel and WASD.
    • 2D: viewport changes count as motion (quiet after edgeLabels.quietMs), as do layout moves.
    • Both maps track the term under the pointer separately from the hover they show, because neither library re-reports a term it already considers hovered.
  • Relationship names on lit links. Each lit link of the selected term shows its relationship name, read from that term's side (panel edgeLabels/edgeInverse, EN + DA, e.g. "requires", "mitigated by").
    • The text is small and uses the map's ink colour with a halo.
    • 2D: runs along the line and stays upright (autorotate), and keeps a constant screen size when zoomed out.
    • 3D: a billboarded sprite of constant screen size, just above the curve's midpoint.
    • Where names would overlap, the heavier link keeps its name. 3D re-checks this every frame. Hovering a link shows its name.
    • Hovering a term (with nothing selected) shows names only when it has at most 12 lit links.
  • Pure logic lives in app/src/lib/explorer-focus.ts (effectiveFocus, createMotionGate, relationLabel, cullBoxes, rotatedSize, labelPov) and is unit-tested in explorer-focus.test.ts.

Headless check

Headless Edge over CDP, 1440x900, dev server, with a temporary window.__xp hook that is not committed.

  • 3D: Phishing selected, auto-rotate on, pointer resting on a term near the middle for 10 s, sampled every 500 ms. In all 20 samples, all 16 of Phishing's links were lit, no other link was lit and Phishing was not faded; 7 of the 16 names were placed.
    • Same run against main's map code: the selection was lost in 2 of 20 samples (0/16 lit, 7 other links lit).
  • 3D after stopping: auto-rotate off, then the pointer moved onto a receded term. It came forward and the selection stayed intact.
  • 2D: pointer on a neighbour of the selected Phishing. All 16 focus links and 15 neighbours stayed lit and 11 names were shown.
    • On main the same hover faded 15 focus links and dimmed 10 neighbours.

mise run fix && mise run gate exits 0. No rules were weakened.

This branch has not been deployed

No deployments
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