♿️(frontend) align search modal field label with placeholder#2384
♿️(frontend) align search modal field label with placeholder#2384Ovgodd wants to merge 3 commits into
Conversation
6160724 to
865afc8
Compare
|
Size Change: +1 B (0%) Total Size: 4.33 MB 📦 View Changed
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThis PR aligns search input field labels with their placeholder text across document search and move modals. The QuickSearchInput component removes its internal aria-label attribute, allowing parent components to provide context-specific labels. DocSearchModal now passes "Type the name of a document" as the label, while DocMoveModal passes "Search for a doc". Playwright e2e tests update their combobox selectors to match these new accessible names. The change is documented in the changelog. Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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 winConsider updating for consistency with other tests.
Line 39 uses
getByPlaceholderwhile the other tests in this file (lines 110, 123, 171, 173, 195) were updated to usegetByRole('combobox', { name: 'Type the name of a document' }). UsinggetByRolewith 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
📒 Files selected for processing (6)
CHANGELOG.mdsrc/frontend/apps/e2e/__tests__/app-impress/doc-grid-move.spec.tssrc/frontend/apps/e2e/__tests__/app-impress/doc-search.spec.tssrc/frontend/apps/impress/src/components/quick-search/QuickSearch.tsxsrc/frontend/apps/impress/src/components/quick-search/QuickSearchInput.tsxsrc/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
865afc8 to
e3ccc4b
Compare
Remove redundant aria-label on QuickSearch input, align DocSearchModal labels.
e3ccc4b to
ee5703e
Compare
Purpose
The search modal input exposed three inconsistent names (
aria-label,<label>, andplaceholder). Screen reader users heard a different label than the visible placeholderProposal
aria-labelonQuickSearchInputso the accessible name comes from cmdk's<label>(aria-labelledby) instead of overriding itDocSearchModallabelandplaceholderonType the name of a documentlistLabelonQuickSearchso the results listbox keepsSearch resultsasaria-labelwhen the input label changesdoc-search.spec.tsto match the new combobox accessible name