@devries-cameron20 / t3code-1 / commits / 5e59ece720
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(mobile): Android feed stays at its end after the keyboard or sidebar changes (#33611)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Julius Marminge committed Nov 9, 2026 at 17:57 UTC 5e59ece7206958a04f4849d3453e4793b83fcf26
3 files changed +4 -33
apps/mobile/src/features/threads/ThreadFeed.tsx
+4 -7
@@ -181,7 +181,6 @@ import {
181 import { cn } from "../../lib/cn";
182 import {
183 deriveCenteredContentHorizontalPadding,
184 - deriveThreadFeedInitialContentInset,
184 deriveThreadWorkLogSizing,
185 type LayoutVariant,
186 } from "../../lib/layout";
@@ -2777,11 +2776,6 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
2776 const bottomContentInset = props.contentBottomInset ?? 18;
2777 const usesNativeAutomaticInsets =
2778 props.usesAutomaticContentInsets === true && Platform.OS === "ios";
2780 - const initialContentInset = deriveThreadFeedInitialContentInset({
2781 - platform: Platform.OS,
2782 - usesNativeAutomaticInsets,
2783 - bottomContentInset,
2784 - });
2779 const anchorTopInset = usesNativeAutomaticInsets ? barInset : topContentInset;
2780
2781 const theme = useUniwindTheme();
@@ -3671,7 +3665,7 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
3665 {...(anchoredEndSpace ? { anchoredEndSpace } : {})}
3666 contentInsetEndAdjustment={props.contentInsetEndAdjustment}
3667 keyboardOffset={props.keyboardOffset}
3674 - contentInset={usesNativeAutomaticInsets ? { top: anchorTopInset } : initialContentInset}
3668 + {...(usesNativeAutomaticInsets ? { contentInset: { top: anchorTopInset } } : {})}
3669 freeze={props.freeze}
3670 maintainScrollAtEnd={jumpReady ? false : THREAD_FEED_MAINTAIN_SCROLL_AT_END}
3671 maintainVisibleContentPosition
@@ -3698,6 +3692,9 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
3692 drawDistance={500}
3693 keyboardShouldPersistTaps="always"
3694 keyboardDismissMode="none"
3695 + // Android scrolls a tapped selectable message into view when it takes focus, which reads
3696 + // as a user scroll and drops end following before the keyboard closes.
3697 + scrollsChildToFocus={false}
3698 keyboardLiftBehavior={props.sendingWithKeyboard ? "persistent" : "whenAtEnd"}
3699 // Seed the initial viewport before native onLayout.
3700 {...(viewportHeight > 0 && viewportWidth > 0
apps/mobile/src/lib/layout.test.ts
-14
@@ -3,7 +3,6 @@ import { describe, expect, it } from "vite-plus/test";
3 import {
4 alignListPaneToHinge,
5 deriveLayout,
6 - deriveThreadFeedInitialContentInset,
6 deriveThreadArrangementSizing,
7 deriveThreadWorkLogSizing,
8 deriveWorkspacePaneLayout,
@@ -50,19 +49,6 @@ describe("thread work-log text sizing", () => {
49 });
50 });
51
53 -describe("deriveThreadFeedInitialContentInset", () => {
54 - // regression: #5585 land the first thread open above the composer on Android
55 - it("does not double native iOS insets", () => {
56 - expect(
57 - deriveThreadFeedInitialContentInset({
58 - platform: "ios",
59 - usesNativeAutomaticInsets: true,
60 - bottomContentInset: 174,
61 - }),
62 - ).toBeUndefined();
63 - });
64 -});
65 -
52 describe("native workspace sizing", () => {
53 it.each([
54 { width: 669, height: 951, hasHinge: true, nativeWorkspace: true, overlay: true },
apps/mobile/src/lib/layout.ts
-12
@@ -93,18 +93,6 @@ export interface FileInspectorPaneLayout {
93 readonly width: number | null;
94 }
95
96 -export function deriveThreadFeedInitialContentInset(input: {
97 - readonly platform: string;
98 - readonly usesNativeAutomaticInsets: boolean;
99 - readonly bottomContentInset: number;
100 -}): { readonly bottom: number } | undefined {
101 - if (input.platform !== "android" || input.usesNativeAutomaticInsets) {
102 - return undefined;
103 - }
104 -
105 - return { bottom: Math.max(0, input.bottomContentInset) };
106 -}
107 -
96 export function deriveLayout(input: {
97 readonly width: number;
98 readonly height: number;