@@ -362,8 +362,8 @@ function AdaptiveWorkspaceLayoutContent(
362362 floatingTabs . row ,
363363 floatingTabsEnabled ,
364364 ] ) ;
365- // A floating sidebar brings the rail with it .
366- const width = viewportWidth - ( sidebarFloats ? 0 : navigationRailWidth ) ;
365+ // The rail keeps its room even while the sidebar floats; only the list pane overlays the page .
366+ const width = viewportWidth - navigationRailWidth ;
367367 // The sidebar stays mounted under a workspace page, so its list is ready on the way back.
368368 const shouldRenderPrimarySidebar = layout . usesSplitView ;
369369 const fileInspector = useMemo (
@@ -721,7 +721,7 @@ function AdaptiveWorkspaceLayoutContent(
721721 // panes land. A sliding sidebar uncovers the strip it is about to fill, or covers the content
722722 // until it is gone.
723723 const contentLeftTarget = sidebarFloats
724- ? 0
724+ ? navigationRailWidth
725725 : navigationRailWidth +
726726 ( shouldRenderPrimarySidebar && ! workspacePage && panes . primarySidebarVisible
727727 ? ( layout . listPaneWidth ?? 0 ) + ( layout . listPaneGap ?? 0 )
@@ -794,7 +794,9 @@ function AdaptiveWorkspaceLayoutContent(
794794 workspacePage ,
795795 ] ) ;
796796 const railAnimatedStyle = useAnimatedStyle ( ( ) => ( { width : renderedRailWidth . value } ) ) ;
797- const floatingSidebarAnimatedStyle = useAnimatedStyle ( ( ) => ( { left : renderedRailWidth . value } ) ) ;
797+ const floatingSidebarAnimatedStyle = useAnimatedStyle ( ( ) => ( {
798+ left : sidebarFloats ? renderedRailWidth . value : 0 ,
799+ } ) ) ;
798800 const floatingSidebarOpen = sidebarFloats && panes . primarySidebarVisible ;
799801 // Its own value, so a sidebar that was beside a list doesn't dim the page as it leaves.
800802 const scrimOpacity = useSharedValue ( 0 ) ;
@@ -850,7 +852,7 @@ function AdaptiveWorkspaceLayoutContent(
850852 Math . max (
851853 0 ,
852854 viewportWidth -
853- ( sidebarFloats ? 0 : renderedRailWidth . value ) -
855+ renderedRailWidth . value -
854856 ( workspacePage || sidebarFloats ? 0 : renderedSidebarWidth . value ) -
855857 renderedInspectorWidth . value ,
856858 ) ,
@@ -974,10 +976,7 @@ function AdaptiveWorkspaceLayoutContent(
974976 >
975977 < AndroidHingeObserver onChange = { handleHingeChange } />
976978 { shouldRenderNavigationRail ? (
977- < Animated . View
978- className = { sidebarFloats ? "absolute inset-y-0 left-0" : "shrink self-stretch" }
979- style = { railAnimatedStyle }
980- />
979+ < Animated . View className = "shrink self-stretch" style = { railAnimatedStyle } />
981980 ) : null }
982981 { shouldRenderPrimarySidebar && layout . listPaneWidth !== null ? (
983982 < Animated . View
@@ -994,11 +993,9 @@ function AdaptiveWorkspaceLayoutContent(
994993 style = { [
995994 workspacePage ? { position : "absolute" , top : 0 , bottom : 0 , left : 0 } : null ,
996995 sidebarFloats
997- ? [
998- { position : "absolute" , top : 0 , bottom : 0 , zIndex : 2 , elevation : 8 } ,
999- floatingSidebarAnimatedStyle ,
1000- ]
996+ ? { position : "absolute" , top : 0 , bottom : 0 , zIndex : 2 , elevation : 8 }
1001997 : null ,
998+ floatingSidebarAnimatedStyle ,
1002999 sidebarAnimatedStyle ,
10031000 ] }
10041001 >
0 commit comments