Skip to content

feat(search-query-builder): Add auto focus and tab select#115176

Draft
nsdeschenes wants to merge 6 commits into
masterfrom
nd/feat-search-query-builder-add-auto-focus-and-tab-select
Draft

feat(search-query-builder): Add auto focus and tab select#115176
nsdeschenes wants to merge 6 commits into
masterfrom
nd/feat-search-query-builder-add-auto-focus-and-tab-select

Conversation

@nsdeschenes
Copy link
Copy Markdown
Contributor

Quick POC

TODO

nsdeschenes and others added 2 commits May 8, 2026 12:16
Allow search query builder comboboxes to expose a focused option override for virtual-focus listboxes. This lets typed suggestions render and commit a focused option without moving DOM focus out of the input.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
Focus the first visible suggestion while typing in search term, filter key, and filter value comboboxes. Accept the focused suggestion with Tab so filter key selection moves directly into value entry.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 8, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

📊 Type Coverage Diff

✅ No new type safety issues introduced. Coverage: 93.46%

Comment thread static/app/components/searchQueryBuilder/tokens/combobox.tsx
nsdeschenes and others added 4 commits May 11, 2026 10:04
When every visible combobox option is disabled, consume the pending first-option focus request before returning. This keeps the layout effect from retrying on unrelated renders after there is no option to focus.

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
Allow search query builder comboboxes to show a suggested option without treating it as the active Enter target. This keeps the default behavior unchanged while giving callers a way to reserve Enter for typed values.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
Use the tab-only combobox focus mode for free-text search terms so Enter commits the typed value while Tab accepts the suggested filter key.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 48403a5. Configure here.

state.commit();
} else if (state.selectionManager.focusedKey !== null) {
state.commit();
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Enter key may not commit the visually focused override option

Medium Severity

In focus mode, when Enter is pressed with a focusedKeyOverride, the code calls state.selectionManager.setFocusedKey(focusedKeyOverride) then immediately state.commit(). Since setFocusedKey is a React useState setter (batched), commit() reads the stale focusedKey (still null) and doesn't select the override option. Then combobox.tsx's Enter handler sees focusedKey is still null, falls through the guard, and calls onCustomValueCommitted(inputValue) instead. This creates a mismatch: aria-activedescendant shows the override option as focused, but Enter commits the raw typed text. This affects filterKeyCombobox and valueCombobox which both use the default focus behavior.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 48403a5. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant