Skip to content

🎨 Palette: Search View Screen Reader Accessibility#600

Open
AhmmedSamier wants to merge 1 commit into
masterfrom
palette-search-combobox-10461848391230529502
Open

🎨 Palette: Search View Screen Reader Accessibility#600
AhmmedSamier wants to merge 1 commit into
masterfrom
palette-search-combobox-10461848391230529502

Conversation

@AhmmedSamier

@AhmmedSamier AhmmedSamier commented Jul 25, 2026

Copy link
Copy Markdown
Owner

💡 What:
Implemented the W3C ARIA Combobox pattern in the DeepLens custom search Webview interface (search-view.html). This includes setting up role="combobox", dynamically toggling aria-expanded, mapping aria-controls to the #results listbox, and actively managing aria-activedescendant on the search input while simultaneously updating aria-selected on uniquely identified role="option" result items during keyboard navigation.

🎯 Why:
Custom search interfaces built with standard divs and inputs are functionally invisible to screen readers, meaning visually impaired users cannot perceive the dropdown state or understand which result they have focused via arrow keys. Implementing the official ARIA Combobox specification guarantees the interface behaves natively for assistive technologies, announcing both state changes and the currently highlighted item.

📸 Before/After:
No visual change (this is a purely semantic and accessibility-focused update that preserves all existing visual styling and layout).

♿ Accessibility:
Transforms an inaccessible custom UI component into a fully compliant ARIA Combobox, enabling complete screen reader support for searching and keyboard navigation within the extension's core feature.


PR created automatically by Jules for task 10461848391230529502 started by @AhmmedSamier

Summary by CodeRabbit

  • Accessibility

    • Improved search dropdown accessibility with ARIA combobox, listbox, and option semantics.
    • Added clearer state announcements for expanded results and the currently selected item.
    • Enhanced keyboard navigation support for search results and slash commands.
  • Tests

    • Improved test reliability by adding an explicit timeout to a code lens test.

Adds role="combobox", aria-expanded, and aria-activedescendant to the search input, role="listbox" to the results container, and dynamic role="option" with aria-selected states to search results to properly support screen reader navigation. Also fixes a flaky test in reference-code-lens.test.ts by increasing the timeout.

Co-authored-by: AhmmedSamier <17784876+AhmmedSamier@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The search webview now implements ARIA combobox, listbox, and option semantics, including dynamic expansion and selection state. The supported-symbol code lens test also receives an explicit 5000 ms timeout.

Changes

Search accessibility semantics

Layer / File(s) Summary
ARIA contract and result rendering
.jules/palette.md, vscode-extension/src/webviews/search-view.html
The search input and results expose combobox/listbox semantics, while normal and slash-command results receive option roles, IDs, and expansion state updates.
Selection state synchronization
vscode-extension/src/webviews/search-view.html
Result aria-selected values and the input’s aria-activedescendant now track the active selection.

Code lens test timeout

Layer / File(s) Summary
Code lens test timeout
vscode-extension/src/test/suite/reference-code-lens.test.ts
The supported-symbol test uses a function expression and sets a 5000 ms timeout.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant SearchInput
  participant SearchResults
  participant SelectedOption

  User->>SearchInput: Enter search text
  SearchInput->>SearchResults: Render matching results
  SearchResults->>SearchInput: Set aria-expanded=true
  User->>SelectedOption: Navigate with keyboard
  SelectedOption->>SearchResults: Update aria-selected
  SelectedOption->>SearchInput: Set aria-activedescendant
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: improving search view screen reader accessibility.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch palette-search-combobox-10461848391230529502

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@vscode-extension/src/webviews/search-view.html`:
- Line 347: Reformat the input element with id search-input by splitting its
attributes across multiple lines so every line, including the opening tag,
remains within the 120-character limit while preserving all existing attributes
and values.
- Line 801: Update the empty-state rendering transition around
searchInput.setAttribute('aria-expanded', 'false') to remove
aria-activedescendant and reset the active selection when the previous result
list is replaced. Preserve the existing collapsed-state behavior while ensuring
the input cannot reference a detached option.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c3094a90-37e0-4f32-852c-ac84d6d103aa

📥 Commits

Reviewing files that changed from the base of the PR and between 35dd4d7 and 066cc22.

📒 Files selected for processing (3)
  • .jules/palette.md
  • vscode-extension/src/test/suite/reference-code-lens.test.ts
  • vscode-extension/src/webviews/search-view.html

<button class="scope-button" data-scope="endpoints" title="Search API Endpoints" aria-pressed="false"><i class="codicon codicon-globe"></i> Endpoints</button>
</div>
<input type="text" id="search-input" placeholder="Search everywhere..." autocomplete="off" spellcheck="false" aria-label="Search everywhere">
<input type="text" id="search-input" placeholder="Search everywhere..." autocomplete="off" spellcheck="false" aria-label="Search everywhere" role="combobox" aria-expanded="false" aria-controls="results" aria-autocomplete="list">

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Keep the combobox markup within the 120-character limit.

Split the attributes across multiple lines. As per coding guidelines, line length is limited to 120 characters.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@vscode-extension/src/webviews/search-view.html` at line 347, Reformat the
input element with id search-input by splitting its attributes across multiple
lines so every line, including the opening tag, remains within the 120-character
limit while preserving all existing attributes and values.

Source: Coding guidelines


function renderEmptyState() {
resultsContainer.textContent = '';
searchInput.setAttribute('aria-expanded', 'false');

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Clear aria-activedescendant when rendering the empty state.

If this replaces a previously navigated result list, the input can continue referencing a detached option after aria-expanded becomes false. Remove the attribute and reset selection in the same state transition, unless another guaranteed path already does so.

Proposed fix
            searchInput.setAttribute('aria-expanded', 'false');
+           searchInput.removeAttribute('aria-activedescendant');
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
searchInput.setAttribute('aria-expanded', 'false');
searchInput.setAttribute('aria-expanded', 'false');
searchInput.removeAttribute('aria-activedescendant');
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@vscode-extension/src/webviews/search-view.html` at line 801, Update the
empty-state rendering transition around
searchInput.setAttribute('aria-expanded', 'false') to remove
aria-activedescendant and reset the active selection when the previous result
list is replaced. Preserve the existing collapsed-state behavior while ensuring
the input cannot reference a detached option.

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