Skip to content

Fix e2e on 11.12#560

Open
YogendraShelke wants to merge 6 commits into
mx/11.12.xfrom
update-screenshot-11.12
Open

Fix e2e on 11.12#560
YogendraShelke wants to merge 6 commits into
mx/11.12.xfrom
update-screenshot-11.12

Conversation

@YogendraShelke

@YogendraShelke YogendraShelke commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes three defects in IntroScreen's slide-position handling, all rooted in how SwipeableContainer reconciled activeIndex (React state) with the FlashList's real scroll offset. The previous code used an isInitializing flag flipped by a double requestAnimationFrame, which guessed at timing instead of tracking what was actually requested.

Problems Fixed

Problem 1

Reopening a page showed slide 1 instead of the slide in the Active slide attribute, and fired a spurious On slide change back to slide 1

Root cause

activeIndex initialized to 0 while initialScrollIndex rendered the attribute's slide, so state and screen disagreed on mount. The effect only re-scrolled when slide !== activeIndex, so a matching-but-wrong state was never

Fix

Seed activeIndex from the attribute via a useState initializer, and force the positioning scroll once on the first pass where width is known (hasAppliedInitialScroll), independent of whether activeIndex already matches


Problem 2

The initial slide was reached with an animation, briefly leaving slide content unreachable for TalkBack/VoiceOver

Root cause

goToSlide always animated. activeIndex applies immediately and drives accessibilityElementsHidden / importantForAccessibility, so the slide exposed to screen readers was off-screen until the animation landed

Fix

goToSlide(pageNum, animated = true); the initial jump passes animated: false


Problem 3

Using Next / Previous / pagination could snap back to slide 1 and report an extra slide change

Root cause

onMomentumScrollEnd fires for programmatic scrolls too, reporting the offset the list is leaving rather than the one it's heading to. That stale offset overwrote activeIndex and re-fired onSlideChange. A drag flag alone can't disambiguate: it's only cleared inside onMomentumScrollEnd, so a drag that produces no momentum event leaves it stuck true, and the next programmatic scroll's stale event is misread as a user swipe

Fix

Track pendingScrollTarget — the slide goToSlide actually requested. onMomentumScrollEnd ignores any event whose index disagrees with that target, clearing it once reached. onScrollBeginDrag clears the target so a user taking over is always honoured, which also prevents the target latching when a scroll emits no momentum event

@YogendraShelke
YogendraShelke requested a review from a team as a code owner July 23, 2026 07:23
@YogendraShelke
YogendraShelke force-pushed the update-screenshot-11.12 branch from 7aac144 to 6eed515 Compare July 24, 2026 11:39
chore: fix tests

chore: update ios test timeout

chore: inrease maestro driver setup timeout

chore: address flaky tests

chore: fix tests

chore: revert

chore: revert
@YogendraShelke
YogendraShelke force-pushed the update-screenshot-11.12 branch from 6eed515 to b6be27f Compare July 24, 2026 11:46
@YogendraShelke YogendraShelke changed the title chore: inrease maestro driver setup timeout Fix e2e on 11.12 Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants