Skip to content

fix(website): gate VideoCompareSlider autoplay on reduced motion, add pause control and posters - #20959

Closed
OrangerXu wants to merge 1 commit into
Comfy-Org:mainfrom
OrangerXu:fix/video-compare-reduced-motion
Closed

OrangerXu wants to merge 1 commit into
Comfy-Org:mainfrom
OrangerXu:fix/video-compare-reduced-motion

Conversation

@OrangerXu

Copy link
Copy Markdown

Summary

The before/after comparison clips (live on /nvidia-vfx/) autoplay and loop forever with no way to stop them and no prefers-reduced-motion gate — WCAG 2.2.2 (Pause, Stop, Hide) for moving content that runs more than five seconds. The repo already gates carousel autoplay this way (ScrollCarousel), and the launch hero parks at currentTime: 0 under reduce; the slider was the one component skipping the convention. The clips also ship without poster, against the rule types.ts states for the gallery, so first paint and every tab switch show a black box while a multi-MB clip decodes, and a no-JS render shows two empty video elements.

  • Under prefers-reduced-motion the clips no longer carry autoplay and are paused on their first frame (currentTime: 0), matching the hero's behavior.
  • Everyone else gets a play/pause toggle next to the clips; its accessible label is composed from the localized before/after labels already passed in, so no new catalog keys are needed.
  • Both clips accept a posterSrc (threaded from ModelLaunchBeforeAfterTab) and set preload="metadata" — the same rule the gallery states and follows. /nvidia-vfx itself stays without per-clip posters until stills reach the CDN, exactly like /flux-3 for the gallery.

Fixes #20957

Verification

  • Tests: extended VideoCompareSlider.test.ts with five cases — reduced motion removes autoplay and parks both clips at currentTime: 0; motion-not-reduced keeps autoplay; the toggle pauses and resumes both clips (spy-verified) with aria-pressed flipping; a provided posterSrc lands on both <video poster> attributes; no poster attribute is set when none is provided.
    • vitest run src/components/common/VideoCompareSlider.test.ts: 16/16 pass (11 pre-existing + 5 new).
    • Mutation check: reverting only VideoCompareSlider.vue makes the reduced-motion test fail.
  • oxfmt --check clean on all four changed files; eslint clean.
  • Note: unlike some sibling suites, this component's tests run fine on Windows locally (no /icons import in its chain), so all 16 ran here rather than only in CI.

… pause control and posters

The before/after comparison clips autoplay and loop forever with no way
to stop them and no prefers-reduced-motion gate - WCAG 2.2.2 (Pause,
Stop, Hide) for moving content that runs more than five seconds. The
repo already gates carousel autoplay this way (ScrollCarousel), and the
launch hero parks at currentTime 0 under reduce; the slider was the one
component skipping the convention.

- Under prefers-reduced-motion the clips no longer carry autoplay, and
  are paused on their first frame (currentTime 0), matching the hero.
- Everyone else gets a play/pause toggle next to the clips; its label
  is composed from the localized before/after labels already passed in.
- Both clips now accept a posterSrc (threaded from
  ModelLaunchBeforeAfterTab) and set preload=metadata, so first paint
  and tab switches show the still instead of a black box while a multi-
  MB clip decodes, and no-JS renders something instead of two empty
  video elements - the same rule the gallery already states and follows.

Fixes Comfy-Org#20957
@OrangerXu
OrangerXu requested a review from a team October 13, 2026 22:49
@github-actions

Copy link
Copy Markdown
Contributor

🎉 Thank you for your contribution, we really appreciate it! 🎉

Like many open source projects, we require contributors to sign our Contributor License Agreement (CLA). A CLA makes the ownership of contributions explicit, so contributors and the project share a clear understanding of how the code can be used. By signing, you:

  • Confirm that you own your contribution.
  • Keep the right to reuse your own code.
  • Grant us a copyright license to include and share it within our projects.

CLAs are standard practice across major open source projects including those under the Apache Software Foundation and the Linux Foundation. Ours is based on the Apache Software Foundation's CLA. Most importantly, it would enable us to relicense the project under a more permissive license in the future, giving the project and its community greater flexibility.

✍ To sign, please post a new comment on this PR with exactly the following text: ✍


I have read and agree to the Contributor License Agreement


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@coderabbitai

coderabbitai Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters: 4
  • apps/website/src/components/common/VideoCompareSlider.test.ts is excluded by !apps/website/**
  • apps/website/src/components/common/VideoCompareSlider.vue is excluded by !apps/website/**
  • apps/website/src/templates/model-launch/ModelLaunchBeforeAfterSection.vue is excluded by !apps/website/**
  • apps/website/src/templates/model-launch/types.ts is excluded by !apps/website/**

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration
  • Configuration used: Repository: Comfy-Org/ComfyUI_frontend/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: a50f41aa-5c33-4842-a146-e6aef17ba768

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

🎭 Playwright: ⏳ Running...

🎨 Storybook: 🚧 Building...

@datadog-official

Copy link
Copy Markdown

Pipelines

❌ Errors

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 1 Pipeline job failed

CLA Assistant | cla-assistant

View in Datadog · View in GitHub Actions

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: dc0117f | Docs | View more details | Give us feedback!

@OrangerXu OrangerXu closed this Oct 14, 2026
@OrangerXu

Copy link
Copy Markdown
Author

Closing — superseded by #20955 (merged 00:15), which covers the same reduced-motion gate, pause control, and poster threading. Thanks for the quick turnaround!

This branch was previously deployed

1 inactive deployment
website-approval — dc0117f0 Deployed Oct 13, 2026 by OrangerXu via fast-lane #1671
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.

VideoCompareSlider: clips autoplay and loop with no pause or reduced-motion gate, and ship without posters (live on /nvidia-vfx)

1 participant