1+ import { useContentTopInset } from "../../components/ui/useBarInset" ;
12import { usePaneRole } from "../../components/ui/Pane" ;
23import { ScreenContent } from "../../components/ui/ScreenContent" ;
34import { useActiveNewTask } from "../../state/active-new-task" ;
@@ -262,6 +263,7 @@ export function HomeScreen(props: HomeScreenProps) {
262263 const openSwipeableRef = useRef < SwipeableMethods | null > ( null ) ;
263264 const homeScrollGesture = useNativeGesture ( ) ;
264265 const insets = useSafeAreaInsets ( ) ;
266+ const contentTopInset = useContentTopInset ( ) ;
265267 const emptyTopInset = useWorkspaceListEmptyTopInset ( ) ;
266268 const { fabClearance } = useAndroidControlSizing ( ) ;
267269 const screenMetrics = useNativeLayoutMetrics ( ) ;
@@ -326,7 +328,7 @@ export function HomeScreen(props: HomeScreenProps) {
326328 useSearchScrollRestoration ( searchMode , ( ) => {
327329 if ( restoredOffset === undefined ) return ;
328330 void listRef . current ?. scrollToOffset ( {
329- offset : restoredOffset - ( Platform . OS === "ios" ? insets . top : 0 ) ,
331+ offset : restoredOffset - contentTopInset ,
330332 animated : false ,
331333 } ) ;
332334 } ) ;
@@ -347,7 +349,7 @@ export function HomeScreen(props: HomeScreenProps) {
347349 if ( workspace )
348350 workspace . recordScrollOffset (
349351 "threads" ,
350- Math . max ( 0 , event . nativeEvent . contentOffset . y + ( Platform . OS === "ios" ? insets . top : 0 ) ) ,
352+ Math . max ( 0 , event . nativeEvent . contentOffset . y + contentTopInset ) ,
351353 ) ;
352354 clearTimeout ( activationTimerRef . current ) ;
353355 activationTimerRef . current = setTimeout (
@@ -798,7 +800,7 @@ export function HomeScreen(props: HomeScreenProps) {
798800 onTouchStart = { ( event ) => trackListTouches ( event , true ) }
799801 onTouchEnd = { ( event ) => trackListTouches ( event , false ) }
800802 onTouchCancel = { ( event ) => trackListTouches ( event , false ) }
801- renderScrollComponent = { renderHomeScrollView }
803+ renderScrollComponent = { Platform . OS === "ios" ? renderHomeScrollView : undefined }
802804 data = { threadListV2Items }
803805 renderItem = { renderV2Item }
804806 keyExtractor = { v2KeyExtractor }
@@ -829,17 +831,11 @@ export function HomeScreen(props: HomeScreenProps) {
829831 }
830832 ListEmptyComponent = { v2ListEmpty }
831833 style = { { flex : 1 } }
832- automaticallyAdjustsScrollIndicatorInsets
833- // UIKit owns the bar's inset, so a minimizing bar and a resized column move
834- // the list in the same frame as the bar.
835- contentInsetAdjustmentBehavior = "automatic"
836- contentInsetStartAdjustment = { Platform . OS === "ios" ? insets . top : 0 }
837- // RN scrollTo clamps against raw insets and ignores the automatic bar inset.
838- scrollToOverflowEnabled
834+ automaticallyAdjustsScrollIndicatorInsets = { Platform . OS === "ios" }
835+ contentInsetAdjustmentBehavior = "never"
836+ contentInset = { Platform . OS === "ios" ? { top : contentTopInset } : undefined }
839837 initialScrollOffset = {
840- initialScrollOffset > 0
841- ? initialScrollOffset - ( Platform . OS === "ios" ? insets . top : 0 )
842- : undefined
838+ initialScrollOffset > 0 ? initialScrollOffset - contentTopInset : undefined
843839 }
844840 showsVerticalScrollIndicator = { false }
845841 keyboardDismissMode = "on-drag"
@@ -853,7 +849,7 @@ export function HomeScreen(props: HomeScreenProps) {
853849 ( contentSideInsets ?. right ?? 0 ) + ( sidebarSurface ? 8 : 0 ) + androidListGutter ,
854850 paddingBottom :
855851 Platform . OS === "ios"
856- ? iosBottomClearance - ( columnMetrics ?. safeArea . bottom ?? insets . bottom )
852+ ? iosBottomClearance
857853 : ( workspace ?. bottomClearance ??
858854 Math . max ( insets . bottom , 16 ) +
859855 ( Platform . OS === "android" ? fabClearance : 88 ) ) ,
0 commit comments