The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 22, 23:15 UTC
fix(mobile): Android image viewer keeps panning after an interrupted pinch (#19241)
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Quy Ngoc Nguyen committed
Oct 20, 2026 at 11:18 UTC
c5520b52ecbaeb63f68d8c44774a75f21444f2fe
2 files changed
+20
-6
patches/react-native-image-viewing@0.2.2.patch
+17
-3
@@ -89,12 +89,16 @@ index 5fcaa9f9a7d893817fee89b85186ee3936118e69..3effe838fa54495d165b81cc7501e72d
89
const imageContainer = useRef(null);
90
const imageDimensions = useImageDimensions(imageSrc);
91
const [translate, scale] = getImageTransform(imageDimensions, SCREEN);
92
-@@ -31,7 +31,7 @@ const ImageItem = ({ imageSrc, onZoom, onRequestClose, onLongPress, delayLongPre
93
- scrollEnabled: !isZoomed,
92
+@@ -28,10 +28,10 @@ const ImageItem = ({ imageSrc, onZoom, onRequestClose, onLongPress, delayLongPre
93
+ onZoom(isZoomed);
94
+ if ((_a = imageContainer) === null || _a === void 0 ? void 0 : _a.current) {
95
+ imageContainer.current.setNativeProps({
96
+- scrollEnabled: !isZoomed,
97
++ scrollEnabled: swipeToCloseEnabled && !isZoomed,
98
});
99
}
100
- }, [imageContainer]);
97
-+ }, [imageContainer, onZoom]);
101
++ }, [imageContainer, onZoom, swipeToCloseEnabled]);
102
const onLongPressHandler = useCallback(() => {
103
onLongPress(imageSrc);
104
}, [imageSrc, onLongPress]);
@@ -272,3 +276,13 @@ index 99dcbc7efea4eba86a8bc2bad71dde73c8ebf1b4..3a374c0923879548ec3826a78be16f79
276
let numberInitialTouches = 1;
277
let initialTouches = [];
278
let currentScale = initialScale;
279
+@@ -266,6 +266,9 @@ const usePanResponder = ({ initialScale, initialTranslate, onZoom, doubleTapToZo
280
+ tmpTranslate = null;
281
+ }
282
+ },
283
++ // A gesture taken over mid-pinch must commit like a release, or pans stay
284
++ // gated on the pre-pinch scale while the image still shows zoomed.
285
++ onTerminate: () => handlers.onRelease(),
286
+ };
287
+ const panResponder = useMemo(() => createPanResponder(handlers), [handlers]);
288
+ return [panResponder.panHandlers, scaleValue, translateValue];
pnpm-lock.yaml
+3
-3
@@ -189,7 +189,7 @@ patchedDependencies:
189
micromark-extension-llm-math@3.1.0: 49ab4815c18b003f6af998dcc6c258c17a21b50b2cc87745f12d4bd8b6d591f9
190
node-pty@1.2.0-beta.15: f1e680afec85f650699ea756f91f469844ec4c976f4f168492a45c6b3f67d651
191
react-native-gesture-handler@3.3.0: abe20e1d1c23549297cbbc818e14fe479b41455930d9663135d6b40fe359b626
192
- react-native-image-viewing@0.2.2: a479085493f2404ecdefea18f46c6be3ad49cfb54da8e78dc7746651263cb5a0
192
+ react-native-image-viewing@0.2.2: 419f35ee91eac88ced9438058281db5eb09d9c799d8974c1172926068c9448cf
193
react-native-keyboard-controller@1.22.7: f28d08f1233e3cce8b9324b4357d2b10f1ee040b8051bc87235b0fb95069b9bb
194
react-native-pdf-jsi@5.0.0: 6f52854210f61bef499850ebd498229a111bc34ec5b2a4925e644f2f48f42760
195
react-native-webview@14.0.1: 81caa279ec3dc1f81209062133b66e8f824e13f106cca57f1fa732a72c2ab378
@@ -574,7 +574,7 @@ importers:
574
version: 3.3.0(patch_hash=abe20e1d1c23549297cbbc818e14fe479b41455930d9663135d6b40fe359b626)(react-native@0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0)
575
react-native-image-viewing:
576
specifier: ^0.2.2
577
- version: 0.2.2(patch_hash=a479085493f2404ecdefea18f46c6be3ad49cfb54da8e78dc7746651263cb5a0)(react-native@0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0)
577
+ version: 0.2.2(patch_hash=419f35ee91eac88ced9438058281db5eb09d9c799d8974c1172926068c9448cf)(react-native@0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0)
578
react-native-keyboard-controller:
579
specifier: 1.22.7
580
version: 1.22.7(patch_hash=f28d08f1233e3cce8b9324b4357d2b10f1ee040b8051bc87235b0fb95069b9bb)(react-native-reanimated@4.7.1(react-native-worklets@0.13.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(react-native@0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0))(react-native@0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0))(react-native@0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0)
@@ -22604,7 +22604,7 @@ snapshots:
22604
react: 19.3.0
22605
react-native: 0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6)
22606
22607
- react-native-image-viewing@0.2.2(patch_hash=a479085493f2404ecdefea18f46c6be3ad49cfb54da8e78dc7746651263cb5a0)(react-native@0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0):
22607
+ react-native-image-viewing@0.2.2(patch_hash=419f35ee91eac88ced9438058281db5eb09d9c799d8974c1172926068c9448cf)(react-native@0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0):
22608
dependencies:
22609
react: 19.3.0
22610
react-native: 0.88.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6)