Skip to content

Accessibility improvements for global & vocab search#2004

Merged
joelit merged 11 commits intomainfrom
issue1974-clear-search-button-name
Apr 23, 2026
Merged

Accessibility improvements for global & vocab search#2004
joelit merged 11 commits intomainfrom
issue1974-clear-search-button-name

Conversation

@joelit
Copy link
Copy Markdown
Contributor

@joelit joelit commented Apr 14, 2026

Reasons for creating this PR

Link to relevant issue(s), if any

Description of the changes in this PR

  • Add translation template for clear search button text
  • Add aria label for vocab search clear search button
  • Add aria label for global search clear search button
  • Make sure the focus stays in the search field after pressing the clear search field button for keyboard accessibility
  • Update cypress tests accordingly

Known problems or uncertainties in this PR

Checklist

  • phpUnit tests pass locally with my changes
  • I have added tests that show that the new code works, or tests are not relevant for this PR (e.g. only HTML/CSS changes)
  • The PR doesn't reduce accessibility of the front-end code (e.g. tab focus, scaling to different resolutions, use of .sr-only class, color contrast)
  • The PR doesn't introduce unintended code changes (e.g. empty lines or useless reindentation)

@qltysh
Copy link
Copy Markdown

qltysh Bot commented Apr 14, 2026

2 new issues

Tool Category Rule Count
qlty Structure Function with many returns (count = 38): startGlobalSearchApp 2

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.07%. Comparing base (17083ca) to head (7b4806a).
⚠️ Report is 24 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #2004   +/-   ##
=========================================
  Coverage     70.07%   70.07%           
  Complexity     1703     1703           
=========================================
  Files            34       34           
  Lines          4484     4484           
=========================================
  Hits           3142     3142           
  Misses         1342     1342           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@joelit joelit changed the title Screen reader and keybord usable clear search button for vocab search Screen reader and keybord usable clear search button for global & vocab search Apr 14, 2026
@joelit joelit marked this pull request as ready for review April 14, 2026 12:34
@joelit joelit self-assigned this Apr 14, 2026
@joelit joelit moved this to Under review in Skosmos 3.x Backlog Apr 14, 2026
@joelit joelit added this to the 3.3 milestone Apr 14, 2026
@Vainonen Vainonen self-requested a review April 15, 2026 07:04
Comment thread tests/cypress/template/global-search-bar.cy.js Outdated
Comment thread tests/cypress/template/vocab-search-bar.cy.js
@Vainonen
Copy link
Copy Markdown
Contributor

Translations to other languages missing from files and Cypress test.

@joelit joelit changed the title Screen reader and keybord usable clear search button for global & vocab search Accessibility improvements for global & vocab search Apr 16, 2026
@joelit joelit requested review from Vainonen and removed request for Vainonen April 16, 2026 12:56
@Vainonen
Copy link
Copy Markdown
Contributor

Removed translation keys "Search...", "Text input with dropdown button", "1. Choose vocabulary", "2. Choose language", "3. Enter search term" can be removed from Lokalise database.

@Vainonen
Copy link
Copy Markdown
Contributor

After latest commits everything seems to work as expected by suggestions in issues save for two issues:

  • Aria-labels and placeholder are not completely matching. Especially aria-label for "search" for entering search term seems too sort while placeholder is "Enter search term".
  • Swedish term for "Choose vocabulary" is translated, but has not been fetched to messages.sv.json

@joelit joelit mentioned this pull request Apr 22, 2026
4 tasks
@joelit joelit force-pushed the issue1974-clear-search-button-name branch from f8756c2 to adee1a6 Compare April 22, 2026 16:28
@joelit
Copy link
Copy Markdown
Contributor Author

joelit commented Apr 22, 2026

Rebased and force-pushed

@joelit
Copy link
Copy Markdown
Contributor Author

joelit commented Apr 23, 2026

After latest commits everything seems to work as expected by suggestions in issues save for two issues:

  • Aria-labels and placeholder are not completely matching. Especially aria-label for "search" for entering search term seems too sort while placeholder is "Enter search term".
  • Swedish term for "Choose vocabulary" is translated, but has not been fetched to messages.sv.json

The Swedish translations need to be updated with Maria, but that can be done separately. I'm prety sure that particular translation is missing:
image

@joelit joelit merged commit 7b4806a into main Apr 23, 2026
17 of 19 checks passed
@github-project-automation github-project-automation Bot moved this from Under review to Issue/PR closed in Skosmos 3.x Backlog Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment