Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions apps/mobile/src/features/threads/ThreadFeed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ import {
import { cn } from "../../lib/cn";
import {
deriveCenteredContentHorizontalPadding,
deriveThreadFeedInitialContentInset,
deriveThreadWorkLogSizing,
type LayoutVariant,
} from "../../lib/layout";
Expand Down Expand Up @@ -2777,11 +2776,6 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
const bottomContentInset = props.contentBottomInset ?? 18;
const usesNativeAutomaticInsets =
props.usesAutomaticContentInsets === true && Platform.OS === "ios";
const initialContentInset = deriveThreadFeedInitialContentInset({
platform: Platform.OS,
usesNativeAutomaticInsets,
bottomContentInset,
});
const anchorTopInset = usesNativeAutomaticInsets ? barInset : topContentInset;

const theme = useUniwindTheme();
Expand Down Expand Up @@ -3671,7 +3665,7 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
{...(anchoredEndSpace ? { anchoredEndSpace } : {})}
contentInsetEndAdjustment={props.contentInsetEndAdjustment}
keyboardOffset={props.keyboardOffset}
contentInset={usesNativeAutomaticInsets ? { top: anchorTopInset } : initialContentInset}
{...(usesNativeAutomaticInsets ? { contentInset: { top: anchorTopInset } } : {})}
freeze={props.freeze}
maintainScrollAtEnd={jumpReady ? false : THREAD_FEED_MAINTAIN_SCROLL_AT_END}
maintainVisibleContentPosition
Expand All @@ -3698,6 +3692,9 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
drawDistance={500}
keyboardShouldPersistTaps="always"
keyboardDismissMode="none"
// Android scrolls a tapped selectable message into view when it takes focus, which reads
// as a user scroll and drops end following before the keyboard closes.
scrollsChildToFocus={false}
keyboardLiftBehavior={props.sendingWithKeyboard ? "persistent" : "whenAtEnd"}
// Seed the initial viewport before native onLayout.
{...(viewportHeight > 0 && viewportWidth > 0
Expand Down
14 changes: 0 additions & 14 deletions apps/mobile/src/lib/layout.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { describe, expect, it } from "vite-plus/test";
import {
alignListPaneToHinge,
deriveLayout,
deriveThreadFeedInitialContentInset,
deriveThreadArrangementSizing,
deriveThreadWorkLogSizing,
deriveWorkspacePaneLayout,
Expand Down Expand Up @@ -50,19 +49,6 @@ describe("thread work-log text sizing", () => {
});
});

describe("deriveThreadFeedInitialContentInset", () => {
// regression: #5585 land the first thread open above the composer on Android
it("does not double native iOS insets", () => {
expect(
deriveThreadFeedInitialContentInset({
platform: "ios",
usesNativeAutomaticInsets: true,
bottomContentInset: 174,
}),
).toBeUndefined();
});
});

describe("native workspace sizing", () => {
it.each([
{ width: 669, height: 951, hasHinge: true, nativeWorkspace: true, overlay: true },
Expand Down
12 changes: 0 additions & 12 deletions apps/mobile/src/lib/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,6 @@ export interface FileInspectorPaneLayout {
readonly width: number | null;
}

export function deriveThreadFeedInitialContentInset(input: {
readonly platform: string;
readonly usesNativeAutomaticInsets: boolean;
readonly bottomContentInset: number;
}): { readonly bottom: number } | undefined {
if (input.platform !== "android" || input.usesNativeAutomaticInsets) {
return undefined;
}

return { bottom: Math.max(0, input.bottomContentInset) };
}

export function deriveLayout(input: {
readonly width: number;
readonly height: number;
Expand Down
Loading