@@ -4,11 +4,7 @@ import { LegendList } from "@legendapp/list/react-native";
44import type { MenuAction } from "@react-native-menu/menu" ;
55import { SymbolView } from "expo-symbols" ;
66import { useCallback , useMemo , useRef , useState , type ReactNode } from "react" ;
7- import type {
8- LayoutChangeEvent ,
9- NativeScrollEvent ,
10- NativeSyntheticEvent ,
11- } from "react-native" ;
7+ import type { LayoutChangeEvent , NativeScrollEvent , NativeSyntheticEvent } from "react-native" ;
128import { Platform , StyleSheet , TextInput , View , useColorScheme } from "react-native" ;
139import { Gesture , GestureDetector } from "react-native-gesture-handler" ;
1410import type { SwipeableMethods } from "react-native-gesture-handler/ReanimatedSwipeable" ;
@@ -51,11 +47,7 @@ import { SidebarHeaderActions } from "./sidebar-header-actions";
5147import { SidebarFilterButton } from "./sidebar-filter-button" ;
5248import { createSidebarHeaderItems } from "./sidebar-native-header-items" ;
5349import { SidebarNavigationShell } from "./sidebar-navigation-shell" ;
54- import {
55- ThreadListGroupHeader ,
56- ThreadListRow ,
57- ThreadListShowMoreRow ,
58- } from "./thread-list-items" ;
50+ import { ThreadListGroupHeader , ThreadListRow , ThreadListShowMoreRow } from "./thread-list-items" ;
5951
6052/**
6153 * Shared capsule behind the sidebar header buttons — a native liquid-glass
@@ -540,6 +532,67 @@ function ThreadNavigationSidebarPane(
540532 />
541533 < View style = { styles . container } >
542534 < SwipeableScrollGateProvider enabled = { swipeEnabled } >
535+ < GestureDetector gesture = { sidebarScrollGesture } >
536+ < LegendList
537+ data = { listLayout . items }
538+ drawDistance = { 500 }
539+ estimatedItemSize = { 64 }
540+ extraData = { listExtraData }
541+ getItemType = { ( item ) => item . type }
542+ itemsAreEqual = { homeListItemsAreEqual }
543+ keyExtractor = { ( item ) => item . key }
544+ renderItem = { renderListItem }
545+ automaticallyAdjustsScrollIndicatorInsets
546+ contentInsetAdjustmentBehavior = "automatic"
547+ contentContainerStyle = { [
548+ styles . threadListContent ,
549+ {
550+ paddingBottom : Math . max ( insets . bottom , 16 ) + 16 ,
551+ paddingTop : 6 ,
552+ } ,
553+ ] }
554+ keyboardDismissMode = "on-drag"
555+ keyboardShouldPersistTaps = "handled"
556+ { ...scrollGateHandlers }
557+ recycleItems
558+ scrollEventThrottle = { 16 }
559+ showsVerticalScrollIndicator = { false }
560+ style = { styles . threadList }
561+ ListHeaderComponent = {
562+ showsConnectionStatus ? (
563+ < View style = { styles . connectionStatusNative } >
564+ < WorkspaceConnectionStatus
565+ onPress = { props . onOpenEnvironmentSettings }
566+ state = { catalogState }
567+ variant = "sidebar"
568+ />
569+ </ View >
570+ ) : null
571+ }
572+ ListEmptyComponent = { listEmpty }
573+ />
574+ </ GestureDetector >
575+ </ SwipeableScrollGateProvider >
576+ </ View >
577+ </ >
578+ ) ;
579+ }
580+
581+ return (
582+ < View
583+ testID = "thread-navigation-sidebar"
584+ style = { [
585+ styles . container ,
586+ {
587+ width : props . width ,
588+ backgroundColor,
589+ borderRightColor : borderColor ,
590+ borderRightWidth : StyleSheet . hairlineWidth ,
591+ } ,
592+ ] }
593+ >
594+ < View style = { { flex : 1 , paddingBottom : insets . bottom } } >
595+ < SwipeableScrollGateProvider enabled = { swipeEnabled } >
543596 < GestureDetector gesture = { sidebarScrollGesture } >
544597 < LegendList
545598 data = { listLayout . items }
@@ -550,13 +603,11 @@ function ThreadNavigationSidebarPane(
550603 itemsAreEqual = { homeListItemsAreEqual }
551604 keyExtractor = { ( item ) => item . key }
552605 renderItem = { renderListItem }
553- automaticallyAdjustsScrollIndicatorInsets
554- contentInsetAdjustmentBehavior = "automatic"
555606 contentContainerStyle = { [
556607 styles . threadListContent ,
557608 {
558- paddingBottom : Math . max ( insets . bottom , 16 ) + 16 ,
559- paddingTop : 6 ,
609+ paddingBottom : 16 + insets . bottom ,
610+ paddingTop : topListInset ,
560611 } ,
561612 ] }
562613 keyboardDismissMode = "on-drag"
@@ -566,69 +617,10 @@ function ThreadNavigationSidebarPane(
566617 scrollEventThrottle = { 16 }
567618 showsVerticalScrollIndicator = { false }
568619 style = { styles . threadList }
569- ListHeaderComponent = {
570- showsConnectionStatus ? (
571- < View style = { styles . connectionStatusNative } >
572- < WorkspaceConnectionStatus
573- onPress = { props . onOpenEnvironmentSettings }
574- state = { catalogState }
575- variant = "sidebar"
576- />
577- </ View >
578- ) : null
579- }
580620 ListEmptyComponent = { listEmpty }
581621 />
582622 </ GestureDetector >
583- </ SwipeableScrollGateProvider >
584- </ View >
585- </ >
586- ) ;
587- }
588-
589- return (
590- < View
591- testID = "thread-navigation-sidebar"
592- style = { [
593- styles . container ,
594- {
595- width : props . width ,
596- backgroundColor,
597- borderRightColor : borderColor ,
598- borderRightWidth : StyleSheet . hairlineWidth ,
599- } ,
600- ] }
601- >
602- < View style = { { flex : 1 , paddingBottom : insets . bottom } } >
603- < SwipeableScrollGateProvider enabled = { swipeEnabled } >
604- < GestureDetector gesture = { sidebarScrollGesture } >
605- < LegendList
606- data = { listLayout . items }
607- drawDistance = { 500 }
608- estimatedItemSize = { 64 }
609- extraData = { listExtraData }
610- getItemType = { ( item ) => item . type }
611- itemsAreEqual = { homeListItemsAreEqual }
612- keyExtractor = { ( item ) => item . key }
613- renderItem = { renderListItem }
614- contentContainerStyle = { [
615- styles . threadListContent ,
616- {
617- paddingBottom : 16 + insets . bottom ,
618- paddingTop : topListInset ,
619- } ,
620- ] }
621- keyboardDismissMode = "on-drag"
622- keyboardShouldPersistTaps = "handled"
623- { ...scrollGateHandlers }
624- recycleItems
625- scrollEventThrottle = { 16 }
626- showsVerticalScrollIndicator = { false }
627- style = { styles . threadList }
628- ListEmptyComponent = { listEmpty }
629- />
630- </ GestureDetector >
631- </ SwipeableScrollGateProvider >
623+ </ SwipeableScrollGateProvider >
632624 </ View >
633625
634626 < View
0 commit comments