From db1c4e671ad73a06ef005c071e4ae4b00ccab616 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Sun, 8 Nov 2026 11:43:47 +0000 Subject: [PATCH 1/2] fix(mobile): iOS 18 sidebar and thread feed start below the header Before iOS 26 the native bars are opaque, but the column still lays content out under them. The iPad thread sidebar turned UIKit's automatic inset off there, and ThreadFeed always got a top inset of 0. So the first rows and the "Load earlier activity" button sat behind the bar, where they could not be tapped. - The sidebar list uses UIKit's automatic content inset on every iOS version, as Home does, so it clears the bar and its stacked search field. - When UIKit doesn't inset the feed, ThreadFeed sizes its top spacer, anchors and indicator insets from the column's measured top safe area (useContentTopInset). That value is 0 on Android and on iOS 26 it stays 0 because UIKit owns the inset there. --- apps/mobile/src/components/ui/useBarInset.ts | 6 +++--- .../layout/workspace/workspace-list-insets.ts | 6 ------ .../src/features/threads/ThreadDetailScreen.tsx | 1 - apps/mobile/src/features/threads/ThreadFeed.tsx | 11 +++++++---- .../src/features/threads/ThreadNavigationSidebar.tsx | 5 +++-- 5 files changed, 13 insertions(+), 16 deletions(-) diff --git a/apps/mobile/src/components/ui/useBarInset.ts b/apps/mobile/src/components/ui/useBarInset.ts index 469b3bd1e0d7d..b9c3fdee8e9b8 100644 --- a/apps/mobile/src/components/ui/useBarInset.ts +++ b/apps/mobile/src/components/ui/useBarInset.ts @@ -38,9 +38,9 @@ export function useBarOverlap(): number { } /** - * The content's top safe area under the AppBar: a translucent bar's height, zero under a solid - * one or on Android, where the bar sits in flow. For scroll content insets, which must not - * double-count a solid bar. + * The content's top safe area under the AppBar: the height of the iOS bar its column lays content + * under, glass or solid, and zero on Android, where the bar sits in flow. For manual scroll + * content insets, where UIKit's automatic one is off. */ export function useContentTopInset(): number { const insets = useSafeAreaInsets(); diff --git a/apps/mobile/src/features/layout/workspace/workspace-list-insets.ts b/apps/mobile/src/features/layout/workspace/workspace-list-insets.ts index ae7048bcdba04..52b8a3407158e 100644 --- a/apps/mobile/src/features/layout/workspace/workspace-list-insets.ts +++ b/apps/mobile/src/features/layout/workspace/workspace-list-insets.ts @@ -2,12 +2,6 @@ import { useSafeAreaInsets } from "react-native-safe-area-context"; import { NATIVE_LIQUID_GLASS_SUPPORTED } from "../../../native/native-glass"; -/** A workspace list scrolls under its bar where the bar is glass; under a solid bar it starts below. */ -export const WORKSPACE_LIST_SCROLL_INSETS = { - automaticallyAdjustsScrollIndicatorInsets: NATIVE_LIQUID_GLASS_SUPPORTED, - contentInsetAdjustmentBehavior: NATIVE_LIQUID_GLASS_SUPPORTED ? "automatic" : "never", -} as const; - /** How far an empty workspace list keeps its message below a glass bar and its search. */ export function useWorkspaceListEmptyTopInset(): number { const insets = useSafeAreaInsets(); diff --git a/apps/mobile/src/features/threads/ThreadDetailScreen.tsx b/apps/mobile/src/features/threads/ThreadDetailScreen.tsx index 27cce9c5795ba..78e0101e5b016 100644 --- a/apps/mobile/src/features/threads/ThreadDetailScreen.tsx +++ b/apps/mobile/src/features/threads/ThreadDetailScreen.tsx @@ -1522,7 +1522,6 @@ function ThreadDetailBody( keyboardOffset={composerKeyboardOffset} sendingWithKeyboard={sendingWithKeyboard} fitShortFeedToViewport={questionInFlow && !isKeyboardVisible} - contentTopInset={0} contentBottomInset={ questionInFlow ? 0 diff --git a/apps/mobile/src/features/threads/ThreadFeed.tsx b/apps/mobile/src/features/threads/ThreadFeed.tsx index d6fdc9e955cde..756761b5e69e2 100644 --- a/apps/mobile/src/features/threads/ThreadFeed.tsx +++ b/apps/mobile/src/features/threads/ThreadFeed.tsx @@ -174,7 +174,7 @@ import { getReviewSectionIdForCheckpoint } from "../review/reviewModel"; import { setReviewSelectedSectionId } from "../review/reviewState"; import { Menu } from "../../components/ui/Menu"; import { useAndroidControlSizing } from "../../components/ui/useAndroidControlSizing"; -import { useBarInset } from "../../components/ui/useBarInset"; +import { useBarInset, useContentTopInset } from "../../components/ui/useBarInset"; import { copyPromptLink } from "../prompt-links/prompt-link-actions"; import { parseReviewCommentMessageSegments } from "../review/reviewCommentSelection"; import { @@ -368,7 +368,6 @@ export interface ThreadFeedProps { readonly keyboardOffset: number; readonly sendingWithKeyboard?: boolean; readonly fitShortFeedToViewport?: boolean; - readonly contentTopInset?: number; readonly contentBottomInset?: number; readonly historyControls?: ThreadFeedHistoryControls; readonly contentMaxWidth?: number; @@ -2814,10 +2813,12 @@ export const ThreadFeed = memo(function ThreadFeed({ const reviewCommentBubbleWidth = Math.min(Math.max(280, contentWidth * 0.85), contentWidth); const insets = useSafeAreaInsets(); const barInset = useBarInset(); - const topContentInset = props.contentTopInset ?? barInset; + const columnTopInset = useContentTopInset(); const bottomContentInset = props.contentBottomInset ?? 18; const usesNativeAutomaticInsets = props.usesAutomaticContentInsets === true && Platform.OS === "ios"; + // Without UIKit's automatic inset, a spacer clears the solid bar the column lays content under. + const topContentInset = usesNativeAutomaticInsets ? 0 : columnTopInset; const initialContentInset = deriveThreadFeedInitialContentInset({ platform: Platform.OS, usesNativeAutomaticInsets, @@ -3244,7 +3245,9 @@ export const ThreadFeed = memo(function ThreadFeed({ onHeaderMaterialVisibilityChange?.(visible); }; const handleScroll = (event: NativeSyntheticEvent) => { - reportHeaderMaterialVisibility(event.nativeEvent.contentOffset.y + anchorTopInset > 6); + reportHeaderMaterialVisibility( + event.nativeEvent.contentOffset.y + (usesNativeAutomaticInsets ? barInset : 0) > 6, + ); // Re-arm follow only at the actual end; the broader threshold can reclaim upward drags during streaming. const listState = listRef.current?.getState(); if (listState) { diff --git a/apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx b/apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx index dce389c836669..3d0253e2d3a21 100644 --- a/apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx +++ b/apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx @@ -48,7 +48,6 @@ import { usePendingTaskListActions } from "../home/usePendingTaskListActions"; import { useThreadListActions } from "../home/useThreadListActions"; import { useFabScroll } from "../home/FabScrollContext"; import { WorkspaceListHeader } from "../layout/workspace/WorkspaceListHeader"; -import { WORKSPACE_LIST_SCROLL_INSETS } from "../layout/workspace/workspace-list-insets"; import { WorkspaceSidebarColumn } from "../layout/workspace/WorkspaceSidebarColumn"; import { ThreadListV2PendingRow, @@ -592,7 +591,9 @@ function ThreadNavigationSidebarPane(props: ThreadNavigationSidebarProps) { itemsAreEqual={sidebarItemsAreEqual} keyExtractor={(item) => item.key} renderItem={renderListItem} - {...WORKSPACE_LIST_SCROLL_INSETS} + automaticallyAdjustsScrollIndicatorInsets + // The column lays the list under its bar, glass or solid; UIKit insets it past both. + contentInsetAdjustmentBehavior="automatic" contentContainerStyle={[ styles.threadListContent, { From f76e21be6cdcf0936a28521badaf66e4a85bb9cc Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Tue, 10 Nov 2026 12:17:25 +0000 Subject: [PATCH 2/2] fix(mobile): inset comments describe the manual contentInset path Co-Authored-By: Claude Opus 5.5 --- apps/mobile/src/components/ui/useBarInset.ts | 2 +- apps/mobile/src/features/threads/ThreadFeed.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/mobile/src/components/ui/useBarInset.ts b/apps/mobile/src/components/ui/useBarInset.ts index 74b3897fdcfe5..f00b64c8e0b70 100644 --- a/apps/mobile/src/components/ui/useBarInset.ts +++ b/apps/mobile/src/components/ui/useBarInset.ts @@ -40,7 +40,7 @@ export function useBarOverlap(): number { /** * The content's top safe area under the AppBar: the height of the iOS bar its column lays content * under, glass or solid, and zero on Android, where the bar sits in flow. For manual scroll - * content insets, where UIKit's automatic one is off. + * content insets. */ export function useContentTopInset(): number { const insets = useSafeAreaInsets(); diff --git a/apps/mobile/src/features/threads/ThreadFeed.tsx b/apps/mobile/src/features/threads/ThreadFeed.tsx index e1280792e7e99..fcc957840d98e 100644 --- a/apps/mobile/src/features/threads/ThreadFeed.tsx +++ b/apps/mobile/src/features/threads/ThreadFeed.tsx @@ -2775,7 +2775,7 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) { const bottomContentInset = props.contentBottomInset ?? 18; const usesNativeAutomaticInsets = props.usesAutomaticContentInsets === true && Platform.OS === "ios"; - // Without UIKit's automatic inset, a spacer clears the solid bar the column lays content under. + // Without the native contentInset, a list-header spacer clears the bar the column lays content under. const topContentInset = usesNativeAutomaticInsets ? 0 : columnTopInset; const anchorTopInset = usesNativeAutomaticInsets ? barInset : topContentInset;