@@ -122,6 +122,8 @@ function assertsFocusStepState(state: StepState<State>): asserts state is FocusS
122122
123123const instanceCounter = getScopedCounter ( ) ;
124124
125+ const defaultCollapsedGroups : FocusGroup [ ] = [ 'draft' , 'other' , 'snoozed' ] ;
126+
125127@command ( )
126128export class FocusCommand extends QuickCommand < State > {
127129 private readonly source : Source ;
@@ -175,11 +177,14 @@ export class FocusCommand extends QuickCommand<State> {
175177 await this . container . git . isDiscoveringRepositories ;
176178 }
177179
178- const collapsed = new Map < FocusGroup , boolean > ( [
179- [ 'draft' , true ] ,
180- [ 'other' , true ] ,
181- [ 'snoozed' , true ] ,
182- ] ) ;
180+ let storedCollapsed = this . container . storage . get ( 'launchpad:groups:collapsed' ) satisfies
181+ | FocusGroup [ ]
182+ | undefined ;
183+ if ( storedCollapsed == null ) {
184+ storedCollapsed = defaultCollapsedGroups ;
185+ }
186+
187+ const collapsed = new Map < FocusGroup , boolean > ( storedCollapsed . map ( g => [ g , true ] ) ) ;
183188 if ( state . initialGroup != null ) {
184189 // set all to true except the initial group
185190 for ( const [ group ] of groupMap ) {
@@ -342,6 +347,12 @@ export class FocusCommand extends QuickCommand<State> {
342347 onDidSelect : ( ) => {
343348 const collapsed = ! context . collapsed . get ( ui ) ;
344349 context . collapsed . set ( ui , collapsed ) ;
350+ if ( state . initialGroup == null ) {
351+ void this . container . storage . store (
352+ 'launchpad:groups:collapsed' ,
353+ Array . from ( context . collapsed . keys ( ) ) . filter ( g => context . collapsed . get ( g ) ) ,
354+ ) ;
355+ }
345356
346357 if ( this . container . telemetry . enabled ) {
347358 updateTelemetryContext ( context ) ;
0 commit comments