@@ -122,6 +122,8 @@ function assertsFocusStepState(state: StepState<State>): asserts state is FocusS
122
122
123
123
const instanceCounter = getScopedCounter ( ) ;
124
124
125
+ const defaultCollapsedGroups : FocusGroup [ ] = [ 'draft' , 'other' , 'snoozed' ] ;
126
+
125
127
@command ( )
126
128
export class FocusCommand extends QuickCommand < State > {
127
129
private readonly source : Source ;
@@ -175,11 +177,14 @@ export class FocusCommand extends QuickCommand<State> {
175
177
await this . container . git . isDiscoveringRepositories ;
176
178
}
177
179
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 ] ) ) ;
183
188
if ( state . initialGroup != null ) {
184
189
// set all to true except the initial group
185
190
for ( const [ group ] of groupMap ) {
@@ -342,6 +347,12 @@ export class FocusCommand extends QuickCommand<State> {
342
347
onDidSelect : ( ) => {
343
348
const collapsed = ! context . collapsed . get ( ui ) ;
344
349
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
+ }
345
356
346
357
if ( this . container . telemetry . enabled ) {
347
358
updateTelemetryContext ( context ) ;
0 commit comments