Skip to content

♿️(frontend) improve presenter mode screen reader and keyboard support#2383

Open
Ovgodd wants to merge 5 commits into
mainfrom
fix/a11y-presenter
Open

♿️(frontend) improve presenter mode screen reader and keyboard support#2383
Ovgodd wants to merge 5 commits into
mainfrom
fix/a11y-presenter

Conversation

@Ovgodd
Copy link
Copy Markdown
Collaborator

@Ovgodd Ovgodd commented Jun 2, 2026

Purpose

Make the presenter mode accessible to keyboard and screen reader users:
announce slide changes, trap focus inside the overlay, and restore focus
to the trigger button on close.

Proposal

  • Announce "Slide X of Y: <title>" on navigation via a polite live region (@react-aria/live-announcer).
  • Remove the redundant slide-counter <span> label: the live announcer now handles it, so keeping the aria-label made screen readers read the same info twice. The visual counter is hidden with aria-hidden="true".
  • Trap focus inside the overlay with react-aria FocusScope contain.
  • Strip the ProseMirror editor role (textbox/contenteditable, tabindex="-1") so slides aren't announced as editable, keeping links tabbable.
  • Update e2e tests to target content via role="group".

Announce slide position via react-aria on change; drop bar live region.
@Ovgodd Ovgodd requested a review from AntoLC June 2, 2026 16:07
@Ovgodd Ovgodd self-assigned this Jun 2, 2026
@Ovgodd Ovgodd added enhancement improve an existing feature accessibility labels Jun 2, 2026
@Ovgodd Ovgodd changed the title Fix/a11y presenter ♿️(frontend) improve presenter mode screen reader and keyboard support Jun 2, 2026
@Ovgodd Ovgodd force-pushed the fix/a11y-presenter branch 3 times, most recently from 75fafb5 to c4efdac Compare June 2, 2026 16:12
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

Size Change: +2.54 kB (+0.06%)

Total Size: 4.33 MB

📦 View Changed
Filename Size Change
apps/impress/out/_next/static/acb0b020/_buildManifest.js 0 B -673 B (removed) 🏆
apps/impress/out/_next/static/chunks/pages/_app.js 582 kB +2.54 kB (+0.44%)
apps/impress/out/_next/static/f9fda4ac/_buildManifest.js 677 B +677 B (new file) 🆕

compressed-size-action

@Ovgodd Ovgodd marked this pull request as ready for review June 2, 2026 16:12
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 2, 2026

Review Change Stack

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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 71e8224d-39cf-4ee7-8097-6c5c76457216

📥 Commits

Reviewing files that changed from the base of the PR and between f94f27a and 81f0177.

📒 Files selected for processing (2)
  • src/frontend/apps/e2e/__tests__/app-impress/presenter-mode.spec.ts
  • src/frontend/apps/impress/src/features/docs/doc-presenter/components/PresenterOverlay.tsx

Walkthrough

This PR enhances presenter mode accessibility: it adds slide title extraction, announces slide changes via a polite live announcer, wraps the presenter in a FocusScope, adjusts ProseMirror DOM attributes to avoid edit announcements, replaces an sr-only slide-position region with visible text, and records/restores focus for the Present dropdown button. Component APIs are unchanged.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested reviewers

  • AntoLC
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: improving presenter mode accessibility for screen readers and keyboard users, which aligns with all implemented changes across multiple files.
Description check ✅ Passed The description is directly related to the changeset, providing clear purpose, proposed solutions, and implementation details that match the actual file changes.
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.

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

✨ 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-presenter
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch fix/a11y-presenter

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
Copy Markdown

@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

🤖 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-header/components/DocToolBox.tsx`:
- Around line 138-141: The callback passed to the action should defensively
guard access to optionsButtonRef.current before calling addLastFocus: update the
callback in the component where you set callback (the function that calls
addLastFocus(optionsButtonRef.current) and setIsPresenterOpen(true)) to check
that optionsButtonRef.current is non-null (or use optional chaining) before
calling addLastFocus, leaving the setIsPresenterOpen(true) call as-is; reference
the callback definition, addLastFocus, optionsButtonRef, and setIsPresenterOpen
when making the change.

In
`@src/frontend/apps/impress/src/features/docs/doc-presenter/components/PresenterOverlay.tsx`:
- Around line 131-137: The FocusScope currently uses contain which traps focus
but doesn’t move initial focus into the dialog; update the FocusScope component
(the one wrapping Box with overlayCss and role="dialog"/aria-modal="true") to
include the autoFocus prop so focus is moved to the first focusable element on
mount, and if there isn’t a natural focusable child inside PresenterOverlay add
one (e.g., a dedicated focusable element or set a ref on a button/close control
and ensure it is focusable) so autoFocus has a target.
🪄 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: a16cff44-136c-4c50-b105-15aac4ede5f8

📥 Commits

Reviewing files that changed from the base of the PR and between 5b70c5a and c4efdac.

📒 Files selected for processing (6)
  • CHANGELOG.md
  • src/frontend/apps/impress/src/features/docs/doc-header/components/DocToolBox.tsx
  • src/frontend/apps/impress/src/features/docs/doc-presenter/components/PresenterFloatingBar.tsx
  • src/frontend/apps/impress/src/features/docs/doc-presenter/components/PresenterOverlay.tsx
  • src/frontend/apps/impress/src/features/docs/doc-presenter/components/PresenterSlide.tsx
  • src/frontend/apps/impress/src/features/docs/doc-presenter/hooks/useSlides.ts
💤 Files with no reviewable changes (1)
  • src/frontend/apps/impress/src/features/docs/doc-presenter/components/PresenterFloatingBar.tsx

@Ovgodd Ovgodd force-pushed the fix/a11y-presenter branch from ba3414a to a2416f8 Compare June 3, 2026 07:16
Ovgodd added 3 commits June 3, 2026 09:16
Trap focus with FocusScope; remove editor role from slides for better SR sprt.
Restore focus to menu trigger after closing presenter mode.
@Ovgodd Ovgodd force-pushed the fix/a11y-presenter branch from a2416f8 to f94f27a Compare June 3, 2026 07:17
@Ovgodd Ovgodd force-pushed the fix/a11y-presenter branch from f94f27a to 81f0177 Compare June 3, 2026 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility enhancement improve an existing feature

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant