Skip to content

W-431: make autocomplete picker rows mouse-clickable#146

Merged
wr merged 1 commit into
mainfrom
wells/w-431-picker-mouse-clicks
Jun 25, 2026
Merged

W-431: make autocomplete picker rows mouse-clickable#146
wr merged 1 commit into
mainfrom
wells/w-431-picker-mouse-clicks

Conversation

@wr

@wr wr commented Jun 24, 2026

Copy link
Copy Markdown
Owner

What

The vertical autocomplete list rows couldn't be clicked — only keyboard worked, and there was no hover highlight. Root cause: PickerRow (the typed-query list) had no .onTapGesture or .onHover at all. Only the compact :? pill and the expanded browser grid had them.

(Not a glass / non-key-panel hit-testing issue — the browser grid clicks fine through the same non-key panel. The list rows were simply never wired.)

Fix

  • Add .contentShape(Rectangle()) + .onTapGesture + .onHover to PickerRow, wired to a new viewModel.onPickRow.
  • onPickRow mirrors the keyboard Return path: set the selected index, then insert the selected row (.fromPicker reads topResult), or grow into the grid for the trailing Browse row. Hover sets the selection so the highlight tracks the mouse.
  • Engine caches the live search scope (captureScope) so a click can rebuild the same insert the keyboard path gets from the state-machine action.

Test plan

  • Verified in the dev app: :fire → hover highlights, click inserts, Browse row expands; :? pill still works.
  • Full unit suite green.

Refs W-431

The vertical shortcode list (PickerRow) had no tap or hover handlers — only
the compact `:?` pill and the expanded browser grid did — so list rows
responded to keyboard only. Add `.onTapGesture` + `.onHover` to PickerRow,
wired to a new `viewModel.onPickRow` that mirrors the keyboard Return path:
set the selected index, then insert the selected row (`.fromPicker` reads
`topResult`), or grow into the grid for the trailing Browse row. Hover sets
the selection so the highlight tracks the mouse, matching the macOS picker.

Engine caches the live search scope (`captureScope`) so the click can rebuild
the same insert the keyboard path gets from the state-machine action.

Refs: W-431
@linear-code

linear-code Bot commented Jun 24, 2026

Copy link
Copy Markdown

W-431

@wr-claude-reviewer wr-claude-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. The three-part approach (cache captureScope in updateResults, guard on list-mode-only in onPickRow, use the existing captureExcluded computed property rather than raw captureIsExcluded) is exactly right and correctly mirrors the keyboard Return path. A few notes:

  • .contentShape(Rectangle()) is necessary here since the row background is conditional (clear when unselected), and it's correctly placed before the gesture modifiers.
  • onHover setting selectedIndex directly — rather than going through onPickRow — is the right split: hover just tracks, tap commits.
  • closeLen: 0 in the tap path correctly matches .fromPicker semantics (no closing colon in the focused app at click time).
  • captureExcluded (the computed property at line 497) is the right check to use, not the raw stored captureIsExcluded.

CI: the only in-progress check is the ssot review workflow itself. No failing build/test CI.

@wr wr merged commit c301521 into main Jun 25, 2026
10 checks passed
@wr wr deleted the wells/w-431-picker-mouse-clicks branch June 25, 2026 01:09
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