Fix e2e on 11.12#560
Open
YogendraShelke wants to merge 6 commits into
Open
Conversation
YogendraShelke
force-pushed
the
update-screenshot-11.12
branch
from
July 24, 2026 11:39
7aac144 to
6eed515
Compare
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
force-pushed
the
update-screenshot-11.12
branch
from
July 24, 2026 11:46
6eed515 to
b6be27f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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