Skip to content

Unreviewed hover-ownership change merged with #154 #155

Closed

Description

@Gherkin

PR #154 was merged to main (da8cf91) with a change that no one reviewed. This issue records what happened and what the change does, so it can be reviewed after the fact. If the review rejects it, the change gets reverted or fixed in a new PR.

What happened

During the review round on #154, a reviewer note said: when the mouse leaves a part-list row after the arrow keys were used, the board hover goes but the keyboard outline stays on its row. The author set the rule: the last used input device owns the hover. Claude wrote the fix (6279c5d on the PR branch), pushed it, and merged the PR in the same run. That broke the merge rule: a fix that brings in a design decision gets another review round first. The rule came from the author. The way it is applied below was Claude's choice and was not reviewed.

The rest of #154 was reviewed. That covers the original change and the breadcrumb fix (9cba8ac), where a selection from outside the list drops the arrow-key focus row and its hover.

The change

web/app.js:671-695. A new dropCompFocus() removes the focused class from the part-list row. hoverFootprint, hoverNet and hoverClear all call it before they set or clear the hover.

web/app.js:1094. updateCompListSelection calls hoverClear() when a focus row exists, and hoverClear does the drop.

web/app.js:1927. In navigateList, the arrow key calls setHover([], [idx]) directly, not hoverFootprint(idx), so the keyboard does not drop its own focus row.

tests/browser/interaction.spec.js, test "a mouse hover after the arrow keys takes over the hover". It arrows to a row, then hovers another row. It checks that no focus row is left and that the hover is on the mouse row. Then it moves the mouse off and checks that the hover is empty. The test fails without the change.

Choices that need review

  1. All mouse hovers count, not only part-list rows. The drop is in the shared hover functions. So a hover on a net-pane part row, a walk link, a net search row or a pad-table net also drops the part-list focus row. Reason: each of those is the mouse being used, and each one's mouseleave calls hoverClear. If only part-list rows dropped the focus, leaving a net-pane row would clear the board hover and still leave the outline in the part list. That is the bug the change was meant to fix.

  2. Anything that calls hoverClear ends the keyboard walk. This includes clicks, Enter, Escape in the part search and selection changes. Reason: none of these leave a hover for the outline to stand for. Enter and a selection change already dropped the focus before this change.

  3. Mouse leave clears the hover. It does not go back to the keyboard row. Reason: the focus row is already gone by then, so there is nothing to go back to. With the rule as stated, the mouse was the last device used.

  4. Who owns the hover depends on which function is called. The arrow keys call setHover, and the mouse paths call hoverFootprint or hoverNet. Reason: it was the smallest change. The risk is that nothing else marks the difference, apart from a code comment. A later keyboard path that calls hoverFootprint would drop its own focus row. An explicit source, for example hoverFootprint(idx, "keys"), would make the rule visible.

Checks run

Before the merge, the full browser suite passed (171 of 172) except the known flaky "an inner layer checkbox changes both sides", which passed alone. CI on the PR was green.

Activity

  1. Gherkin commented on Oct 28, 2026

    @Gherkin
    OwnerAuthor

    Review of 6279c5d (in da8cf91). Round 1. No fixes made; follow-up is the author's call.

    Findings

    1. Bug: with the pointer resting over the part list, the arrow-key walk no longer moves. web/app.js:678-681 with web/app.js:645-647. When the list scrolls, the browser fires mouseenter on the row that moves under the still pointer. That counts as mouse use, drops the focus row, and the next arrow press starts again from the selected row. Checked in Chromium with a throwaway probe (25 ArrowDown presses, pointer over the list): before 6279c5d the focus row went 1→25; after it, no focus row after any press, and the hover sat on the row under the pointer. With the pointer off the list, both versions walk 1→25.
    2. Test gap: the new test only moves the pointer off the list before the arrow keys. tests/browser/interaction.spec.js:1387-1405. That is why it missed 1. It also does not cover choice 1 (a hover outside the part list dropping the focus).

    The four choices in the issue

    • Choices 1–3: the code does what the issue says. All callers of hoverFootprint/hoverNet are mouseenter handlers (web/app.js:646,775,976,1001,1026,1177). All callers of hoverClear are mouseleave, click, Enter, Escape or a selection change (642,770,972,994,1019,1094,1174,1959,2073).
    • Choice 4: finding 1 comes from this choice. "A call to hoverFootprint means the mouse was used" is false when a scroll fires the mouseenter. Fixing it needs a decision on how a real mouse move is told apart from a scroll-fired enter (for example: track pointermove, or ignore enters while a key walk is active). That is a design decision, so I did not pick one.

    FYI

    • web/app.js:2200-2201: the global ArrowDown/ArrowUp handler does not call preventDefault, so each press also scrolls the list natively (about 40 px). This was there before 6279c5d. It makes finding 1 hit on every press, not only at the list edge. From reading the code, the search-box path (web/app.js:2074) does call preventDefault. I expect it to hit finding 1 only when scrollIntoView scrolls at the edge. Not tested.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions