Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@
"buildFromSource": [
"expo-notifications",
"react-native-screens",
"react-native-reanimated",
"@react-native-menu/menu",
"expo-audio"
]
Expand Down
3 changes: 3 additions & 0 deletions apps/mobile/src/components/ComposerAttachmentButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ export function ComposerAttachmentButton(props: {

return (
<ControlPillMenu
accessible
accessibilityLabel="Add attachment"
accessibilityRole="button"
Comment thread
coderabbitai[bot] marked this conversation as resolved.
actions={ATTACHMENT_MENU_ACTIONS}
onPressAction={({ nativeEvent }) => {
if (nativeEvent.event === "photos") {
Expand Down
69 changes: 69 additions & 0 deletions patches/react-native-reanimated@4.5.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
diff --git a/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxyCommon.h b/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxyCommon.h
index 86035915aa330d2011e7c3027ae315c689e40f58..3d43e949550e1bc1311c38d11a7920c237a41018 100644
--- a/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxyCommon.h
+++ b/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxyCommon.h
@@ -22,6 +22,7 @@ struct LayoutAnimation {
Tag parentTag;
std::optional<double> opacity;
bool isViewAlreadyMounted = false;
+ bool isExitingWhenSettled = false;
int count = 1;
LayoutAnimation &operator=(const LayoutAnimation &other) = default;

diff --git a/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Experimental.cpp b/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Experimental.cpp
index bc62f8fc31a1d3b08353df514bf4f954c6279ceb..0c16264538a13ae8b7bd4fd11e1227d8580c5c65 100644
--- a/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Experimental.cpp
+++ b/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Experimental.cpp
@@ -290,6 +290,7 @@ std::optional<SurfaceId> LayoutAnimationsProxy_Experimental::endLayoutAnimation(
if (--layoutAnimation.count > 0) {
return {};
}
+ layoutAnimation.isExitingWhenSettled = shouldRemove;
Comment thread
coderabbitai[bot] marked this conversation as resolved.
maybeSettledAnimationTags_.insert(tag);
auto surfaceId = layoutAnimation.finalView.surfaceId;

@@ -407,7 +408,8 @@ void LayoutAnimationsProxy_Experimental::addOngoingAnimations(SurfaceId surfaceI

const auto layoutAnimationIt = layoutAnimations_.find(tag);

- if (layoutAnimationIt == layoutAnimations_.end() || layoutAnimationIt->second.isSettled()) {
+ if (layoutAnimationIt == layoutAnimations_.end() ||
+ (layoutAnimationIt->second.isSettled() && layoutAnimationIt->second.isExitingWhenSettled)) {
continue;
}

@@ -554,6 +556,8 @@ void LayoutAnimationsProxy_Experimental::maybeCancelAnimation(const int tag) con
}
if (layoutAnimationIt->second.isSettled()) {
// Already settled - cleanupAnimations will erase it together with its updateMap entry.
+ // Do not flush a pending Update after the caller queues this view for removal.
+ layoutAnimationIt->second.isExitingWhenSettled = true;
return;
}
layoutAnimations_.erase(layoutAnimationIt);
diff --git a/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Legacy.cpp b/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Legacy.cpp
index 9402e3e5ba4859ed344901b8b5884b9f708dd82b..2b1e4294ef798b7b6aabd04cc6663aae8297d034 100644
--- a/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Legacy.cpp
+++ b/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Legacy.cpp
@@ -119,6 +119,7 @@ std::optional<SurfaceId> LayoutAnimationsProxy_Legacy::endLayoutAnimation(int ta
if (--layoutAnimation.count > 0) {
return {};
}
+ layoutAnimation.isExitingWhenSettled = shouldRemove;
maybeSettledAnimationTags_.insert(tag);
auto surfaceId = layoutAnimation.finalView.surfaceId;

@@ -414,12 +415,7 @@ void LayoutAnimationsProxy_Legacy::addOngoingAnimations(SurfaceId surfaceId, Sha
auto layoutAnimationIt = layoutAnimations_.find(tag);

if (layoutAnimationIt == layoutAnimations_.end() ||
- // A settled animation is normally cleaned up without applying further
- // updates. The exception is a flaky entering animation whose opacity was
- // never restored (the view wasn't mounted in time) - we still need to
- // apply that pending opacity, otherwise the view stays invisible. Only
- // entering animations carry an opacity value.
- (layoutAnimationIt->second.isSettled() && !layoutAnimationIt->second.opacity.has_value())) {
+ (layoutAnimationIt->second.isSettled() && layoutAnimationIt->second.isExitingWhenSettled)) {
continue;
}

13 changes: 7 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ patchedDependencies:
react-native-gesture-handler@2.32.0: patches/react-native-gesture-handler@2.32.0.patch
react-native-keyboard-controller@1.21.13: patches/react-native-keyboard-controller@1.21.13.patch
react-native-nitro-modules@0.35.9: patches/react-native-nitro-modules@0.35.9.patch
# Preserve the final layout frame. Backport of [#10171](https://github.com/software-mansion/react-native-reanimated/pull/10171).
react-native-reanimated@4.5.1: patches/react-native-reanimated@4.5.1.patch
react-native-screens@4.26.2: patches/react-native-screens@4.26.2.patch
uniwind@1.11.0: patches/uniwind@1.11.0.patch

Expand Down
Loading