Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Replace hackfix for gestures with upstream fix (#7503)

* Bump pager

* Revert "[Android] Try to disambiguate taps from swipes (#7448)"

This reverts commit 96054f4addb63994b3d2f5fe1d288f4dd3c246c2.

---------

Co-authored-by: gpp-0 <gpp.cat.io@gmail.com>

authored by

dan
gpp-0
and committed by
GitHub
bf95345b 5090426f

+49 -49
+1 -1
package.json
··· 179 179 "react-native-ios-context-menu": "^1.15.3", 180 180 "react-native-keyboard-controller": "^1.14.5", 181 181 "react-native-mmkv": "^2.12.2", 182 - "react-native-pager-view": "6.6.1", 182 + "react-native-pager-view": "6.7.0", 183 183 "react-native-picker-select": "^9.3.1", 184 184 "react-native-progress": "bluesky-social/react-native-progress", 185 185 "react-native-qrcode-styled": "^0.3.3",
+2 -40
src/view/com/pager/Pager.tsx
··· 1 - import React, {Children, forwardRef, useCallback, useContext} from 'react' 1 + import React, {forwardRef, useCallback, useContext} from 'react' 2 2 import {View} from 'react-native' 3 3 import {DrawerGestureContext} from 'react-native-drawer-layout' 4 4 import {Gesture, GestureDetector} from 'react-native-gesture-handler' ··· 17 17 } from 'react-native-reanimated' 18 18 import {useFocusEffect} from '@react-navigation/native' 19 19 20 - import {isAndroid} from '#/platform/detection' 21 20 import {useSetDrawerSwipeDisabled} from '#/state/shell' 22 21 import {atoms as a, native} from '#/alf' 23 22 ··· 149 148 style={[a.flex_1]} 150 149 initialPage={initialPage} 151 150 onPageScroll={handlePageScroll}> 152 - {isAndroid 153 - ? Children.map(children, child => ( 154 - <CaptureSwipesAndroid>{child}</CaptureSwipesAndroid> 155 - )) 156 - : children} 151 + {children} 157 152 </AnimatedPagerView> 158 153 </GestureDetector> 159 154 </View> 160 155 ) 161 156 }, 162 157 ) 163 - 164 - // HACK. 165 - // This works around https://github.com/callstack/react-native-pager-view/issues/960. 166 - // It appears that the Pressables inside the pager get confused if there's enough work 167 - // happening on the JS thread, and mistakingly interpret a pager swipe as a tap. 168 - // We can prevent this by stealing all horizontal movements from the tree inside. 169 - function CaptureSwipesAndroid({children}: {children: React.ReactNode}) { 170 - const lastTouchStart = React.useRef<{x: number; y: number} | null>(null) 171 - return ( 172 - <View 173 - onTouchStart={e => { 174 - lastTouchStart.current = { 175 - x: e.nativeEvent.pageX, 176 - y: e.nativeEvent.pageY, 177 - } 178 - }} 179 - onMoveShouldSetResponderCapture={e => { 180 - const coords = lastTouchStart.current 181 - if (!coords) { 182 - return false 183 - } 184 - const dx = Math.abs(e.nativeEvent.pageX - coords.x) 185 - if (dx > 0) { 186 - // This is a horizontal movement and will result in a swipe. 187 - // Prevent pager children from receiving this touch. 188 - return true 189 - } 190 - return false 191 - }}> 192 - {children} 193 - </View> 194 - ) 195 - } 196 158 197 159 function usePagerHandlers( 198 160 handlers: {
+46 -8
yarn.lock
··· 3290 3290 "@babel/parser" "^7.25.9" 3291 3291 "@babel/types" "^7.25.9" 3292 3292 3293 - "@babel/traverse--for-generate-function-map@npm:@babel/traverse@^7.25.3", "@babel/traverse@^7.25.3", "@babel/traverse@^7.25.9": 3293 + "@babel/traverse--for-generate-function-map@npm:@babel/traverse@^7.25.3": 3294 3294 version "7.25.9" 3295 3295 resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.25.9.tgz#a50f8fe49e7f69f53de5bea7e413cd35c5e13c84" 3296 3296 integrity sha512-ZCuvfwOwlz/bawvAuvcj8rrithP2/N55Tzz342AkTvq4qaWbGfmCk/tKhNaV2cthijKrPAA8SRJV5WWe7IBMJw== ··· 3348 3348 "@babel/helper-split-export-declaration" "^7.24.5" 3349 3349 "@babel/parser" "^7.24.5" 3350 3350 "@babel/types" "^7.24.5" 3351 + debug "^4.3.1" 3352 + globals "^11.1.0" 3353 + 3354 + "@babel/traverse@^7.25.3", "@babel/traverse@^7.25.9": 3355 + version "7.25.9" 3356 + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.25.9.tgz#a50f8fe49e7f69f53de5bea7e413cd35c5e13c84" 3357 + integrity sha512-ZCuvfwOwlz/bawvAuvcj8rrithP2/N55Tzz342AkTvq4qaWbGfmCk/tKhNaV2cthijKrPAA8SRJV5WWe7IBMJw== 3358 + dependencies: 3359 + "@babel/code-frame" "^7.25.9" 3360 + "@babel/generator" "^7.25.9" 3361 + "@babel/parser" "^7.25.9" 3362 + "@babel/template" "^7.25.9" 3363 + "@babel/types" "^7.25.9" 3351 3364 debug "^4.3.1" 3352 3365 globals "^11.1.0" 3353 3366 ··· 16040 16053 resolved "https://registry.yarnpkg.com/react-native-mmkv/-/react-native-mmkv-2.12.2.tgz#4bba0f5f04e2cf222494cce3a9794ba6a4894dee" 16041 16054 integrity sha512-6058Aq0p57chPrUutLGe9fYoiDVDNMU2PKV+lLFUJ3GhoHvUrLdsS1PDSCLr00yqzL4WJQ7TTzH+V8cpyrNcfg== 16042 16055 16043 - react-native-pager-view@6.6.1: 16044 - version "6.6.1" 16045 - resolved "https://registry.yarnpkg.com/react-native-pager-view/-/react-native-pager-view-6.6.1.tgz#6b69c8801ddee8d122b121b6fb42e0a180c8ebb9" 16046 - integrity sha512-2dFulYs8JxEUecemv1PGWCUv+ZQuwSaQfFiSr2++KH8km5HzpuS8vJ3MVb0M6UhpqacFDj9OGe7z97ks/mr7gA== 16056 + react-native-pager-view@6.7.0: 16057 + version "6.7.0" 16058 + resolved "https://registry.yarnpkg.com/react-native-pager-view/-/react-native-pager-view-6.7.0.tgz#88f2520e85f07ce55f3f56c57d6637249a215160" 16059 + integrity sha512-sutxKiMqBuQrEyt4mLaLNzy8taIC7IuYpxfcwQBXfSYBSSpAa0qE9G1FXlP/iXqTSlFgBXyK7BESsl9umOjECQ== 16047 16060 16048 16061 react-native-picker-select@^9.3.1: 16049 16062 version "9.3.1" ··· 17535 17548 resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4" 17536 17549 integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw== 17537 17550 17538 - "string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: 17551 + "string-width-cjs@npm:string-width@^4.2.0": 17552 + version "4.2.3" 17553 + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" 17554 + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== 17555 + dependencies: 17556 + emoji-regex "^8.0.0" 17557 + is-fullwidth-code-point "^3.0.0" 17558 + strip-ansi "^6.0.1" 17559 + 17560 + string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: 17539 17561 version "4.2.3" 17540 17562 resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" 17541 17563 integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== ··· 17635 17657 dependencies: 17636 17658 safe-buffer "~5.1.0" 17637 17659 17638 - "strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: 17660 + "strip-ansi-cjs@npm:strip-ansi@^6.0.1": 17639 17661 version "6.0.1" 17640 17662 resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" 17641 17663 integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== ··· 17648 17670 integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== 17649 17671 dependencies: 17650 17672 ansi-regex "^4.1.0" 17673 + 17674 + strip-ansi@^6.0.0, strip-ansi@^6.0.1: 17675 + version "6.0.1" 17676 + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" 17677 + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== 17678 + dependencies: 17679 + ansi-regex "^5.0.1" 17651 17680 17652 17681 strip-ansi@^7.0.1: 17653 17682 version "7.1.0" ··· 18923 18952 resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" 18924 18953 integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q== 18925 18954 18926 - "wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: 18955 + "wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": 18927 18956 version "7.0.0" 18928 18957 resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" 18929 18958 integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== ··· 18936 18965 version "6.2.0" 18937 18966 resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" 18938 18967 integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== 18968 + dependencies: 18969 + ansi-styles "^4.0.0" 18970 + string-width "^4.1.0" 18971 + strip-ansi "^6.0.0" 18972 + 18973 + wrap-ansi@^7.0.0: 18974 + version "7.0.0" 18975 + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" 18976 + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== 18939 18977 dependencies: 18940 18978 ansi-styles "^4.0.0" 18941 18979 string-width "^4.1.0"