Skip to content

ScreenFooter - add animationType#3994

Merged
M-i-k-e-l merged 13 commits intomasterfrom
fix/screen-footer-animation-type
May 11, 2026
Merged

ScreenFooter - add animationType#3994
M-i-k-e-l merged 13 commits intomasterfrom
fix/screen-footer-animation-type

Conversation

@M-i-k-e-l
Copy link
Copy Markdown
Collaborator

@M-i-k-e-l M-i-k-e-l commented May 5, 2026

Description

ScreenFooter - add animationType
Review each commit separately

Note:
There was another solution created by Ziv: #3987 however I feel like it is more bug prone; and even though this solution requires the user to change the animation from slide to fade (approved by UX) it is overall safer.

Changelog

ScreenFooter - add animationType ['slide' (default) | 'fade' | 'none']

Additional info

Ticket 5037

@M-i-k-e-l M-i-k-e-l requested a review from lidord-wix May 5, 2026 08:03
@M-i-k-e-l M-i-k-e-l added the Important for Next Release PR that must be included in the release version label May 5, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

✅ PR Description Validation Passed

All required sections are properly filled out:

  • Description
  • Changelog
  • Additional info

Your PR is good for review! 🚀


This validation ensures all sections from the PR template are properly filled.

Copy link
Copy Markdown
Collaborator

@lidord-wix lidord-wix left a comment

Choose a reason for hiding this comment

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

Looks good, I added some comments, most of them are small or not so important but worth fixing :)

Comment on lines +412 to +413
<View flex />
</View>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this is minor, but you can remove these two Views and pass containerStyle={styles.rowContainer} to the SegmentedControl instead

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I copy-pasted the other parts, technically it should be using ExampleScreenPresenter all over this

isAndroidEdgeToEdge = !!androidVersion && androidVersion >= 35 ? true : undefined
} = props;

const animationType = animationDurationProp === 0 ? 'none' : animationTypeProp;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

animationType (a plain JS value) is used inside useAnimatedStyle, but Reanimated worklet closures capture the value at creation time. Since animationType is derived from props and can change, the worklet will reference a stale value.
If the user switches from 'slide' to 'fade' at runtime, the worklet may still branch on the old value. Consider using a useSharedValue for animationType and updating it in a useEffect, so the worklet always reads the current value. Same concern applies to keyboardBehavior.

IMO it's not a common case but worth fixing it

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

What is the possible bug?
The animationType is changed in the screen and it works as expected.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It reproduces in the screen with Hide on Scroll

});

const [height, setHeight] = useState(0);
const animatedValue = useSharedValue(animationType === 'fade' && visible ? 1 : 0);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

When animationType='slide' and visible=false, the initial animatedValue is 0 — but for slide, hidden state means animatedValue = height. Since height starts at 0, the footer will briefly flash visible until the first layout fires and useEffect updates the value. This is likely a subtle flash-of-content bug on mount.
You can see it in the FloatingButtonScreen, change visible initial value to false and add animationType='slide'

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

To fix this we'll probably need a bigger change like I've mentioned in the PR description.
#3987 by Ziv might fix it but it's riskier (bigger regression chance) IMO

Comment thread packages/react-native-ui-lib/src/components/screenFooter/index.tsx Outdated
Comment thread packages/react-native-ui-lib/src/components/screenFooter/screenFooter.api.json Outdated
@lidord-wix lidord-wix assigned M-i-k-e-l and unassigned lidord-wix May 11, 2026
@M-i-k-e-l M-i-k-e-l merged commit 22c3805 into master May 11, 2026
3 checks passed
@M-i-k-e-l M-i-k-e-l deleted the fix/screen-footer-animation-type branch May 11, 2026 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Important for Next Release PR that must be included in the release version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants