W-431: make autocomplete picker rows mouse-clickable#146
Merged
Conversation
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
There was a problem hiding this comment.
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.onHoversettingselectedIndexdirectly — rather than going throughonPickRow— is the right split: hover just tracks, tap commits.closeLen: 0in the tap path correctly matches.fromPickersemantics (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 storedcaptureIsExcluded.
CI: the only in-progress check is the ssot review workflow itself. No failing build/test CI.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.onTapGestureor.onHoverat 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
.contentShape(Rectangle())+.onTapGesture+.onHovertoPickerRow, wired to a newviewModel.onPickRow.onPickRowmirrors the keyboard Return path: set the selected index, then insert the selected row (.fromPickerreadstopResult), or grow into the grid for the trailing Browse row. Hover sets the selection so the highlight tracks the mouse.captureScope) so a click can rebuild the same insert the keyboard path gets from the state-machine action.Test plan
:fire→ hover highlights, click inserts, Browse row expands;:?pill still works.Refs W-431