@@ -16,6 +16,7 @@ import {
1616 QuickCommand ,
1717 StepResultBreak ,
1818} from '../../commands/quickCommand' ;
19+ import { getSteps } from '../../commands/quickWizard.utils' ;
1920import { proBadge } from '../../constants' ;
2021import type { IntegrationId } from '../../constants.integrations' ;
2122import { HostingIntegrationId } from '../../constants.integrations' ;
@@ -24,6 +25,7 @@ import type { Container } from '../../container';
2425import type { SearchedIssue } from '../../git/models/issue' ;
2526import type { QuickPickItemOfT } from '../../quickpicks/items/common' ;
2627import { createQuickPickItemOfT } from '../../quickpicks/items/common' ;
28+ import type { DirectiveQuickPickItem } from '../../quickpicks/items/directive' ;
2729import { createDirectiveQuickPickItem , Directive } from '../../quickpicks/items/directive' ;
2830import { getScopedCounter } from '../../system/counter' ;
2931import { fromNow } from '../../system/date' ;
@@ -138,7 +140,19 @@ export class StartWorkCommand extends QuickCommand<State> {
138140 if ( typeof state . action === 'string' ) {
139141 switch ( state . action ) {
140142 case 'start' :
141- startWork ( state . item . item ) ;
143+ yield * getSteps (
144+ this . container ,
145+ {
146+ command : 'branch' ,
147+ state : {
148+ subcommand : 'create' ,
149+ repo : undefined ,
150+ name : `${ state . item . item . issue . id } -${ state . item . item . issue . title } ` ,
151+ suggestNameOnly : true ,
152+ } ,
153+ } ,
154+ this . pickedVia ,
155+ ) ;
142156 break ;
143157 }
144158 }
@@ -332,6 +346,13 @@ export class StartWorkCommand extends QuickCommand<State> {
332346 return { ...element . item } ;
333347 }
334348
349+ private startWork ( state : PartialStepState < State > , item ?: StartWorkItem ) {
350+ state . action = 'start' ;
351+ if ( item != null ) {
352+ state . item = item ;
353+ }
354+ }
355+
335356 private async getConnectedIntegrations ( ) : Promise < Map < IntegrationId , boolean > > {
336357 const connected = new Map < IntegrationId , boolean > ( ) ;
337358 await Promise . allSettled (
@@ -353,7 +374,3 @@ async function updateContextItems(container: Container, context: Context) {
353374 } ) ) ?? [ ] ,
354375 } ;
355376}
356-
357- function startWork ( _issue : SearchedIssue ) {
358- // TODO: Hack here
359- }
0 commit comments