Skip to content

♿️(frontend) align search modal field label with placeholder#2384

Open
Ovgodd wants to merge 1 commit into
mainfrom
fix/a11y-2347-search-modal-label
Open

♿️(frontend) align search modal field label with placeholder#2384
Ovgodd wants to merge 1 commit into
mainfrom
fix/a11y-2347-search-modal-label

Conversation

@Ovgodd
Copy link
Copy Markdown
Collaborator

@Ovgodd Ovgodd commented Jun 3, 2026

Purpose

The search modal input exposed three inconsistent names (aria-label, <label>, and placeholder). Screen reader users heard a different label than the visible placeholder

Proposal

  • Remove redundant aria-label on QuickSearchInput so the accessible name comes from cmdk's <label> (aria-labelledby) instead of overriding it
  • Align DocSearchModal label and placeholder on Type the name of a document
  • Add optional listLabel on QuickSearch so the results listbox keeps Search results as aria-label when the input label changes
  • Update e2e selectors in doc-search.spec.ts to match the new combobox accessible name

@Ovgodd Ovgodd requested a review from AntoLC June 3, 2026 09:07
@Ovgodd Ovgodd self-assigned this Jun 3, 2026
@Ovgodd Ovgodd added bug Something isn't working accessibility triage labels Jun 3, 2026
@Ovgodd Ovgodd changed the title ♿️(frontend) align search modal field label with placeholder #2347 ♿️(frontend) align search modal field label with placeholder Jun 3, 2026
@Ovgodd Ovgodd force-pushed the fix/a11y-2347-search-modal-label branch from 6160724 to 865afc8 Compare June 3, 2026 09:07
@Ovgodd Ovgodd linked an issue Jun 3, 2026 that may be closed by this pull request
@Ovgodd Ovgodd moved this from Backlog to In review in LaSuite Docs A11y Jun 3, 2026
@Ovgodd Ovgodd marked this pull request as ready for review June 3, 2026 09:08
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

Size Change: -1 B (0%)

Total Size: 4.33 MB

📦 View Changed
Filename Size Change
apps/impress/out/_next/static/cf8b6a77/_buildManifest.js 672 B +672 B (new file) 🆕
apps/impress/out/_next/static/fb7d2445/_buildManifest.js 0 B -673 B (removed) 🏆

compressed-size-action

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 3, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 708de39d-5789-4078-94ae-3c1d6083c161

📥 Commits

Reviewing files that changed from the base of the PR and between 865afc8 and ee5703e.

📒 Files selected for processing (7)
  • CHANGELOG.md
  • src/frontend/apps/e2e/__tests__/app-impress/doc-grid-move.spec.ts
  • src/frontend/apps/e2e/__tests__/app-impress/doc-search.spec.ts
  • src/frontend/apps/impress/src/components/quick-search/QuickSearch.tsx
  • src/frontend/apps/impress/src/components/quick-search/QuickSearchInput.tsx
  • src/frontend/apps/impress/src/features/docs/doc-search/components/DocSearchModal.tsx
  • src/frontend/apps/impress/src/features/docs/docs-grid/components/DocMoveModal.tsx
💤 Files with no reviewable changes (1)
  • src/frontend/apps/impress/src/components/quick-search/QuickSearchInput.tsx

Walkthrough

This PR improves the accessibility of the search modal by aligning field labels with placeholder text. The QuickSearch component now accepts an optional listLabel prop to separately label the results list, while the input's aria-label is removed to rely on the placeholder. DocSearchModal is updated to use "Type the name of a document" as the input label and passes a results list label. E2E tests are updated to match the new accessible names, and a CHANGELOG entry documents the change.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • AntoLC
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: aligning search modal field labels with placeholders for accessibility, which is the core objective of this pull request.
Description check ✅ Passed The description is well-related to the changeset, providing clear context about the accessibility problem, the proposed solution, and the specific changes implemented across multiple files.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 fix/a11y-2347-search-modal-label

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 and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/frontend/apps/e2e/__tests__/app-impress/doc-search.spec.ts (1)

39-39: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Consider updating for consistency with other tests.

Line 39 uses getByPlaceholder while the other tests in this file (lines 110, 123, 171, 173, 195) were updated to use getByRole('combobox', { name: 'Type the name of a document' }). Using getByRole with the accessible name is the recommended approach for accessibility testing and aligns with the PR's objective to update test selectors to match the new combobox accessible name.

