Skip to content

Release the panel cursor when the pointer leaves a row - #10077

Open
ludagoo wants to merge 2 commits into
omacom:quattrofrom
ludagoo:fix/panel-cursor-pointer-leave
Open

Release the panel cursor when the pointer leaves a row#10077
ludagoo wants to merge 2 commits into
omacom:quattrofrom
ludagoo:fix/panel-cursor-pointer-leave

Conversation

@ludagoo

@ludagoo ludagoo commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

What

Panel rows share one cursor (hasCursor / current on CursorSurface). Mouse enter moved that cursor; leave did not, so a hover (or a previous arrow-key selection) stayed painted after the pointer moved off the row.

This updates the kit contract:

  • Pointer enter still claims the shared cursor (one highlight).
  • Pointer leave releases it, including keyboard selection.
  • Button emits hovered from containsMouse so leave actually fires under the panel overlay.
  • Cursor.applyHover is the shared enter/leave policy.
  • First-party audio, Bluetooth, Wi-Fi, display, power, Dropbox, and Tailscale panels adopt it.

Third-party plugins that bind hasCursor themselves still need to call Cursor.applyHover on leave; the kit cannot set their cursorActive for them.

Test plan

  • bash test/shell.d/cursor-contract-test.sh
  • audio, bluetooth, network, power, monitor, dropbox, tailscale panel tests
  • Super+Ctrl+P / A / B / W / D: hover a non-selected row, move off it — highlight should clear, including any arrow-key selection. First arrow claims the cursor again.

Separate from the battery-percentage PR.

CursorSurface promised one highlight driven by mouse and keyboard, but
leave never cleared it: Button used an overlay HoverHandler, and every
panel claimed the cursor on enter only. Pointer enter still claims;
leave now releases, including a keyboard selection. First-party panels
go through Cursor.applyHover. Third-party plugins that use the kit
still need the same leave call.
A relative import of Cursor.js broke fixtures that copy a panel out of
tree, and CursorSurface.hovered collided with Tailscale's copy-menu
signal. Export a Cursor singleton from qs.Ui and drop the copy-menu
duplicate.
@ludagoo

ludagoo commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Human here. I know this touches a lot of things, but it’s an improvement for mouse UI, and I don’t think it hurts keyboard navigation at all. It felt weird that moving the pointer off a button didn’t unselect it. Now it does. I understand the idea of handing off from mouse to keyboard, but who actually switches from mouse to keyboard like that?

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