@@ -59,6 +59,7 @@ import { SessionFileBrowserTab, type SessionFileBrowserState } from "@/pages/ses
5959
6060type ReviewDiff = FileDiffInfo | SnapshotFileDiff | VcsFileDiff
6161type RenderDiff = FileDiffInfo | ( SnapshotFileDiff & { file : string } ) | VcsFileDiff
62+ const FILE_TREE_WIDTH_MIN = 240
6263
6364function renderDiff ( value : ReviewDiff ) : value is RenderDiff {
6465 return typeof value . file === "string"
@@ -104,13 +105,14 @@ export function SessionSidePanel(props: {
104105 } ) ,
105106 )
106107 const open = createMemo ( ( ) => reviewOpen ( ) || fileOpen ( ) )
108+ const fileTreeWidth = createMemo ( ( ) => Math . max ( FILE_TREE_WIDTH_MIN , layout . fileTree . width ( ) ) )
107109 const reviewTab = createMemo ( ( ) => isDesktop ( ) )
108110 const panelWidth = createMemo ( ( ) => {
109111 if ( ! open ( ) ) return "0px"
110112 if ( reviewOpen ( ) ) return "auto"
111- return `${ layout . fileTree . width ( ) } px`
113+ return `${ fileTreeWidth ( ) } px`
112114 } )
113- const treeWidth = createMemo ( ( ) => ( fileOpen ( ) ? `${ layout . fileTree . width ( ) } px` : "0px" ) )
115+ const treeWidth = createMemo ( ( ) => ( fileOpen ( ) ? `${ fileTreeWidth ( ) } px` : "0px" ) )
114116
115117 const diffs = createMemo ( ( ) => props . diffs ( ) . filter ( renderDiff ) )
116118 const diffFiles = createMemo ( ( ) => diffs ( ) . map ( ( d ) => d . file ) )
@@ -845,8 +847,8 @@ export function SessionSidePanel(props: {
845847 < ResizeHandle
846848 direction = "horizontal"
847849 edge = "start"
848- size = { layout . fileTree . width ( ) }
849- min = { 200 }
850+ size = { fileTreeWidth ( ) }
851+ min = { FILE_TREE_WIDTH_MIN }
850852 max = { 480 }
851853 onResize = { ( width ) => {
852854 props . size . touch ( )
0 commit comments