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, 00:45 UTC
fix(mobile): the chat inset resets after the keyboard closes while frozen (#33501)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Julius Marminge committed
Nov 9, 2026 at 11:21 UTC
f6203ffbc69e8126433084cf958dcce1becd647c
2 files changed
+143
-9
patches/react-native-keyboard-controller@1.23.0.patch
+140
-6
@@ -86,7 +86,7 @@ index ae97d611a7f727ebbb0e17eabbb3294e1cc76a2f..2ea1d2ddd3fac6ad418d97c700ab885f
86
@objc public init(
87
handler: @escaping (NSString, NSNumber, NSNumber, NSNumber, NSNumber) -> Void,
88
diff --git a/lib/commonjs/components/KeyboardChatScrollView/index.js b/lib/commonjs/components/KeyboardChatScrollView/index.js
89
-index 0b78ff38d8f0a2360632df3d9988c0c32bd56b99..98b3b6cd71626fae57e83b214ebfb2a58850879a 100644
89
+index 0b78ff38d8f0a2360632df3d9988c0c32bd56b99..9600d6c8ac857a3f56753f49b5a52e3eb830eaba 100644
90
--- a/lib/commonjs/components/KeyboardChatScrollView/index.js
91
+++ b/lib/commonjs/components/KeyboardChatScrollView/index.js
92
@@ -28,9 +28,12 @@ const KeyboardChatScrollView = /*#__PURE__*/(0, _react.forwardRef)(({
@@ -120,7 +120,17 @@ index 0b78ff38d8f0a2360632df3d9988c0c32bd56b99..98b3b6cd71626fae57e83b214ebfb2a5
120
scroll,
121
layout,
122
size,
123
-@@ -91,10 +98,26 @@ const KeyboardChatScrollView = /*#__PURE__*/(0, _react.forwardRef)(({
123
+@@ -72,7 +79,8 @@ const KeyboardChatScrollView = /*#__PURE__*/(0, _react.forwardRef)(({
124
+ (0, _useFrozenPadding.useFrozenPadding)({
125
+ freeze: freezeSV,
126
+ offset,
127
+- padding
128
++ padding,
129
++ currentHeight
130
+ });
131
+ (0, _useEndVisible.useEndVisible)({
132
+ scroll,
133
+@@ -91,10 +99,26 @@ const KeyboardChatScrollView = /*#__PURE__*/(0, _react.forwardRef)(({
134
// a bug for you, please open an issue.
135
const totalPadding = (0, _reanimated.useDerivedValue)(() => Math.min(layout.value.height, Math.max(blankSpace.value, padding.value + extraContentPadding.value)));
136
@@ -320,6 +330,31 @@ index 1c2912e70a1a0c4a75ae8ec4cfbc4d7fa7bc6b83..eaf845042700207e4251b2fa66e5797b
330
}
331
//# sourceMappingURL=index.js.map
332
\ No newline at end of file
333
+diff --git a/lib/commonjs/components/KeyboardChatScrollView/useFrozenPadding/index.js b/lib/commonjs/components/KeyboardChatScrollView/useFrozenPadding/index.js
334
+index 444fef5eea3988b60cb62a6b4b42084ef0510fd9..3e684bf71d5e58659a8367733a7c2ee47cc05455 100644
335
+--- a/lib/commonjs/components/KeyboardChatScrollView/useFrozenPadding/index.js
336
++++ b/lib/commonjs/components/KeyboardChatScrollView/useFrozenPadding/index.js
337
+@@ -30,7 +30,8 @@ var _helpers = require("../useChatKeyboard/helpers");
338
+ function useFrozenPadding({
339
+ freeze,
340
+ offset,
341
+- padding
342
++ padding,
343
++ currentHeight
344
+ }) {
345
+ const lastHeight = (0, _reactNativeReanimated.useSharedValue)(0);
346
+ const targetKeyboardHeight = (0, _reactNativeReanimated.useSharedValue)(0);
347
+@@ -56,7 +57,9 @@ function useFrozenPadding({
348
+ }, []);
349
+ (0, _reanimated.useAnimatedReaction)(() => freeze.value, (isFrozen, wasFrozen) => {
350
+ if (!isFrozen && wasFrozen === true) {
351
+- padding.value = (0, _helpers.getEffectiveHeight)(lastHeight.value, targetKeyboardHeight.value, offset);
352
++ const effective = (0, _helpers.getEffectiveHeight)(lastHeight.value, targetKeyboardHeight.value, offset);
353
++ padding.value = effective;
354
++ currentHeight.value = effective;
355
+ }
356
+ }, [offset]);
357
+ }
358
diff --git a/lib/commonjs/hooks/useKeyboardState/index.js b/lib/commonjs/hooks/useKeyboardState/index.js
359
index a4b287006a47011a58c8a16f19b31a479087f44e..4084025d644c8555b269f9d496266e2cb3234024 100644
360
--- a/lib/commonjs/hooks/useKeyboardState/index.js
@@ -351,7 +386,7 @@ index f27c5a095129cf60831088a73ce94d44f3ba52cd..3c2f7569510d0a56fd937b6e91a6adc0
386
const keepFocus = (options === null || options === void 0 ? void 0 : options.keepFocus) ?? false;
387
const animated = (options === null || options === void 0 ? void 0 : options.animated) ?? true;
388
diff --git a/lib/module/components/KeyboardChatScrollView/index.js b/lib/module/components/KeyboardChatScrollView/index.js
354
-index e0c83918d9569e2ff541e45d31460121c73ec225..8df802ae65ea322c3f004395b622dd3563d00835 100644
389
+index e0c83918d9569e2ff541e45d31460121c73ec225..724c62e2892f75f6bb53844b84c1ade1bf87c7ec 100644
390
--- a/lib/module/components/KeyboardChatScrollView/index.js
391
+++ b/lib/module/components/KeyboardChatScrollView/index.js
392
@@ -1,9 +1,9 @@
@@ -398,7 +433,17 @@ index e0c83918d9569e2ff541e45d31460121c73ec225..8df802ae65ea322c3f004395b622dd35
433
scroll,
434
layout,
435
size,
401
-@@ -84,10 +91,26 @@ const KeyboardChatScrollView = /*#__PURE__*/forwardRef(({
436
+@@ -65,7 +72,8 @@ const KeyboardChatScrollView = /*#__PURE__*/forwardRef(({
437
+ useFrozenPadding({
438
+ freeze: freezeSV,
439
+ offset,
440
+- padding
441
++ padding,
442
++ currentHeight
443
+ });
444
+ useEndVisible({
445
+ scroll,
446
+@@ -84,10 +92,26 @@ const KeyboardChatScrollView = /*#__PURE__*/forwardRef(({
447
// a bug for you, please open an issue.
448
const totalPadding = useDerivedValue(() => Math.min(layout.value.height, Math.max(blankSpace.value, padding.value + extraContentPadding.value)));
449
@@ -598,6 +643,31 @@ index 458bced308670ec6bb30f8f5ef037ab841f4372b..9b7f1a5e9fa38928a07e7a462919105b
643
export { useExtraContentPadding };
644
//# sourceMappingURL=index.js.map
645
\ No newline at end of file
646
+diff --git a/lib/module/components/KeyboardChatScrollView/useFrozenPadding/index.js b/lib/module/components/KeyboardChatScrollView/useFrozenPadding/index.js
647
+index eddfd75913fef9111178771b4d5b4ba49864d217..d03dbd1e1fcbecb1866fb02547961a754eaf06e7 100644
648
+--- a/lib/module/components/KeyboardChatScrollView/useFrozenPadding/index.js
649
++++ b/lib/module/components/KeyboardChatScrollView/useFrozenPadding/index.js
650
+@@ -24,7 +24,8 @@ import { getEffectiveHeight } from "../useChatKeyboard/helpers";
651
+ function useFrozenPadding({
652
+ freeze,
653
+ offset,
654
+- padding
655
++ padding,
656
++ currentHeight
657
+ }) {
658
+ const lastHeight = useSharedValue(0);
659
+ const targetKeyboardHeight = useSharedValue(0);
660
+@@ -50,7 +51,9 @@ function useFrozenPadding({
661
+ }, []);
662
+ useAnimatedReaction(() => freeze.value, (isFrozen, wasFrozen) => {
663
+ if (!isFrozen && wasFrozen === true) {
664
+- padding.value = getEffectiveHeight(lastHeight.value, targetKeyboardHeight.value, offset);
665
++ const effective = getEffectiveHeight(lastHeight.value, targetKeyboardHeight.value, offset);
666
++ padding.value = effective;
667
++ currentHeight.value = effective;
668
+ }
669
+ }, [offset]);
670
+ }
671
diff --git a/lib/module/hooks/useKeyboardState/index.js b/lib/module/hooks/useKeyboardState/index.js
672
index 8da7c09fbb398253420d7bfcd9a85abdb981065b..31b1ff4370d8328a0569e559e3bbfa4b201f5a9d 100644
673
--- a/lib/module/hooks/useKeyboardState/index.js
@@ -683,8 +753,27 @@ index ec73f70544a062fbecfc1d8be92d839d3e0bea6f..45b387446587fd3e611fa02a01534bb5
753
/** Current vertical scroll offset. */
754
scroll: SharedValue<number>;
755
/** Visible viewport dimensions. */
756
+diff --git a/lib/typescript/components/KeyboardChatScrollView/useFrozenPadding/index.d.ts b/lib/typescript/components/KeyboardChatScrollView/useFrozenPadding/index.d.ts
757
+index 5c92b3850e21039eb7f11eb2944e2478c0ebab88..01d310135f5328f687087db09d9efb6a498e53d1 100644
758
+--- a/lib/typescript/components/KeyboardChatScrollView/useFrozenPadding/index.d.ts
759
++++ b/lib/typescript/components/KeyboardChatScrollView/useFrozenPadding/index.d.ts
760
+@@ -6,6 +6,7 @@ type UseFrozenPaddingOptions = {
761
+ offset: number;
762
+ /** Keyboard-driven padding managed by `useChatKeyboard`. */
763
+ padding: SharedValue<number>;
764
++ currentHeight: SharedValue<number>;
765
+ };
766
+ /**
767
+ * Hook that reconciles keyboard padding after a frozen interval.
768
+@@ -26,5 +27,5 @@ type UseFrozenPaddingOptions = {
769
+ * useFrozenPadding({ freeze, offset, padding });
770
+ * ```
771
+ */
772
+-declare function useFrozenPadding({ freeze, offset, padding, }: UseFrozenPaddingOptions): void;
773
++declare function useFrozenPadding({ freeze, offset, padding, currentHeight, }: UseFrozenPaddingOptions): void;
774
+ export { useFrozenPadding };
775
diff --git a/src/components/KeyboardChatScrollView/index.tsx b/src/components/KeyboardChatScrollView/index.tsx
687
-index 935bc71dabad6cd5c82bab77f64b5b6e1e5dc9b6..d411dc4a895c6a4c07bba31676defbacb77e056b 100644
776
+index 935bc71dabad6cd5c82bab77f64b5b6e1e5dc9b6..5306506e791c64e6c64abc91499c8974ac318301 100644
777
--- a/src/components/KeyboardChatScrollView/index.tsx
778
+++ b/src/components/KeyboardChatScrollView/index.tsx
779
@@ -1,9 +1,13 @@
@@ -735,7 +824,15 @@ index 935bc71dabad6cd5c82bab77f64b5b6e1e5dc9b6..d411dc4a895c6a4c07bba31676defbac
824
scroll,
825
layout,
826
size,
738
-@@ -109,13 +120,40 @@ const KeyboardChatScrollView: React.ForwardRefExoticComponent<
827
+@@ -85,6 +96,7 @@ const KeyboardChatScrollView: React.ForwardRefExoticComponent<
828
+ freeze: freezeSV,
829
+ offset,
830
+ padding,
831
++ currentHeight,
832
+ });
833
+
834
+ useEndVisible({
835
+@@ -109,13 +121,40 @@ const KeyboardChatScrollView: React.ForwardRefExoticComponent<
836
),
837
);
838
@@ -1055,6 +1152,43 @@ index 78fe7cf88b110c955a36d8df2ee5b90c088d4228..98719c1a320c474fc45a846d8ea8b16a
1152
);
1153
}
1154
1155
+diff --git a/src/components/KeyboardChatScrollView/useFrozenPadding/index.ts b/src/components/KeyboardChatScrollView/useFrozenPadding/index.ts
1156
+index 00b01bf2e8c8e948c15e1b89318bb82fef2c5f3f..26c4560230921074aa8ce31fad4615e5188e26c1 100644
1157
+--- a/src/components/KeyboardChatScrollView/useFrozenPadding/index.ts
1158
++++ b/src/components/KeyboardChatScrollView/useFrozenPadding/index.ts
1159
+@@ -13,6 +13,8 @@ type UseFrozenPaddingOptions = {
1160
+ offset: number;
1161
+ /** Keyboard-driven padding managed by `useChatKeyboard`. */
1162
+ padding: SharedValue<number>;
1163
++ /** Presentation keyboard height managed by `useChatKeyboard`. */
1164
++ currentHeight: SharedValue<number>;
1165
+ };
1166
+
1167
+ /**
1168
+@@ -38,6 +40,7 @@ function useFrozenPadding({
1169
+ freeze,
1170
+ offset,
1171
+ padding,
1172
++ currentHeight,
1173
+ }: UseFrozenPaddingOptions): void {
1174
+ const lastHeight = useSharedValue(0);
1175
+ const targetKeyboardHeight = useSharedValue(0);
1176
+@@ -70,11 +73,14 @@ function useFrozenPadding({
1177
+ () => freeze.value,
1178
+ (isFrozen, wasFrozen) => {
1179
+ if (!isFrozen && wasFrozen === true) {
1180
+- padding.value = getEffectiveHeight(
1181
++ const effective = getEffectiveHeight(
1182
+ lastHeight.value,
1183
+ targetKeyboardHeight.value,
1184
+ offset,
1185
+ );
1186
++
1187
++ padding.value = effective;
1188
++ currentHeight.value = effective;
1189
+ }
1190
+ },
1191
+ [offset],
1192
diff --git a/src/hooks/useKeyboardState/index.ts b/src/hooks/useKeyboardState/index.ts
1193
index e5fe38dd8e7b8370bfb575296259933094857ca5..d0b98f60a6d7ad7f72ebd70b22e1ce6b7fb56874 100644
1194
--- a/src/hooks/useKeyboardState/index.ts
pnpm-lock.yaml
+3
-3
@@ -382,7 +382,7 @@ patchedDependencies:
382
node-pty@1.2.0-beta.15: f1e680afec85f650699ea756f91f469844ec4c976f4f168492a45c6b3f67d651
383
react-native-gesture-handler@3.5.0: 25b41728fe1796cc791bf394ec07fbe232072e78c508cf325759a96ca19db0d8
384
react-native-image-viewing@0.2.2: 4aa038d541c7ddcc8f1437eb3e7b4f769f61de78e7f91b53f9805dfca608474d
385
- react-native-keyboard-controller@1.23.0: 362fe9364d6457a26c240ab9af55a845c6ae5dd295e28ec345b1e38c21314280
385
+ react-native-keyboard-controller@1.23.0: 1c7c80317ef050e08d4aabe034a0813d03b497dff2dc8b37fb5f4a6e3b20fddb
386
react-native-pdf-jsi@5.0.0: 6f52854210f61bef499850ebd498229a111bc34ec5b2a4925e644f2f48f42760
387
react-native-reanimated@4.7.1: 95ee26e5fcab5f50bc4b4c47b3f7e6278a0b20850205efb9f6ee7e70a22d2b59
388
react-native-svg@15.16.1: 110f9243ffad03654ce40dd1cdb09f01af16b8fa2ccb2b2cd3d62e682c180399
@@ -744,7 +744,7 @@ importers:
744
version: 0.2.2(patch_hash=4aa038d541c7ddcc8f1437eb3e7b4f769f61de78e7f91b53f9805dfca608474d)(react-native@0.88.1(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.1(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(react@19.3.0)
745
react-native-keyboard-controller:
746
specifier: 1.23.0
747
- version: 1.23.0(patch_hash=362fe9364d6457a26c240ab9af55a845c6ae5dd295e28ec345b1e38c21314280)(3ba24c675da40640708746e9087ede39)
747
+ version: 1.23.0(patch_hash=1c7c80317ef050e08d4aabe034a0813d03b497dff2dc8b37fb5f4a6e3b20fddb)(3ba24c675da40640708746e9087ede39)
748
react-native-nitro-modules:
749
specifier: 0.37.2
750
version: 0.37.2(react-native@0.88.1(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.1(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(react@19.3.0)
@@ -21070,7 +21070,7 @@ snapshots:
21070
react: 19.3.0
21071
react-native: 0.88.1(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.1(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6)
21072
21073
- react-native-keyboard-controller@1.23.0(patch_hash=362fe9364d6457a26c240ab9af55a845c6ae5dd295e28ec345b1e38c21314280)(3ba24c675da40640708746e9087ede39):
21073
+ react-native-keyboard-controller@1.23.0(patch_hash=1c7c80317ef050e08d4aabe034a0813d03b497dff2dc8b37fb5f4a6e3b20fddb)(3ba24c675da40640708746e9087ede39):
21074
dependencies:
21075
react: 19.3.0
21076
react-native: 0.88.1(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.1(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6)