File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
packages/frontend/src/page Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,9 @@ type AnyLiveDocWithRef = {
5151 docRef : DocRef ;
5252} ;
5353
54+ // The initial size of the right panel in a split as a percentage of the total available width
55+ const INITIAL_SPLIT_SIZE = 0.33 ;
56+
5457export default function DocumentPage ( ) {
5558 const api = useApi ( ) ;
5659 const models = useContext ( ModelLibraryContext ) ;
@@ -108,10 +111,12 @@ export default function DocumentPage() {
108111 createEffect ( ( ) => {
109112 const context = resizableContext ( ) ;
110113 if ( isSidePanelOpen ( ) ) {
114+ // expand the second panel
111115 context ?. expand ( 1 ) ;
112- context ?. resize ( 1 , 0.33 ) ;
113116 } else {
117+ // collapse the second panel
114118 context ?. collapse ( 1 ) ;
119+ // Set the first panel to be the full size
115120 context ?. resize ( 0 , 1 ) ;
116121 }
117122 } ) ;
@@ -172,6 +177,7 @@ export default function DocumentPage() {
172177 < ResizableHandle class = "resizeable-handle" />
173178 < Resizable . Panel
174179 class = "content-panel"
180+ initialSize = { INITIAL_SPLIT_SIZE }
175181 minSize = { 0.25 }
176182 onCollapse = { closeSidePanel }
177183 >
You can’t perform that action at this time.
0 commit comments