Repository navigation
fix(website): gate VideoCompareSlider autoplay on reduced motion, add pause control and posters - #20959
fix(website): gate VideoCompareSlider autoplay on reduced motion, add pause control and posters#20959OrangerXu wants to merge 1 commit into
Conversation
… 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
|
🎉 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:
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. |
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters: 4
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
🎭 Playwright: ⏳ Running...🎨 Storybook: 🚧 Building... |
❌ ErrorsYour PR has failed checks. Please review the issues below and take necessary action before merging. 🚦 1 Pipeline job failed
Useful? React with 👍 / 👎 This comment will be updated automatically if new data arrives.🔗 Commit SHA: dc0117f | Docs | View more details | Give us feedback! |
|
Closing — superseded by #20955 (merged 00:15), which covers the same reduced-motion gate, pause control, and poster threading. Thanks for the quick turnaround! |
Summary
The before/after comparison clips (live on
/nvidia-vfx/) autoplay and loop forever with no way to stop them and noprefers-reduced-motiongate — 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 atcurrentTime: 0under reduce; the slider was the one component skipping the convention. The clips also ship withoutposter, against the ruletypes.tsstates 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.prefers-reduced-motionthe clips no longer carryautoplayand are paused on their first frame (currentTime: 0), matching the hero's behavior.posterSrc(threaded fromModelLaunchBeforeAfterTab) and setpreload="metadata"— the same rule the gallery states and follows./nvidia-vfxitself stays without per-clip posters until stills reach the CDN, exactly like/flux-3for the gallery.Fixes #20957
Verification
VideoCompareSlider.test.tswith five cases — reduced motion removes autoplay and parks both clips atcurrentTime: 0; motion-not-reduced keeps autoplay; the toggle pauses and resumes both clips (spy-verified) witharia-pressedflipping; a providedposterSrclands 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).VideoCompareSlider.vuemakes the reduced-motion test fail.oxfmt --checkclean on all four changed files;eslintclean./iconsimport in its chain), so all 16 ran here rather than only in CI.