@@ -419,7 +419,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
419
419
}
420
420
421
421
// Theme changes
422
- this . _register ( this . themeService . onDidColorThemeChange ( ( ) => this . updateWindowsBorder ( ) ) ) ;
422
+ this . _register ( this . themeService . onDidColorThemeChange ( ( ) => this . updateWindowBorder ( ) ) ) ;
423
423
424
424
// Window active / focus changes
425
425
this . _register ( this . hostService . onDidChangeFocus ( focused => this . onWindowFocusChanged ( focused ) ) ) ;
@@ -508,7 +508,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
508
508
// Propagate to grid
509
509
this . workbenchGrid . setViewVisible ( this . titleBarPartView , shouldShowCustomTitleBar ( this . configurationService , mainWindow , this . state . runtime . menuBar . toggled ) ) ;
510
510
511
- this . updateWindowsBorder ( true ) ;
511
+ this . updateWindowBorder ( true ) ;
512
512
}
513
513
}
514
514
@@ -518,7 +518,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
518
518
this . state . runtime . activeContainerId = activeContainerId ;
519
519
520
520
// Indicate active window border
521
- this . updateWindowsBorder ( ) ;
521
+ this . updateWindowBorder ( ) ;
522
522
523
523
this . _onDidChangeActiveContainer . fire ( ) ;
524
524
}
@@ -527,7 +527,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
527
527
private onWindowFocusChanged ( hasFocus : boolean ) : void {
528
528
if ( this . state . runtime . hasFocus !== hasFocus ) {
529
529
this . state . runtime . hasFocus = hasFocus ;
530
- this . updateWindowsBorder ( ) ;
530
+ this . updateWindowBorder ( ) ;
531
531
}
532
532
}
533
533
@@ -582,7 +582,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
582
582
this . adjustPartPositions ( position , panelAlignment , panelPosition ) ;
583
583
}
584
584
585
- private updateWindowsBorder ( skipLayout = false ) {
585
+ private updateWindowBorder ( skipLayout = false ) {
586
586
if (
587
587
isWeb ||
588
588
isWindows || // not working well with zooming (border often not visible)
@@ -743,7 +743,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
743
743
}
744
744
745
745
// Window border
746
- this . updateWindowsBorder ( true ) ;
746
+ this . updateWindowBorder ( true ) ;
747
747
}
748
748
749
749
private getDefaultLayoutViews ( environmentService : IBrowserWorkbenchEnvironmentService , storageService : IStorageService ) : string [ ] | undefined {
@@ -2377,7 +2377,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
2377
2377
this . state . runtime . maximized . delete ( targetWindowId ) ;
2378
2378
}
2379
2379
2380
- this . updateWindowsBorder ( ) ;
2380
+ this . updateWindowBorder ( ) ;
2381
2381
this . _onDidChangeWindowMaximized . fire ( { windowId : targetWindowId , maximized } ) ;
2382
2382
}
2383
2383
@@ -2800,6 +2800,12 @@ class LayoutStateModel extends Disposable {
2800
2800
2801
2801
private readonly stateCache = new Map < string , unknown > ( ) ;
2802
2802
2803
+ private readonly isNew : {
2804
+ [ StorageScope . WORKSPACE ] : boolean ;
2805
+ [ StorageScope . PROFILE ] : boolean ;
2806
+ [ StorageScope . APPLICATION ] : boolean ;
2807
+ } ;
2808
+
2803
2809
constructor (
2804
2810
private readonly storageService : IStorageService ,
2805
2811
private readonly configurationService : IConfigurationService ,
@@ -2810,6 +2816,12 @@ class LayoutStateModel extends Disposable {
2810
2816
) {
2811
2817
super ( ) ;
2812
2818
2819
+ this . isNew = {
2820
+ [ StorageScope . WORKSPACE ] : this . storageService . isNew ( StorageScope . WORKSPACE ) ,
2821
+ [ StorageScope . PROFILE ] : this . storageService . isNew ( StorageScope . PROFILE ) ,
2822
+ [ StorageScope . APPLICATION ] : this . storageService . isNew ( StorageScope . APPLICATION )
2823
+ } ;
2824
+
2813
2825
this . _register ( this . configurationService . onDidChangeConfiguration ( configurationChange => this . updateStateFromLegacySettings ( configurationChange ) ) ) ;
2814
2826
}
2815
2827
@@ -2894,9 +2906,11 @@ class LayoutStateModel extends Disposable {
2894
2906
}
2895
2907
2896
2908
switch ( this . configurationService . getValue ( WorkbenchLayoutSettings . AUXILIARYBAR_DEFAULT_VISIBILITY ) ) {
2909
+ case 'maximized' :
2897
2910
case 'visible' :
2898
2911
return false ;
2899
2912
case 'visibleInWorkspace' :
2913
+ case 'maximizedInWorkspace' :
2900
2914
return workbenchState === WorkbenchState . EMPTY ;
2901
2915
default :
2902
2916
return true ;
@@ -2945,7 +2959,7 @@ class LayoutStateModel extends Disposable {
2945
2959
}
2946
2960
} ) ;
2947
2961
2948
- // With experimental treatment for new users
2962
+ // Auxiliary bar: With experimental treatment for new users
2949
2963
if (
2950
2964
this . storageService . isNew ( StorageScope . APPLICATION ) &&
2951
2965
this . contextService . getWorkbenchState ( ) === WorkbenchState . EMPTY &&
@@ -2956,20 +2970,7 @@ class LayoutStateModel extends Disposable {
2956
2970
)
2957
2971
) {
2958
2972
if ( experiment . value . experimentGroup === StartupExperimentGroup . MaximizedChat ) {
2959
- this . setRuntimeValue ( LayoutStateKeys . AUXILIARYBAR_LAST_NON_MAXIMIZED_VISIBILITY , {
2960
- sideBarVisible : ! this . getRuntimeValue ( LayoutStateKeys . SIDEBAR_HIDDEN ) ,
2961
- panelVisible : ! this . getRuntimeValue ( LayoutStateKeys . PANEL_HIDDEN ) ,
2962
- editorVisible : ! this . getRuntimeValue ( LayoutStateKeys . EDITOR_HIDDEN ) ,
2963
- auxiliaryBarVisible : ! this . getRuntimeValue ( LayoutStateKeys . AUXILIARYBAR_HIDDEN )
2964
- } ) ;
2965
-
2966
- this . setRuntimeValue ( LayoutStateKeys . SIDEBAR_HIDDEN , true ) ;
2967
- this . setRuntimeValue ( LayoutStateKeys . PANEL_HIDDEN , true ) ;
2968
- this . setRuntimeValue ( LayoutStateKeys . EDITOR_HIDDEN , true ) ;
2969
- this . setRuntimeValue ( LayoutStateKeys . AUXILIARYBAR_HIDDEN , false ) ;
2970
-
2971
- this . setRuntimeValue ( LayoutStateKeys . AUXILIARYBAR_LAST_NON_MAXIMIZED_SIZE , this . getInitializationValue ( LayoutStateKeys . AUXILIARYBAR_SIZE ) ) ;
2972
- this . setRuntimeValue ( LayoutStateKeys . AUXILIARYBAR_WAS_LAST_MAXIMIZED , true ) ;
2973
+ this . applyAuxiliaryBarMaximizedOverride ( ) ;
2973
2974
} else if (
2974
2975
experiment . value . experimentGroup === StartupExperimentGroup . SplitEmptyEditorChat ||
2975
2976
experiment . value . experimentGroup === StartupExperimentGroup . SplitWelcomeChat
@@ -2980,6 +2981,17 @@ class LayoutStateModel extends Disposable {
2980
2981
}
2981
2982
}
2982
2983
2984
+ // Auxiliary bar: Based on setting for new workspaces
2985
+ else if ( this . isNew [ StorageScope . WORKSPACE ] ) {
2986
+ const defaultAuxiliaryBarVisibility = this . configurationService . getValue ( WorkbenchLayoutSettings . AUXILIARYBAR_DEFAULT_VISIBILITY ) ;
2987
+ if (
2988
+ defaultAuxiliaryBarVisibility === 'maximized' ||
2989
+ ( defaultAuxiliaryBarVisibility === 'maximizedInWorkspace' && this . contextService . getWorkbenchState ( ) !== WorkbenchState . EMPTY )
2990
+ ) {
2991
+ this . applyAuxiliaryBarMaximizedOverride ( ) ;
2992
+ }
2993
+ }
2994
+
2983
2995
// Both editor and panel should not be hidden on startup unless auxiliary bar is maximized
2984
2996
if (
2985
2997
this . getRuntimeValue ( LayoutStateKeys . PANEL_HIDDEN ) &&
@@ -2990,6 +3002,23 @@ class LayoutStateModel extends Disposable {
2990
3002
}
2991
3003
}
2992
3004
3005
+ private applyAuxiliaryBarMaximizedOverride ( ) : void {
3006
+ this . setRuntimeValue ( LayoutStateKeys . AUXILIARYBAR_LAST_NON_MAXIMIZED_VISIBILITY , {
3007
+ sideBarVisible : ! this . getRuntimeValue ( LayoutStateKeys . SIDEBAR_HIDDEN ) ,
3008
+ panelVisible : ! this . getRuntimeValue ( LayoutStateKeys . PANEL_HIDDEN ) ,
3009
+ editorVisible : ! this . getRuntimeValue ( LayoutStateKeys . EDITOR_HIDDEN ) ,
3010
+ auxiliaryBarVisible : ! this . getRuntimeValue ( LayoutStateKeys . AUXILIARYBAR_HIDDEN )
3011
+ } ) ;
3012
+
3013
+ this . setRuntimeValue ( LayoutStateKeys . SIDEBAR_HIDDEN , true ) ;
3014
+ this . setRuntimeValue ( LayoutStateKeys . PANEL_HIDDEN , true ) ;
3015
+ this . setRuntimeValue ( LayoutStateKeys . EDITOR_HIDDEN , true ) ;
3016
+ this . setRuntimeValue ( LayoutStateKeys . AUXILIARYBAR_HIDDEN , false ) ;
3017
+
3018
+ this . setRuntimeValue ( LayoutStateKeys . AUXILIARYBAR_LAST_NON_MAXIMIZED_SIZE , this . getInitializationValue ( LayoutStateKeys . AUXILIARYBAR_SIZE ) ) ;
3019
+ this . setRuntimeValue ( LayoutStateKeys . AUXILIARYBAR_WAS_LAST_MAXIMIZED , true ) ;
3020
+ }
3021
+
2993
3022
save ( workspace : boolean , global : boolean ) : void {
2994
3023
let key : keyof typeof LayoutStateKeys ;
2995
3024
@@ -3071,13 +3100,15 @@ class LayoutStateModel extends Disposable {
3071
3100
}
3072
3101
3073
3102
private loadKeyFromStorage < T extends StorageKeyType > ( key : WorkbenchLayoutStateKey < T > ) : T | undefined {
3074
- let value : any = this . storageService . get ( `${ LayoutStateModel . STORAGE_PREFIX } ${ key . name } ` , key . scope ) ;
3103
+ const value = this . storageService . get ( `${ LayoutStateModel . STORAGE_PREFIX } ${ key . name } ` , key . scope ) ;
3075
3104
3076
3105
if ( value !== undefined ) {
3106
+ this . isNew [ key . scope ] = false ; // remember that we had previous state for this scope
3107
+
3077
3108
switch ( typeof key . defaultValue ) {
3078
- case 'boolean' : value = value === 'true' ; break ;
3079
- case 'number' : value = parseInt ( value ) ; break ;
3080
- case 'object' : value = JSON . parse ( value ) ; break ;
3109
+ case 'boolean' : return ( value === 'true' ) as T ;
3110
+ case 'number' : return parseInt ( value ) as T ;
3111
+ case 'object' : return JSON . parse ( value ) as T ;
3081
3112
}
3082
3113
}
3083
3114
0 commit comments