about summary refs log tree commit diff
path: root/modules/expo-scroll-forwarder
diff options
context:
space:
mode:
authorhailey <me@haileyok.com>2025-05-02 13:23:39 -0700
committerGitHub <noreply@github.com>2025-05-02 13:23:39 -0700
commit544f7befe0f7d3e61fb03365ec588a2ab3c5a17a (patch)
tree9d6276058aeeb44e77cba2b11bcc9e95cb8b7521 /modules/expo-scroll-forwarder
parent46ea3fdbeeab4e31657638955401145683738fbf (diff)
downloadvoidsky-544f7befe0f7d3e61fb03365ec588a2ab3c5a17a.tar.zst
bump it bop it upgrade it (rn 79/expo 53) (#8281)
* basic bumps

* more tweaking

* fix rn patch

* fix crop picker patch

* fix media library patch

* rm unnecessary patch

* fix notifications patch

* update bottomsheet

* Update withAppDelegateReferrer.js

* Delete withNoBundleCompression.js

* rm withNoBundleCompression plugin

* rm findLast shim

* metro package exports is enabled by default

* update react/react-dom/react-compiler

* fix reanimated issue

* vendor expo-ized emoji popup

* fix types

* hackfix view full thread

* Update EmojiPickerModule.podspec

* more upgrades

* fix multiformats package version

* add baseurl

* bump mmkv

* bumps

* update react-keyed-flatten-children

* bump locale packages

* fix emoji picker dark mode

* rn upgrades

* Revert "bump locale packages"

This reverts commit fc82f0f173032127dd7c18ed0316ae26f53db51d.

* upgrade testing-library

* rm test renderer

* update patch name minors

* rm findNodeHandle from tabbar

* only do scrollview tag thing on ios

* disable package exports

* update expo notifications handler

* memoize emoji picker styles

* fix tests, mock multiformats

* bump some dev deps with RC versions

* completely rearchitect toasts

* rm logs

* layout animation config for composer footer

* disable autolinking for patched libs

* undo lingui changes

* version bump from release candidate to 0.1

* update atproto deps

* rm @did-plc/server

* fix key issue (maybe)

* move URL polyfill to the polyfill file

* fix yarn lock

* upgrade to 53.0.3

* reanimated layout anim bug patch

* workletize a function that wasn't getting autoworkletized anymore (#8309)

* bump to expo 53.0.4

* bump RN to 0.79.2

* fix yarn lock ci

* Revert "completely rearchitect toasts"

This reverts commit 2e2fcaeeed527580a6c485718544b85e8b4f52b9.

* final upgrades

* chore: cleanup yarn lock

* prettier

---------

Co-authored-by: Samuel Newman <mozzius@protonmail.com>
Diffstat (limited to 'modules/expo-scroll-forwarder')
-rw-r--r--modules/expo-scroll-forwarder/ios/ExpoScrollForwarderView.swift43
-rw-r--r--modules/expo-scroll-forwarder/src/ExpoScrollForwarder.types.ts2
-rw-r--r--modules/expo-scroll-forwarder/src/ExpoScrollForwarderView.ios.tsx3
-rw-r--r--modules/expo-scroll-forwarder/src/ExpoScrollForwarderView.tsx4
4 files changed, 32 insertions, 20 deletions
diff --git a/modules/expo-scroll-forwarder/ios/ExpoScrollForwarderView.swift b/modules/expo-scroll-forwarder/ios/ExpoScrollForwarderView.swift
index 15993ef29..e6ebef1d3 100644
--- a/modules/expo-scroll-forwarder/ios/ExpoScrollForwarderView.swift
+++ b/modules/expo-scroll-forwarder/ios/ExpoScrollForwarderView.swift
@@ -9,7 +9,7 @@ class ExpoScrollForwarderView: ExpoView, UIGestureRecognizerDelegate {
     }
   }
 
-  private var rctScrollView: RCTScrollView?
+  private var scrollView: UIScrollView?
   private var rctRefreshCtrl: RCTRefreshControl?
   private var cancelGestureRecognizers: [UIGestureRecognizer]?
   private var animTimer: Timer?
