Skip to content

♿️(frontend) announce search loading state for screen readers#2526

Open
Ovgodd wants to merge 2 commits into
mainfrom
fix/a11y-search-loading-screen-reader
Open

♿️(frontend) announce search loading state for screen readers#2526
Ovgodd wants to merge 2 commits into
mainfrom
fix/a11y-search-loading-screen-reader

Conversation

@Ovgodd

@Ovgodd Ovgodd commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Purpose

Fix an accessibility issue where the "Loading documents..." message during document search is not conveyed by screen readers. Blind users receive no feedback that their input was registered while results are loading (RGAA criterion 7.1).

Proposal

  • Announce "Loading documents..." via @react-aria/live-announcer when search loading starts in DocSearchContent
  • Cover all document search entry points: main search modal, move document modal, and editor interlinking
  • Keep existing result announcements after loading completes

@Ovgodd
Ovgodd requested a review from AntoLC July 15, 2026 09:32
@Ovgodd Ovgodd self-assigned this Jul 15, 2026
@Ovgodd Ovgodd moved this from Backlog to In review in LaSuite Docs A11y Jul 15, 2026
Add live region announcement when document search is in progress.
@Ovgodd
Ovgodd force-pushed the fix/a11y-search-loading-screen-reader branch from b1c1e64 to 0b3207c Compare July 15, 2026 09:33
@Ovgodd
Ovgodd marked this pull request as ready for review July 15, 2026 09:33
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

DocSearchContent now politely announces “Loading documents...” when applicable document searches begin loading. The v5.4.1 changelog records this screen-reader announcement.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested reviewers: antolc, lunika

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main accessibility change: announcing the search loading state for screen readers.
Description check ✅ Passed The description matches the changeset and describes the loading announcement accessibility fix and preserved result announcements.
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.
✨ 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-search-loading-screen-reader

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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/impress/src/features/docs/doc-search/components/DocSearchContent.tsx`:
- Around line 118-122: Update the loading announcement effect in
DocSearchContent so it fires only when loading transitions from false to true,
rather than on every search change while loading remains active. Track the
previous loading state within the component, preserve the existing
search/isSearchNotMandatory eligibility check, and avoid re-announcing until
loading becomes inactive and starts again.
- Around line 118-122: Update the useEffect in DocSearchContent so its cleanup
clears the polite announcer via clearAnnouncer('polite') when the component
unmounts or the effect reruns. Preserve the existing conditional loading
announcement behavior.
🪄 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: 5738afb7-21e3-4715-a0e7-aa5e735218d5

📥 Commits

Reviewing files that changed from the base of the PR and between 8d2dd5b and 0b3207c.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • src/frontend/apps/impress/src/features/docs/doc-search/components/DocSearchContent.tsx

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Size Change: 0 B

Total Size: 4.37 MB

📦 View Changed
Filename Size Change
apps/impress/out/_next/static/17d23480/_buildManifest.js 0 B -696 B (removed) 🏆
apps/impress/out/_next/static/d8841f1f/_buildManifest.js 696 B +696 B (new file) 🆕

compressed-size-action

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
src/frontend/apps/impress/src/features/docs/doc-search/components/DocSearchContent.tsx (1)

120-129: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Clear the polite announcement on cleanup.

As flagged in a previous review, unmounting the modal while loading can leave the "Loading documents..." message queued in the global live region. Add a cleanup function to this effect to clear the polite announcer so that obsolete loading announcements do not persist. (Ensure clearAnnouncer is imported from @react-aria/live-announcer).

🧹 Proposed fix
   useEffect(() => {
     if (
       loading &&
       !prevLoadingRef.current &&
       (search || isSearchNotMandatory)
     ) {
       announce(t('Loading documents...'), 'polite');
     }
     prevLoadingRef.current = loading;
+
+    return () => clearAnnouncer('polite');
   }, [loading, search, isSearchNotMandatory]);
🤖 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/impress/src/features/docs/doc-search/components/DocSearchContent.tsx`
around lines 120 - 129, Update the loading announcement useEffect in
DocSearchContent to return a cleanup function that calls clearAnnouncer with the
polite channel, and import clearAnnouncer from `@react-aria/live-announcer`.
Preserve the existing loading detection and prevLoadingRef update behavior.
🤖 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.

Duplicate comments:
In
`@src/frontend/apps/impress/src/features/docs/doc-search/components/DocSearchContent.tsx`:
- Around line 120-129: Update the loading announcement useEffect in
DocSearchContent to return a cleanup function that calls clearAnnouncer with the
polite channel, and import clearAnnouncer from `@react-aria/live-announcer`.
Preserve the existing loading detection and prevLoadingRef update behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8664efa4-cff0-4677-bbe2-555b420e1f8d

📥 Commits

Reviewing files that changed from the base of the PR and between 0b3207c and 171a006.

📒 Files selected for processing (1)
  • src/frontend/apps/impress/src/features/docs/doc-search/components/DocSearchContent.tsx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

Document search: "Loading" message not conveyed to assistive technologies

1 participant