Skip to content

[Studio UI] Add keyboard navigation to search results - #4058

Open
idaiv wants to merge 5 commits into
2026.xfrom
fix/search-results-keyboard-nav
Open

[Studio UI] Add keyboard navigation to search results#4058
idaiv wants to merge 5 commits into
2026.xfrom
fix/search-results-keyboard-nav

Conversation

@idaiv

@idaiv idaiv commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Search result items now support ArrowDown/Up navigation and Enter to open
  • role="listbox" on container, role="option" on items
  • First item gets tabIndex=0 for keyboard entry point
  • Fixes WCAG 2.1 2.1.1 for the Quick Search modal

Test plan

  • Open Quick Search, type a query
  • Tab to the results list — first item receives focus
  • ArrowDown/Up — navigate between results
  • Enter — opens the focused result
  • Mouse interaction still works as before

🤖 Generated with Claude Code

Relates to https://github.com/pimcore/product-management/issues/372

Search result items now support keyboard interaction:
- ArrowDown/Up to navigate between results
- Enter to open the selected result
- role="option" on items, role="listbox" on container
- First item gets tabIndex=0 for keyboard entry

Fixes WCAG 2.1 2.1.1 (Keyboard) for the search modal.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings September 1, 2026 14:10
@idaiv idaiv added the Skip Milestone Check Exempts this PR from the mandatory milestone requirement label Sep 1, 2026

Copilot AI left a comment

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.

Pull request overview

Verdict: Needs changes. The PR adds keyboard navigation to Quick Search results but leaves accessibility state and documentation inconsistent.

Changes:

  • Adds listbox/option semantics and keyboard controls.
  • Makes the first result tabbable.
  • Adds a broader keyboard-navigation audit.

Review:

  • Correct component boundary; all SearchResultItem call sites are covered.
  • No public API compatibility impact.
  • Focus does not update selection/details, and multiple options can become tabbable.
  • No automated regression test was added.
  • The audit contains stale or overly broad findings.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.

File Description
docs/keyboard-navigation-audit.md Documents keyboard accessibility gaps.
search-result.tsx Adds listbox semantics and initial tab entry.
search-result-item.tsx Adds option semantics and keyboard handlers.
Suppressed comments (1)

assets/js/src/core/modules/search/modal/tabs/general/search-result/search-result.tsx:98

  • Arrow-key focus does not update selectedItemQuery, so keyboard navigation leaves the active styling and detail pane on the previously mouse-hovered item (or blank). Forward focus through the same preview path used by mouse hover so keyboard users receive the same result context.
                        onMouseEnter={ () => { onMouseEnter(item) } }

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

onClick={ onClick }
onKeyDown={ onKeyDown }
padding={ 'mini' }
role="option"
{data?.items.map((item, index) => (
<SearchResultItem
active={ detectItemActivity(item) }
first={ index === 0 }
Comment thread docs/keyboard-navigation-audit.md Outdated
Comment on lines +22 to +25
### 1. Shift+F10 context menu not implemented anywhere
- **Where:** `context-menu-wrapper.tsx`, all tree `with-context-menu.tsx` wrappers, tab context menus
- **Impact:** Context menus are mouse-only. Keyboard users cannot access tree actions, tab close options, or element actions.
- **Effort:** Medium — Add global/component-level keydown listener for Shift+F10, dispatch programmatic Ant Dropdown open, focus first menu item. ~20 touch points but can be centralized in `ContextMenuWrapper`.
Comment thread docs/keyboard-navigation-audit.md Outdated
Comment on lines +37 to +40
### 4. Search results not keyboard navigable
- **Where:** `search-result.tsx`, `search-result-item.tsx`
- **Impact:** Results respond only to mouse click. No arrow key navigation, no Enter to open.
- **Effort:** Medium — Add `tabIndex`, `onKeyDown` for arrow up/down + Enter, visual focus indicator.
idaiv and others added 3 commits September 1, 2026 15:23
- first prop only true when no item is selected (prevents two
  tabIndex=0 items in the listbox)
- Added aria-selected on each option for screen readers

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The keyboard-navigation-audit.md was accidentally included. It's a
pre-remediation snapshot that becomes stale as fixes land.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Sep 2, 2026

Copy link
Copy Markdown

@idaiv
idaiv requested a review from vin0401 September 2, 2026 09:27
@idaiv idaiv added this to the 2026.3.0 milestone Sep 2, 2026
@idaiv
idaiv requested a review from martineiber September 2, 2026 10:28
@idaiv idaiv removed the Skip Milestone Check Exempts this PR from the mandatory milestone requirement label Sep 2, 2026
@idaiv
idaiv removed the request for review from martineiber September 2, 2026 10:36
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.

2 participants