Skip to content

Commit eaea60b

Browse files
fix(mobile): Android feed stays at its end after the keyboard or sidebar changes
On Android the thread feed passed the composer height as a static contentInset. Legend List 3.7.2 ignores that prop off iOS, and its KeyboardAwareLegendList subtracts it from every padding report from KeyboardChatScrollView, so the list was told the composer padding was 0. Every end target (first open, keyboard settle, sidebar width hold) landed one composer height short of the native end. Drop the Android-only static inset. The list already seeds the composer inset when it attaches, so the first open still lands above the composer. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent c82a436 commit eaea60b

3 files changed

Lines changed: 1 addition & 33 deletions

File tree

‎apps/mobile/src/features/threads/ThreadFeed.tsx‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ import {
181181
import { cn } from "../../lib/cn";
182182
import {
183183
deriveCenteredContentHorizontalPadding,
184-
deriveThreadFeedInitialContentInset,
185184
deriveThreadWorkLogSizing,
186185
type LayoutVariant,
187186
} from "../../lib/layout";
@@ -2777,11 +2776,6 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
27772776
const bottomContentInset = props.contentBottomInset ?? 18;
27782777
const usesNativeAutomaticInsets =
27792778
props.usesAutomaticContentInsets === true && Platform.OS === "ios";
2780-
const initialContentInset = deriveThreadFeedInitialContentInset({
2781-
platform: Platform.OS,
2782-
usesNativeAutomaticInsets,
2783-
bottomContentInset,
2784-
});
27852779
const anchorTopInset = usesNativeAutomaticInsets ? barInset : topContentInset;
27862780

27872781
const theme = useUniwindTheme();
@@ -3671,7 +3665,7 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
36713665
{...(anchoredEndSpace ? { anchoredEndSpace } : {})}
36723666
contentInsetEndAdjustment={props.contentInsetEndAdjustment}
36733667
keyboardOffset={props.keyboardOffset}
3674-
contentInset={usesNativeAutomaticInsets ? { top: anchorTopInset } : initialContentInset}
3668+
{...(usesNativeAutomaticInsets ? { contentInset: { top: anchorTopInset } } : {})}
36753669
freeze={props.freeze}
36763670
maintainScrollAtEnd={jumpReady ? false : THREAD_FEED_MAINTAIN_SCROLL_AT_END}
36773671
maintainVisibleContentPosition

‎apps/mobile/src/lib/layout.test.ts‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { describe, expect, it } from "vite-plus/test";
33
import {
44
alignListPaneToHinge,
55
deriveLayout,
6-
deriveThreadFeedInitialContentInset,
76
deriveThreadArrangementSizing,
87
deriveThreadWorkLogSizing,
98
deriveWorkspacePaneLayout,
@@ -50,19 +49,6 @@ describe("thread work-log text sizing", () => {
5049
});
5150
});
5251

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-
6652
describe("native workspace sizing", () => {
6753
it.each([
6854
{ width: 669, height: 951, hasHinge: true, nativeWorkspace: true, overlay: true },

‎apps/mobile/src/lib/layout.ts‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -93,18 +93,6 @@ export interface FileInspectorPaneLayout {
9393
readonly width: number | null;
9494
}
9595

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-
10896
export function deriveLayout(input: {
10997
readonly width: number;
11098
readonly height: number;

0 commit comments

Comments
 (0)