Skip to content
This repository was archived by the owner on Oct 17, 2026. It is now read-only.

feat(panel): select on hover and drag results out - #6

Merged
oddurs merged 1 commit into
mainfrom
feat/pointer
Oct 16, 2026
Merged

oddurs merged 1 commit into
mainfrom
feat/pointer

Conversation

@oddurs

@oddurs oddurs commented Oct 16, 2026

Copy link
Copy Markdown
Owner

Problem

The pointer could only click. Moving over a row didn't select it, as it does in every menu and in Spotlight, and there was no way to hand a result to another app.

Approach

  • Hover selects, gated on movement. CommandPanel.sendEvent sees .mouseMoved before the rows' hover tracking and sets SearchModel.pointerMoved. Typing, arrow keys, and opening the panel clear it. A row's onContinuousHover takes the selection only while it's set, so results that shift under a still pointer never move the selection and Return still opens the top result.
  • Drag out. Rows backed by a file (apps, files, folders) provide an NSURL through onDrag, so they drop into the Dock, Finder, or a document like a Finder item.

Verified live

With real events (CGEvent), pointer parked over row 4 before opening:

  1. typed "s", then "a": top result stayed selected;
  2. moved the pointer a few points: row 4 selected;
  3. pressed ↓: row 5 selected.

Dragged the Safari row into the search field: it inserted file:///Applications/Safari.app.

Look at sceptically

  • The movement gate lives in the app target, so there's no unit test; it's covered only by the live run above.
  • I didn't drop onto Finder or the Desktop in testing, because a file drag there moves the real file. The provider is a plain file URL, the same as Finder's own drags.
  • A drag starting inside a non-activating panel doesn't close it; it closes on the next click elsewhere.

Checklist

  • scripts/task check passes locally
  • UI behaviour checked live with real pointer events

Pointing at a row did nothing and there was no way to hand a result to another app. Hover now selects, but only after the pointer has actually moved: rows change under a still pointer while typing, and taking the selection then would make Return open whatever landed under it.
@oddurs
oddurs merged commit 6ce152d into main Oct 16, 2026
2 checks passed
@oddurs
oddurs deleted the feat/pointer branch October 16, 2026 23:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant