Repository navigation
Conversation
…clips WCAG 2.2.2 (Pause, Stop, Hide) needs a pause mechanism for EVERY visitor, not only those whose OS asks for reduced motion - the clips loop indefinitely and nothing on the surface could stop them. The same toggle gives the reduced-motion cohort its only way to opt in to playing the comparison, which a still frame cannot show (frame generation's entire claim is smoothness). The button's pressed state tracks the autoplay intent, so it reads 'playing' for visitors who never touched it, and clicking it neither drags the divider nor moves the keyboard focus off it. Fixes Comfy-Org#20968
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters: 2
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 |
|
✅ All contributors have signed the CLA. Thank you! This PR is ready to be merged. |
|
🔗 Commit SHA: e52bf8c | Docs | View more details | Give us feedback! |
⚡ Performance:
|
|
recheck |
dante01yoon
left a comment
There was a problem hiding this comment.
Thanks for following up on the WCAG 2.2.2 gap. The motivation is sound, but this cannot land here as is.
Blocking: apps/website was removed from this repo by #21861 (merged 2026-10-26): comfy.org now builds from Comfy-Org/comfy-website, and the shared slider was moved and rewritten as packages/design-system/src/components/common/VideoCompareSlider.vue in #21240 (different props, usePreferredReducedMotion, no toggle). GitHub reports this PR as dirty. Could you re-file the toggle against the website repo (or against the design-system component, if that is where the website now gets it)? The inline points below still apply to the port.
Unanchored: none.
| () => isMounted.value && !prefersReducedMotion() | ||
| ) | ||
|
|
||
| // WCAG 2.2.2 (Pause, Stop, Hide): the clips loop indefinitely, so EVERY |
There was a problem hiding this comment.
issue: The repo bans new code comments (AGENTS.md, Common Pitfalls). This block and the one at line 55 hold rationale and an issue link that belong in the PR description. Could they be removed? A name like isPlaying already says what the state is.
| <button | ||
| type="button" | ||
| data-testid="video-compare-toggle" | ||
| :aria-pressed="String(!isPlaying)" |
There was a problem hiding this comment.
issue: The button flips both its label and aria-pressed, which makes the announced state contradictory. While playing it reads "Pause … comparison, toggle button, not pressed"; after a click it reads "Play … comparison, toggle button, pressed", which sounds like playback is on while the clips are paused. The ARIA APG toggle-button pattern keeps the label fixed when aria-pressed is used. Could we keep one of the two: a fixed "Pause …" label with aria-pressed, or the changing label with no aria-pressed? The test at line 183 would then assert on the accessible name or the pressed state, not both.
| type="button" | ||
| data-testid="video-compare-toggle" | ||
| :aria-pressed="String(!isPlaying)" | ||
| :aria-label=" |
There was a problem hiding this comment.
issue: Pause ${beforeLabel} and ${afterLabel} comparison hard-codes English around the localized labels, so a zh-CN visitor hears a mixed-language name. Could the template go through the site's translation table with placeholders for the two labels, like the other user-facing strings?
| const after = afterVideo.value | ||
| isPlaying.value = !isPlaying.value | ||
| if (isPlaying.value) { | ||
| void before?.play().catch(() => undefined) |
There was a problem hiding this comment.
suggestion: isPlaying is set to true before play() settles, and the rejection is dropped. If a browser rejects play() (power saver, data saver), the button shows Pause while nothing plays. Could isPlaying follow the media elements' play/pause events instead, so the button reflects what the clips are actually doing? That would also remove the watch on shouldAutoplay.
| }) | ||
|
|
||
| it('exposes a play/pause toggle that controls both clips (WCAG 2.2.2)', async () => { | ||
| // Regression test for #20968: the criterion needs a pause mechanism for |
There was a problem hiding this comment.
issue: Same comment rule applies to tests: the regression note belongs in the it title or nowhere, and the line 182 comment repeats the assertion below it. Could both be removed?
Summary
Follow-up to #20955 (which closed #20957): that fix genuinely handles
prefers-reduced-motion, posters, and the mobile crop — but WCAG 2.2.2 needs a pause mechanism for every visitor, not only those whose OS preference is set, and the reduced-motion cohort ends up with no way to play the clips at all (never fetched, no controls). The Frame Generation tab's entire claim is smoothness, which a still frame cannot show (#20968).This adds a play/pause toggle to
VideoCompareSlider:aria-pressedtracks the autoplay intent (reads 'playing' for visitors who never touched it), and its label is composed from the localized before/after labels.Fixes #20968
Verification
VideoCompareSlider.test.ts— the toggle flipsaria-pressedand calls pause/play on both clips (spy-verified), and clicking it does not move the divider (aria-valuenowstays 50).vitest run src/components/common/VideoCompareSlider.test.ts: 16/16 pass (14 from fix(website): respect reduced motion and add posters on the Nvidia VFX page #20955 + 2 new).oxfmt --checkclean;eslintclean./iconsimport in its chain), so all 16 ran here.