Skip to content

fix(a11y): add instant search advisory to homepage search field#1845

Merged
danielroe merged 6 commits intomainfrom
knowler/instant-search-advisory
Mar 3, 2026
Merged

fix(a11y): add instant search advisory to homepage search field#1845
danielroe merged 6 commits intomainfrom
knowler/instant-search-advisory

Conversation

@knowler
Copy link
Member

@knowler knowler commented Mar 2, 2026

A major step towards resolving #1653, builds on @alex-key’s awesome work in #1851.

This adds an advisory to the search field on the main page that fulfills the requirement of WCAG 2.2 Success Criterion 3.2.2 On Input (Level A). I added a “lightning bolt” icon to make it seem more like a feature.

This also include a new shortcut to toggle instant search. I have it set to Ctrl+/. I am open to other suggestions. I found Alt did not work.

There is a slight layout shift at the start if the settings has been disabled… perhaps someone could help me with that.

The homepage search field now with an advisory underneath it prefixed with a lightning bolt icon that reads “Instant search: navigate to results as you type. Turn off in settings or press Ctrl+/.”

@vercel
Copy link

vercel bot commented Mar 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Mar 3, 2026 11:58am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Mar 3, 2026 11:58am
npmx-lunaria Ignored Ignored Mar 3, 2026 11:58am

Request Review

@github-actions
Copy link

github-actions bot commented Mar 2, 2026

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
i18n/locales/en.json Source changed, localizations will be marked as outdated.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@codecov
Copy link

codecov bot commented Mar 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@knowler knowler force-pushed the knowler/instant-search-advisory branch from 1c0ab37 to db5aa6f Compare March 2, 2026 23:49
@knowler knowler marked this pull request as ready for review March 2, 2026 23:57
@knowler knowler requested review from alexdln and danielroe March 2, 2026 23:58
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 3, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds an InstantSearch Vue component, exposes settings via useSettings(), and updates the search page layout and input to include an ARIA advisory and conditional InstantSearch UI. Implements a Ctrl+/ keyboard handler that toggles settings.instantSearch while preserving the existing '/' behaviour. Adds i18n keys and schema entries for instant-search text and adds an accessibility test for the new component.

Possibly related issues

Possibly related PRs

🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description clearly relates to the changeset, detailing the addition of an accessibility advisory to the search field and a new keyboard shortcut for toggling instant search.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch knowler/instant-search-advisory

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
Contributor

@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: 2


ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2786639 and db5aa6f.

📒 Files selected for processing (4)
  • app/app.vue
  • app/pages/index.vue
  • i18n/locales/en.json
  • i18n/schema.json

Copy link
Contributor

@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

🧹 Nitpick comments (1)
app/pages/index.vue (1)

110-137: Consider reducing initial layout shift from advisory toggling

If settings.instantSearch hydrates client-side, v-if here can produce a small first-paint shift. Consider reserving space or toggling visibility instead of mounting/unmounting.


ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between db5aa6f and 76070c1.

📒 Files selected for processing (1)
  • app/pages/index.vue

@serhalp serhalp added this to the Alpha announcement milestone Mar 3, 2026
@alexdln
Copy link
Member

alexdln commented Mar 3, 2026

Hydration mismatch with disabled option, 👀

UPD: #1866

Copy link
Contributor

@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


ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 76070c1 and 824e152.

📒 Files selected for processing (2)
  • app/components/InstantSearch.vue
  • app/pages/index.vue

@danielroe danielroe added this pull request to the merge queue Mar 3, 2026
@danielroe danielroe removed this pull request from the merge queue due to a manual request Mar 3, 2026
@danielroe
Copy link
Member

danielroe commented Mar 3, 2026

I want to see if I can tweak the wording to be shorter/more succinct - maybe something like:

⚡ Instant search on - turn off

maybe we don't need anything in settings at all

Copy link
Contributor

@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


ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ed977dc and 87fe071.

📒 Files selected for processing (4)
  • app/components/InstantSearch.vue
  • app/pages/index.vue
  • i18n/locales/en.json
  • i18n/schema.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • i18n/schema.json
  • app/components/InstantSearch.vue

@danielroe danielroe enabled auto-merge March 3, 2026 11:56
@danielroe danielroe added this pull request to the merge queue Mar 3, 2026
Merged via the queue into main with commit 3700438 Mar 3, 2026
23 checks passed
@danielroe danielroe deleted the knowler/instant-search-advisory branch March 3, 2026 12:03
@knowler
Copy link
Member Author

knowler commented Mar 3, 2026

We’ll need to follow up with a few changes to the wording as it’s too vague.

There are two parts here: the description of the behaviour and the description of how to turn it off.

“Instant search” on its own is vague, but it might be fine if we can direct users to a more clear definition. Though this is the main part that is required by WCAG 2.2 SC 3.2.2.

What I think is almost more important is the description of how to turn it off. The problem with just using an action “turn off” is that this doesn’t make a whole lot of sense for screen reader users. aria-describedby does not convey semantics or even location of the description. So, whatever’s set for it needs to make sense on its own. This is why I had worded it to direct the user where to go (“Turn off in settings”) and gave them an immediate way to shut it off (the hotkey).

We could consider using a tooltip to reduce the visual noise here and then provide a screen reader only description for the control.

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.

4 participants