Skip to content

[MWPW-199341] Reduce motion effect when applied not seen working on carousel#6295

Open
SamSawant876 wants to merge 2 commits into
stagefrom
MWPW-199341-firefly-carousal-fix
Open

[MWPW-199341] Reduce motion effect when applied not seen working on carousel#6295
SamSawant876 wants to merge 2 commits into
stagefrom
MWPW-199341-firefly-carousal-fix

Conversation

@SamSawant876

@SamSawant876 SamSawant876 commented Jul 14, 2026

Copy link
Copy Markdown

Changes:

  • Replaced the index-based isSlideVisible() check with getOverlapRatio(), which compares a video's getBoundingClientRect() against the carousel wrapper's clipped (overflow: hidden) bounds.
  • Added VISIBILITY_THRESHOLD (0.5) — a slide's video only stays exempt from pausing if at least half of it is still visible in the wrapper, so a hinting layout's partial "peek" of a neighboring slide doesn't count as fully in view.
  • checkSlideForVideo() / pauseVideosOutOfView() now run against every slide instead of only the previously-active one, so a video started on a peeking/inactive slide is no longer invisible to the pause check.
  • Added waitForSlideTransition() so the visibility check runs once the slide track's transform transition actually settles (with a TRANSITION_FALLBACK_MS timeout as a safety net), guarded to the track's own transform property so a child slide's own opacity transition can't resolve it early.
  • Added test coverage for the visibility-ratio thresholds and the boundary-path pause call.

Expected video behaviour:

Reduce motion on: Videos do not auto-play on arrow navigation, user must click play.
User clicks play: Video plays while its slide remains sufficiently visible in the carousel viewport.
User swipes / navigates away (either direction): Video's slide is no longer sufficiently visible and is paused.
Navigation blocked at a disable-circular-nav boundary: A playing video that's actually out of view still gets paused, even though the active slide didn't change.
Slide returns to view: Video stays paused, it does not auto-resume. User must click play again.

Test URLs:

Before: https://main--da-cc--adobecom.aem.live/products/firefly/features/image-to-video
After: https://main--da-cc--adobecom.aem.live/products/firefly/features/image-to-video?milolibs=mwpw-199341-firefly-carousal-fix

Resolves: Resolves: MWPW-199341

@SamSawant876
SamSawant876 requested a review from rgclayton as a code owner July 14, 2026 15:45
@aem-code-sync

aem-code-sync Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch.
In case there are problems, just click the checkbox below to rerun the respective action.

  • Re-sync branch
Commits

@SamSawant876 SamSawant876 changed the title Mwpw 199341 firefly carousal fix [MWPW-199341] Reduce motion effect when applied not seen working on carousel Jul 14, 2026
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