♻️ Proposed refactor
-    const inputSearch = page.getByPlaceholder('Type the name of a document');
+    const inputSearch = page.getByRole('combobox', { name: 'Type the name of a document' });
🤖 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 `@src/frontend/apps/e2e/__tests__/app-impress/doc-search.spec.ts` at line 39,
Replace the use of getByPlaceholder for the document search input with the
accessible-role selector to match other tests: change the code that sets
inputSearch (currently using page.getByPlaceholder) to use
page.getByRole('combobox', { name: 'Type the name of a document' }) so the test
queries the combobox by its accessible name; update any references to the
inputSearch variable if needed to reflect the new selector usage.
🤖 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 `@src/frontend/apps/e2e/__tests__/app-impress/doc-search.spec.ts`:
- Around line 171-174: Extract the repeated combobox selector into a local
variable to avoid duplication: create a constant (e.g., docCombobox) assigned to
page.getByRole('combobox', { name: 'Type the name of a document' }) and then
call docCombobox.click() and docCombobox.fill('sub page search'); update uses in
the test (the code surrounding the existing await page.getByRole(...) calls) to
reference that variable.

---

Outside diff comments:
In `@src/frontend/apps/e2e/__tests__/app-impress/doc-search.spec.ts`:
- Line 39: Replace the use of getByPlaceholder for the document search input
with the accessible-role selector to match other tests: change the code that
sets inputSearch (currently using page.getByPlaceholder) to use
page.getByRole('combobox', { name: 'Type the name of a document' }) so the test
queries the combobox by its accessible name; update any references to the
inputSearch variable if needed to reflect the new selector usage.
🪄 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: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 436f1646-45a4-4c82-a71b-83c7384fd146

📥 Commits

Reviewing files that changed from the base of the PR and between a78269a and 865afc8.

📒 Files selected for processing (6)
  • CHANGELOG.md
  • src/frontend/apps/e2e/__tests__/app-impress/doc-grid-move.spec.ts
  • src/frontend/apps/e2e/__tests__/app-impress/doc-search.spec.ts
  • src/frontend/apps/impress/src/components/quick-search/QuickSearch.tsx
  • src/frontend/apps/impress/src/components/quick-search/QuickSearchInput.tsx
  • src/frontend/apps/impress/src/features/docs/doc-search/components/DocSearchModal.tsx
💤 Files with no reviewable changes (1)
  • src/frontend/apps/impress/src/components/quick-search/QuickSearchInput.tsx

Comment on lines 171 to 174
await page.getByRole('combobox', { name: 'Type the name of a document' }).click();
await page
.getByRole('combobox', { name: 'Search documents' })
.getByRole('combobox', { name: 'Type the name of a document' })
.fill('sub page search');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial | 💤 Low value

Consider extracting the selector to avoid repetition.

The combobox selector is duplicated across lines 171 and 173. Extracting it to a variable would improve readability and reduce the chance of typos if the selector needs to change.

♻️ Proposed refactor
+    const searchCombobox = page.getByRole('combobox', { name: 'Type the name of a document' });
-    await page.getByRole('combobox', { name: 'Type the name of a document' }).click();
-    await page
-      .getByRole('combobox', { name: 'Type the name of a document' })
-      .fill('sub page search');
+    await searchCombobox.click();
+    await searchCombobox.fill('sub page search');
📝 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
await page.getByRole('combobox', { name: 'Type the name of a document' }).click();
await page
.getByRole('combobox', { name: 'Search documents' })
.getByRole('combobox', { name: 'Type the name of a document' })
.fill('sub page search');
const searchCombobox = page.getByRole('combobox', { name: 'Type the name of a document' });
await searchCombobox.click();
await searchCombobox.fill('sub page search');
🤖 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 `@src/frontend/apps/e2e/__tests__/app-impress/doc-search.spec.ts` around lines
171 - 174, Extract the repeated combobox selector into a local variable to avoid
duplication: create a constant (e.g., docCombobox) assigned to
page.getByRole('combobox', { name: 'Type the name of a document' }) and then
call docCombobox.click() and docCombobox.fill('sub page search'); update uses in
the test (the code surrounding the existing await page.getByRole(...) calls) to
reference that variable.

@Ovgodd Ovgodd force-pushed the fix/a11y-2347-search-modal-label branch from 865afc8 to e3ccc4b Compare June 3, 2026 10:12
Remove redundant aria-label on QuickSearch input, align DocSearchModal labels.
@Ovgodd Ovgodd force-pushed the fix/a11y-2347-search-modal-label branch from e3ccc4b to ee5703e Compare June 3, 2026 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility bug Something isn't working triage

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

Search modal — Search field: inconsistent label with placeholder

1 participant