mirror of
https://github.com/mattermost/mattermost-mobile.git
synced 2026-11-19 18:08:14 +00:00
Enable iOS 26 chrome on phone only: nested home stacks so tabs persist into channel/thread, floating compose and sheet layout, glass header actions, and scroll-edge patches to stop inverted post-list washout. Co-authored-by: Cursor <cursoragent@cursor.com>
105 lines
4.9 KiB
Diff
105 lines
4.9 KiB
Diff
diff --git a/node_modules/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm b/node_modules/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm
|
|
index 5720429..e19f715 100644
|
|
--- a/node_modules/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm
|
|
+++ b/node_modules/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm
|
|
@@ -46,11 +46,31 @@
|
|
[weakSelf setPrivateDelegate:delegate];
|
|
}];
|
|
[_delegateSplitter addDelegate:self];
|
|
+
|
|
+ if (@available(iOS 26.0, *)) {
|
|
+ // Inverted FlatLists + UIScrollEdgeEffect wash out chat content on iOS 26.
|
|
+ // Keep hidden even if RNScreens reapplies automatic edge effects later.
|
|
+ self.topEdgeEffect.hidden = YES;
|
|
+ self.bottomEdgeEffect.hidden = YES;
|
|
+ self.leftEdgeEffect.hidden = YES;
|
|
+ self.rightEdgeEffect.hidden = YES;
|
|
+ }
|
|
}
|
|
|
|
return self;
|
|
}
|
|
|
|
+- (void)layoutSubviews
|
|
+{
|
|
+ [super layoutSubviews];
|
|
+ if (@available(iOS 26.0, *)) {
|
|
+ self.topEdgeEffect.hidden = YES;
|
|
+ self.bottomEdgeEffect.hidden = YES;
|
|
+ self.leftEdgeEffect.hidden = YES;
|
|
+ self.rightEdgeEffect.hidden = YES;
|
|
+ }
|
|
+}
|
|
+
|
|
- (void)preserveContentOffsetWithBlock:(void (^)())block
|
|
{
|
|
if (!block) {
|
|
diff --git a/node_modules/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm b/node_modules/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm
|
|
index 15a5ab7..13373c6 100644
|
|
--- a/node_modules/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm
|
|
+++ b/node_modules/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm
|
|
@@ -446,6 +446,20 @@ static inline UIViewAnimationOptions animationOptionsWithCurve(UIViewAnimationCu
|
|
}
|
|
|
|
[super updateProps:props oldProps:oldProps];
|
|
+ [self mm_disableScrollEdgeEffectsIfInverted];
|
|
+}
|
|
+
|
|
+// iOS 26 UIScrollEdgeEffect + inverted chat lists paints the soft fade across the whole
|
|
+// flipped viewport (posts wash out). RNScreens may re-apply "automatic" after mount, so keep
|
|
+// forcing hidden. See: https://github.com/facebook/react-native/issues/54181
|
|
+- (void)mm_disableScrollEdgeEffectsIfInverted
|
|
+{
|
|
+ if (@available(iOS 26.0, *)) {
|
|
+ _scrollView.topEdgeEffect.hidden = YES;
|
|
+ _scrollView.bottomEdgeEffect.hidden = YES;
|
|
+ _scrollView.leftEdgeEffect.hidden = YES;
|
|
+ _scrollView.rightEdgeEffect.hidden = YES;
|
|
+ }
|
|
}
|
|
|
|
- (void)updateState:(const State::Shared &)state oldState:(const State::Shared &)oldState
|
|
@@ -834,6 +848,8 @@ static inline UIViewAnimationOptions animationOptionsWithCurve(UIViewAnimationCu
|
|
if (!self.window) {
|
|
// The view is being removed, ensure that the scroll end event is dispatched
|
|
[self _handleScrollEndIfNeeded];
|
|
+ } else {
|
|
+ [self mm_disableScrollEdgeEffectsIfInverted];
|
|
}
|
|
}
|
|
|
|
@@ -1087,13 +1103,14 @@ static inline UIViewAnimationOptions animationOptionsWithCurve(UIViewAnimationCu
|
|
if (horizontal) {
|
|
CGFloat deltaX = _firstVisibleView.frame.origin.x - _prevFirstVisibleFrame.origin.x;
|
|
if (ABS(deltaX) > 0.5) {
|
|
- CGFloat x = _scrollView.contentOffset.x;
|
|
+ CGFloat leftInset = [self isInverted] ? _scrollView.contentInset.right : _scrollView.contentInset.left;
|
|
+ CGFloat x = _scrollView.contentOffset.x + leftInset;
|
|
[self _forceDispatchNextScrollEvent];
|
|
_scrollView.contentOffset = CGPointMake(_scrollView.contentOffset.x + deltaX, _scrollView.contentOffset.y);
|
|
if (autoscrollThreshold) {
|
|
// If the offset WAS within the threshold of the start, animate to the start.
|
|
if (x <= autoscrollThreshold.value()) {
|
|
- [self scrollToOffset:CGPointMake(0, _scrollView.contentOffset.y) animated:YES];
|
|
+ [self scrollToOffset:CGPointMake(-leftInset, _scrollView.contentOffset.y) animated:YES];
|
|
}
|
|
}
|
|
}
|
|
@@ -1101,13 +1118,14 @@ static inline UIViewAnimationOptions animationOptionsWithCurve(UIViewAnimationCu
|
|
CGRect newFrame = _firstVisibleView.frame;
|
|
CGFloat deltaY = newFrame.origin.y - _prevFirstVisibleFrame.origin.y;
|
|
if (ABS(deltaY) > 0.5) {
|
|
- CGFloat y = _scrollView.contentOffset.y;
|
|
+ CGFloat bottomInset = [self isInverted] ? _scrollView.contentInset.top : _scrollView.contentInset.bottom;
|
|
+ CGFloat y = _scrollView.contentOffset.y + bottomInset;
|
|
[self _forceDispatchNextScrollEvent];
|
|
_scrollView.contentOffset = CGPointMake(_scrollView.contentOffset.x, _scrollView.contentOffset.y + deltaY);
|
|
if (autoscrollThreshold) {
|
|
// If the offset WAS within the threshold of the start, animate to the start.
|
|
if (y <= autoscrollThreshold.value()) {
|
|
- [self scrollToOffset:CGPointMake(_scrollView.contentOffset.x, 0) animated:YES];
|
|
+ [self scrollToOffset:CGPointMake(_scrollView.contentOffset.x, -bottomInset) animated:YES];
|
|
}
|
|
}
|
|
}
|