Skip to content

fix(search|a11y): avoid input focus#1213

Merged
abulte merged 10 commits into
mainfrom
fix/unified-search/live-results
May 30, 2026
Merged

fix(search|a11y): avoid input focus#1213
abulte merged 10 commits into
mainfrom
fix/unified-search/live-results

Conversation

@abulte
Copy link
Copy Markdown
Contributor

@abulte abulte commented May 25, 2026

Comment thread package.json Outdated
Comment thread src/views/topics/TopicFormView.vue
@abulte abulte marked this pull request as ready for review May 27, 2026 09:25
@abulte abulte requested review from a team, geoffreyaldebert and streino as code owners May 27, 2026 09:25
@abulte abulte requested a review from narduin May 27, 2026 09:26
streino
streino previously approved these changes May 27, 2026
Copy link
Copy Markdown
Contributor

@streino streino left a comment

Choose a reason for hiding this comment

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

OK as far as I can tell (not much). I'd rather rely on @narduin's review.

Base automatically changed from feat/seo/meta-title to main May 27, 2026 11:06
@abulte abulte dismissed streino’s stale review May 27, 2026 11:06

The base branch was changed.

@abulte abulte requested a review from a team as a code owner May 27, 2026 11:06
@abulte abulte force-pushed the fix/unified-search/live-results branch from 47869ad to 452a3e4 Compare May 27, 2026 11:07
Copy link
Copy Markdown
Contributor

@narduin narduin left a comment

Choose a reason for hiding this comment

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

So the page title doesn't change anymore when you do a search is that right?
We have a special title that's sent to be announced in the live region instead?

@abulte
Copy link
Copy Markdown
Contributor Author

abulte commented May 27, 2026

So the page title doesn't change anymore when you do a search is that right? We have a special title that's sent to be announced in the live region instead?

Before #1153, we had a live region announcement of the search results count (which you implemented ;-)). Since it was broken by the new component, it's reintroduced here. It's not a title, cf the debug logs in console:

[LiveRegion] Announcement [{"text":"Page Toutes les données pour \"xxtestxx\" | ecologie.data.gouv.fr"},{"text":"13 résultats"}]

@narduin
Copy link
Copy Markdown
Contributor

narduin commented May 27, 2026

Before #1153, we had a live region announcement of the search results count (which you implemented ;-)). Since it was broken by the new component, it's reintroduced here. It's not a title, cf the debug logs in console:

Yep I remember 😁
Although I thought the search results were also added to the page title, has it been too long for my memory already? 😨

@abulte
Copy link
Copy Markdown
Contributor Author

abulte commented May 27, 2026

Before #1153, we had a live region announcement of the search results count (which you implemented ;-)). Since it was broken by the new component, it's reintroduced here. It's not a title, cf the debug logs in console:

Yep I remember 😁 Although I thought the search results were also added to the page title, has it been too long for my memory already? 😨

I don't remember either 😬 Should they? Seems a bit redundant if live region is updated, no?

@narduin
Copy link
Copy Markdown
Contributor

narduin commented May 27, 2026

I think the title and the live region were both updated on route change but it should be tested with a screen reader to be sure.
If that's not the case anymore we might not need to update the live region here but could use the actual text "XX résultats" as a live region.

@abulte
Copy link
Copy Markdown
Contributor Author

abulte commented May 27, 2026

I think the title and the live region were both updated on route change but it should be tested with a screen reader to be sure. If that's not the case anymore we might not need to update the live region here but could use the actual text "XX résultats" as a live region.

"XX résultats" is now upstream, so this might be hard.

@narduin
Copy link
Copy Markdown
Contributor

narduin commented May 28, 2026

"XX résultats" is now upstream, so this might be hard.

It might be enough because it has a role="status" on it! Which is annouced when updated automatically.

<p
  class="fr-col-auto my-0"
  role="status"
  data-testid="search-result-count"
>
  {{ t("{count} résultats | {count} résultat | {count} résultats", searchResults.total) }}
</p>

When testing this branch with a screen reader, the "live title" is annouced twice and the results are also announced since role="status" is an implicit live region.

Page Jeux de données pour "occitqnie" | accessibilite.data.gouv.fr 2 résultats    
Page Jeux de données pour "occitqnie" | accessibilite.data.gouv.fr 2 résultats   
2 résultats

@abulte
Copy link
Copy Markdown
Contributor Author

abulte commented May 28, 2026

@narduin so I should remove results announcement feature from this PR?

@narduin
Copy link
Copy Markdown
Contributor

narduin commented May 28, 2026

@narduin so I should remove results announcement feature from this PR?

I believe so, yes.

@abulte abulte changed the title fix(search|a11y): announce result count and avoid input focus fix(search|a11y): avoid input focus May 28, 2026
@abulte abulte requested review from narduin and streino May 28, 2026 13:41
narduin
narduin previously approved these changes May 28, 2026
streino
streino previously approved these changes May 29, 2026
@abulte abulte dismissed stale reviews from streino and narduin via 33a9a36 May 30, 2026 06:47
@abulte
Copy link
Copy Markdown
Contributor Author

abulte commented May 30, 2026

/deploy ecospheres

@abulte abulte merged commit 570695d into main May 30, 2026
26 checks passed
@abulte abulte deleted the fix/unified-search/live-results branch May 30, 2026 07:15
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.

UnifiedSearch input steals the focus

3 participants