Skip to content

fix(vimeo): a11y keyboard and video placeholder alt text#803

Merged
harlan-zw merged 3 commits into
mainfrom
fix/a11y-vimeo-keyboard-alt-text
May 27, 2026
Merged

fix(vimeo): a11y keyboard and video placeholder alt text#803
harlan-zw merged 3 commits into
mainfrom
fix/a11y-vimeo-keyboard-alt-text

Conversation

@harlan-zw
Copy link
Copy Markdown
Collaborator

@harlan-zw harlan-zw commented May 27, 2026

🔗 Linked issue

Related to a11y audit follow-up from #798

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

ScriptVimeoPlayer had the same keyboard-accessibility gap that #798 fixed for YouTube: placeholder responded to mouse triggers but not Enter/Space. Applies the same pattern: root gains tabindex="0", role="button", aria-label="Play video" while placeholder is showing and the trigger is event-based; Enter/Space dispatches the configured trigger event. Non-event triggers (immediate, onNuxtReady, visibility, visible) are unchanged. Additionally, both YouTube and Vimeo placeholder <img> alt="" -> alt="Play video" so screen readers describe the action.

Applies the same keyboard-accessibility pattern from #798 to ScriptVimeoPlayer
so users navigating with a keyboard can activate the placeholder via Enter or
Space. Also sets the placeholder image alt to "Play video" on both the Vimeo
and YouTube components so screen readers describe the action rather than
treating the thumbnail as decorative.
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 27, 2026

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

Project Deployment Actions Updated (UTC)
scripts-playground Ready Ready Preview, Comment May 27, 2026 7:03am

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 27, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e44be465-7f69-43f1-80ee-7bfa84ab9f59

📥 Commits

Reviewing files that changed from the base of the PR and between 2d8f516 and 07bfd18.

📒 Files selected for processing (1)
  • packages/script/src/runtime/components/ScriptVimeoPlayer.vue
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/script/src/runtime/components/ScriptVimeoPlayer.vue

📝 Walkthrough

Walkthrough

This PR enhances accessibility for video player placeholders across two components. The Vimeo player gains keyboard support by computing when keyboard activation is available, handling Enter and Space keys to dispatch configured trigger events, and updating ARIA semantics to expose the interactive state. Both the Vimeo and YouTube player placeholders now use descriptive "Play video" alt text instead of empty strings, improving screen reader clarity.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: Vimeo keyboard accessibility improvements and video placeholder alt text updates for both YouTube and Vimeo players.
Description check ✅ Passed The description is directly related to the changeset, providing clear context about the keyboard accessibility fixes for Vimeo and alt text improvements for both players.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/a11y-vimeo-keyboard-alt-text

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.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 27, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@nuxt/scripts@803

commit: 07bfd18

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: 1

🤖 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 `@packages/script/src/runtime/components/ScriptVimeoPlayer.vue`:
- Around line 265-277: The onPlaceholderKeydown handler currently casts
props.trigger to string[] and may attempt to dispatch non-string triggers;
update onPlaceholderKeydown to validate each trigger is a string before
dispatching by replacing the unchecked loop over triggers with a guard (e.g.,
check typeof t === 'string') and only dispatch Event(t, { bubbles: false }) when
that check passes; refer to function onPlaceholderKeydown, the triggers variable
derived from props.trigger, and rootEl.value for locating the change.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 95fd7f21-5d44-4b45-9cd3-dbb421d2ea45

📥 Commits

Reviewing files that changed from the base of the PR and between 4ed9c62 and 2d8f516.

📒 Files selected for processing (2)
  • packages/script/src/runtime/components/ScriptVimeoPlayer.vue
  • packages/script/src/runtime/components/ScriptYouTubePlayer.vue

Comment thread packages/script/src/runtime/components/ScriptVimeoPlayer.vue
@harlan-zw
Copy link
Copy Markdown
Collaborator Author

Addressed in 07bfd18: added typeof t !== 'string' guard in onPlaceholderKeydown to skip object triggers retained by filter(Boolean). Thanks @coderabbitai!

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 27, 2026

Tip

For best results, initiate chat on the files or code changes.

@harlan-zw Great fix — the typeof t !== 'string' guard cleanly handles object-shaped triggers that survive filter(Boolean), preventing any accidental event dispatch on them. Thanks for the quick follow-up! 🐇✨


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

@harlan-zw harlan-zw changed the title fix(a11y): vimeo keyboard accessibility and video placeholder alt text fix(vimeo): a11y keyboard and video placeholder alt text May 27, 2026
@harlan-zw harlan-zw merged commit 33a113a into main May 27, 2026
19 checks passed
@harlan-zw harlan-zw deleted the fix/a11y-vimeo-keyboard-alt-text branch May 27, 2026 07:16
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.

1 participant