@devries-cameron20 / t3code Mirror · read-only / commits / dc52893873
Fork 0

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): the Android composer no longer lags the keyboard or drops under the nav bar (#19980)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Julius Marminge <julius0216@outlook.com>

Thalles Passos committed Oct 20, 2026 at 01:09 UTC dc52893873a1e35b387283b1893cc4d2f200ff15
2 files changed +13 -14
apps/mobile/src/features/threads/ThreadDetailScreen.tsx
+11 -14
@@ -493,16 +493,13 @@ export const ThreadDetailScreen = function ThreadDetailScreen(props: ThreadDetai
493 const [anchorMessageId, setAnchorMessageId] = useState<MessageId | null>(null);
494 const [submittedMessageId, setSubmittedMessageId] = useState<MessageId | null>(null);
495 const [endFollowEnabled, setEndFollowEnabled] = useState(true);
496 - // Android keys the safe-area padding on keyboard visibility (#5988): the back gesture closes
497 - // the keyboard while the editor stays focused, and a focus-keyed inset would leave the toolbar
498 - // under the gesture bar. iOS must NOT use visibility — it only flips on keyboardDidHide, after
499 - // the hide animation, so the composer would ride down flush to the screen edge and then snap up
500 - // into the inset.
501 - const composerBottomInset = (
502 - Platform.OS === "android" ? isKeyboardVisible : composerExpanded || composerFocused
503 - )
504 - ? 0
505 - : Math.max(insets.bottom, 12);
496 + // Android Back hides the keyboard without blurring. Keep its safe-area padding
497 + // fixed through the animation and cancel it with matching composer/list offsets.
498 + const composerBottomInset =
499 + Platform.OS === "ios" && (composerExpanded || composerFocused)
500 + ? 0
501 + : Math.max(insets.bottom, 12);
502 + const composerKeyboardOffset = Platform.OS === "android" ? composerBottomInset : 0;
503 const contentPresentationKind = props.contentPresentation.kind;
504 const realThreadSyncLabel = (() => {
505 switch (props.threadSyncStatus) {
@@ -1145,6 +1142,7 @@ export const ThreadDetailScreen = function ThreadDetailScreen(props: ThreadDetai
1142 anchorMessageId={anchorMessageId}
1143 submittedMessageId={submittedMessageId}
1144 contentInsetEndAdjustment={combinedContentInsetEndAdjustment}
1145 + keyboardOffset={composerKeyboardOffset}
1146 contentTopInset={0}
1147 contentBottomInset={
1148 estimatedOverlayHeight +
@@ -1180,12 +1178,11 @@ export const ThreadDetailScreen = function ThreadDetailScreen(props: ThreadDetai
1178
1179 {showContent ? (
1180 <KeyboardStickyView
1183 - // iOS emits a native animated height target on both will-show and
1184 - // will-hide, so stay subscribed for the full transition.
1185 - enabled={Platform.OS === "ios" || (isKeyboardVisible && !keyboardStateSuspect)}
1181 + // Waiting for a visibility render misses the first keyboard frames.
1182 + enabled={Platform.OS === "ios" || !keyboardStateSuspect}
1183 pointerEvents="box-none"
1184 style={{ position: "absolute", bottom: 0, left: 0, right: 0, top: 0 }}
1188 - offset={{ closed: 0, opened: 0 }}
1185 + offset={{ closed: 0, opened: composerKeyboardOffset }}
1186 >
1187 <ComposerPopoverHost hidden={composerSlotHidden} popoverHeight={composerPopoverHeight}>
1188 {/* The fixed sticky host gives this bottom-anchored child a stable
apps/mobile/src/features/threads/ThreadFeed.tsx
+2
@@ -304,6 +304,7 @@ export interface ThreadFeedProps {
304 readonly anchorMessageId: MessageId | null;
305 readonly submittedMessageId: MessageId | null;
306 readonly contentInsetEndAdjustment: SharedValue<number>;
307 + readonly keyboardOffset: number;
308 readonly contentTopInset?: number;
309 readonly contentBottomInset?: number;
310 readonly historyControls?: ThreadFeedHistoryControls;
@@ -2468,6 +2469,7 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
2469 // content rest below the transparent header rather than at frame top.
2470 contentInsetStartAdjustment={usesNativeAutomaticInsets ? anchorTopInset : 0}
2471 contentInsetEndAdjustment={props.contentInsetEndAdjustment}
2472 + keyboardOffset={props.keyboardOffset}
2473 // UIKit's automatic behavior adds the safe-area bottom on top of the
2474 // raw contentInset the keyboard integration writes. The detail screen
2475 // under-reports the composer inset by this amount (see