Skip to content

Conversation

kmagiera
Copy link
Contributor

@kmagiera kmagiera commented Oct 2, 2025

This PR fixes an issue with the sticky day selector jumping intermittently when scrolling past the top position of the selector.

One change is to use Animated.FlatList component as opposed to creating one using Animated.createAnimatedComponent. The version that reanimated exports has the throttling defaults set properly such that it avoids event throttling.

In addition, we enable feature flags in react native and reanimated that results in the direct ui thread updates from being delayed. Read more here: https://docs.swmansion.com/react-native-reanimated/docs/guides/feature-flags/#disable_commit_pausing_mechanism

@betomoedano betomoedano self-requested a review October 2, 2025 22:21
Copy link
Contributor

@betomoedano betomoedano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tested this on a physical device and the issue is fixed!

LGTM

@kmagiera
Copy link
Contributor Author

kmagiera commented Oct 3, 2025

Apparently this will require native update and also effectively turns off the iOS prebuilds for the project. I hope the flag will be enabled in the next RN release though

} from "@/components/CurrentlyLive";

const AnimatedFlatList = Animated.createAnimatedComponent(FlatList) as FlatList;
const AnimatedFlatList = Animated.FlatList;
Copy link
Contributor

@sync sync Oct 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like just the change to this file fixes the sticky header jumping (using react-native FlatList), without having to change app.config.ts and package.json

Copy link
Member

@hirbod hirbod Oct 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That change will definitely not fix the issue, its more like this one optimized it (but its still happening randomly): c4509a4

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unfortunately both of these updates are necessary. The changes from c4509a4 while offload the JS thread communication they still don't impact the UI updates from being applied on time. I updated the PR description with some links so you can learn more why these changes are necessary

Copy link
Member

@hirbod hirbod Oct 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kmagiera can you elaborate on "has the throttling defaults set properly"? The only thing I see is that it sets scrollEventThrottle to 1 instead of 50 (and only if not overwritten).

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.

4 participants