@@ -49,6 +49,8 @@ interface IModalEditorPartState {
4949 readonly maximized : boolean ;
5050 readonly size ?: { readonly width : number ; readonly height : number } ;
5151 readonly position ?: { readonly left : number ; readonly top : number } ;
52+ readonly sidebarWidth ?: number ;
53+ readonly sidebarHidden ?: boolean ;
5254}
5355
5456interface IEditorPartsMemento {
@@ -87,6 +89,8 @@ export class EditorParts extends MultiWindowParts<EditorPart, IEditorPartsMement
8789 this . modalEditorMaximized = modalState . maximized ;
8890 this . modalEditorSize = modalState . size ;
8991 this . modalEditorPosition = modalState . position ;
92+ this . modalEditorSidebarWidth = modalState . sidebarWidth ;
93+ this . modalEditorSidebarHidden = modalState . sidebarHidden ;
9094 }
9195
9296 this . mainPart = this . _register ( this . createMainEditorPart ( ) ) ;
@@ -175,6 +179,8 @@ export class EditorParts extends MultiWindowParts<EditorPart, IEditorPartsMement
175179 private modalEditorMaximized = false ;
176180 private modalEditorSize : IDimension | undefined ;
177181 private modalEditorPosition : { readonly left : number ; readonly top : number } | undefined ;
182+ private modalEditorSidebarWidth : number | undefined ;
183+ private modalEditorSidebarHidden : boolean | undefined ;
178184
179185 async createModalEditorPart ( options ?: IModalEditorPartOptions ) : Promise < IModalEditorPart > {
180186
@@ -190,6 +196,11 @@ export class EditorParts extends MultiWindowParts<EditorPart, IEditorPartsMement
190196 maximized : options ?. maximized ?? this . modalEditorMaximized ,
191197 size : options ?. size ?? this . modalEditorSize ,
192198 position : options ?. position ?? this . modalEditorPosition ,
199+ sidebar : options ?. sidebar ? {
200+ ...options . sidebar ,
201+ sidebarWidth : options . sidebar . sidebarWidth ?? this . modalEditorSidebarWidth ,
202+ sidebarHidden : options . sidebar . sidebarHidden ?? this . modalEditorSidebarHidden
203+ } : undefined
193204 } ) ;
194205
195206 // Keep instantiation service and reference to reuse
@@ -201,6 +212,10 @@ export class EditorParts extends MultiWindowParts<EditorPart, IEditorPartsMement
201212 this . modalEditorMaximized = part . maximized ;
202213 this . modalEditorSize = part . size ;
203214 this . modalEditorPosition = part . position ;
215+ if ( part . hasSidebar ) {
216+ this . modalEditorSidebarWidth = part . sidebarWidth ;
217+ this . modalEditorSidebarHidden = part . sidebarHidden || undefined ;
218+ }
204219
205220 this . modalPartInstantiationService = undefined ;
206221 this . modalEditorPart = undefined ;
@@ -416,17 +431,23 @@ export class EditorParts extends MultiWindowParts<EditorPart, IEditorPartsMement
416431 this . modalEditorMaximized = this . modalEditorPart . maximized ;
417432 this . modalEditorSize = this . modalEditorPart . size ;
418433 this . modalEditorPosition = this . modalEditorPart . position ;
434+ if ( this . modalEditorPart . hasSidebar ) {
435+ this . modalEditorSidebarWidth = this . modalEditorPart . sidebarWidth ;
436+ this . modalEditorSidebarHidden = this . modalEditorPart . sidebarHidden || undefined ;
437+ }
419438 }
420439
421440 // Only persist when there is meaningful state to restore.
422441 // When all values are at their defaults (not maximized, no
423442 // custom size or position), we delete the key to avoid
424443 // storing unnecessary data.
425- if ( this . modalEditorMaximized || this . modalEditorSize || this . modalEditorPosition ) {
444+ if ( this . modalEditorMaximized || this . modalEditorSize || this . modalEditorPosition || this . modalEditorSidebarWidth || this . modalEditorSidebarHidden ) {
426445 this . profileMemento [ EditorParts . MODAL_EDITOR_STATE_STORAGE_KEY ] = {
427446 maximized : this . modalEditorMaximized ,
428447 size : this . modalEditorSize ? { width : this . modalEditorSize . width , height : this . modalEditorSize . height } : undefined ,
429448 position : this . modalEditorPosition ,
449+ sidebarWidth : this . modalEditorSidebarWidth ,
450+ sidebarHidden : this . modalEditorSidebarHidden ,
430451 } ;
431452 } else {
432453 delete this . profileMemento [ EditorParts . MODAL_EDITOR_STATE_STORAGE_KEY ] ;
0 commit comments