@@ -68,7 +68,7 @@ class ExpoScrollForwarderView: ExpoView, UIGestureRecognizerDelegate {
   }
 
   @IBAction func callOnPan(_ sender: UIPanGestureRecognizer) {
-    guard let rctsv = self.rctScrollView, let sv = rctsv.scrollView else {
+    guard let sv = self.scrollView else {
       return
     }
 
@@ -113,7 +113,7 @@ class ExpoScrollForwarderView: ExpoView, UIGestureRecognizerDelegate {
   }
 
   func startDecayAnimation(_ translation: CGFloat, _ velocity: CGFloat) {
-    guard let sv = self.rctScrollView?.scrollView else {
+    guard let sv = self.scrollView else {
       return
     }
 
@@ -160,32 +160,49 @@ class ExpoScrollForwarderView: ExpoView, UIGestureRecognizerDelegate {
 
     return offset
   }
-
-  func tryFindScrollView() {
-    guard let scrollViewTag = scrollViewTag else {
-      return
+  
+  private func findScrollView(in view: UIView, foundCount: Int) -> UIScrollView? {
+    var foundCount = foundCount
+    if let sv = view as? UIScrollView { return sv }
+    for child in view.subviews {
+      if let found = findScrollView(in: child, foundCount: foundCount) {
+        if foundCount == 1 {
+          print("found sv: \(found)")
+//          return found
+        } else {
+          print("found sv: \(found)")
+          foundCount += 1
+        }
+      }
     }
+    return nil
+  }
 
+  func tryFindScrollView() {
     // Before we switch to a different scrollview, we always want to remove the cancel gesture recognizer.
     // Otherwise we might end up with duplicates when we switch back to that scrollview.
     self.removeCancelGestureRecognizers()
+    
+    guard let sv = self.findScrollView(in: self.superview!.superview!.superview!, foundCount: 0) else {
+      print("⚠️ ExpoScrollForwarder: couldn’t find UIScrollView under tag \(tag)")
+      return
+    }
 
-    self.rctScrollView = self.appContext?
-      .findView(withTag: scrollViewTag, ofType: RCTScrollView.self)
-    self.rctRefreshCtrl = self.rctScrollView?.scrollView.refreshControl as? RCTRefreshControl
+    self.scrollView = sv
+    self.rctRefreshCtrl = sv.refreshControl as? RCTRefreshControl
 
     self.addCancelGestureRecognizers()
   }
 
   func addCancelGestureRecognizers() {
     self.cancelGestureRecognizers?.forEach { r in
-      self.rctScrollView?.scrollView?.addGestureRecognizer(r)
+      self.scrollView?.addGestureRecognizer(r)
     }
   }
 
   func removeCancelGestureRecognizers() {
     self.cancelGestureRecognizers?.forEach { r in
-      self.rctScrollView?.scrollView?.removeGestureRecognizer(r)
+      self.scrollView?.removeGestureRecognizer(r)
     }
   }
 
@@ -202,7 +219,7 @@ class ExpoScrollForwarderView: ExpoView, UIGestureRecognizerDelegate {
   }
 
   func scrollToOffset(_ offset: Int, animated: Bool = true) {
-    self.rctScrollView?.scroll(toOffset: CGPoint(x: 0, y: offset), animated: animated)
+    self.scrollView?.scrollRectToVisible(CGRect(x: 0, y: offset, width: 0, height:  0), animated: animated)
   }
 
   func stopTimer() {
diff --git a/modules/expo-scroll-forwarder/src/ExpoScrollForwarder.types.ts b/modules/expo-scroll-forwarder/src/ExpoScrollForwarder.types.ts
index 26b9e7553..3f1e4a63d 100644
--- a/modules/expo-scroll-forwarder/src/ExpoScrollForwarder.types.ts
+++ b/modules/expo-scroll-forwarder/src/ExpoScrollForwarder.types.ts
@@ -1,5 +1,3 @@
-import React from 'react'
-
 export interface ExpoScrollForwarderViewProps {
   scrollViewTag: number | null
   children: React.ReactNode
diff --git a/modules/expo-scroll-forwarder/src/ExpoScrollForwarderView.ios.tsx b/modules/expo-scroll-forwarder/src/ExpoScrollForwarderView.ios.tsx
index 21a2b9fb2..18bdb25c8 100644
--- a/modules/expo-scroll-forwarder/src/ExpoScrollForwarderView.ios.tsx
+++ b/modules/expo-scroll-forwarder/src/ExpoScrollForwarderView.ios.tsx
@@ -1,7 +1,6 @@
-import * as React from 'react'
 import {requireNativeViewManager} from 'expo-modules-core'
 
-import {ExpoScrollForwarderViewProps} from './ExpoScrollForwarder.types'
+import {type ExpoScrollForwarderViewProps} from './ExpoScrollForwarder.types'
 
 const NativeView: React.ComponentType<ExpoScrollForwarderViewProps> =
   requireNativeViewManager('ExpoScrollForwarder')
diff --git a/modules/expo-scroll-forwarder/src/ExpoScrollForwarderView.tsx b/modules/expo-scroll-forwarder/src/ExpoScrollForwarderView.tsx
index 0f5d01c13..d66eef7cb 100644
--- a/modules/expo-scroll-forwarder/src/ExpoScrollForwarderView.tsx
+++ b/modules/expo-scroll-forwarder/src/ExpoScrollForwarderView.tsx
@@ -1,6 +1,4 @@
-import React from 'react'
-
-import {ExpoScrollForwarderViewProps} from './ExpoScrollForwarder.types'
+import {type ExpoScrollForwarderViewProps} from './ExpoScrollForwarder.types'
 
 export function ExpoScrollForwarderView({
   children,