File tree Expand file tree Collapse file tree 3 files changed +38
-7
lines changed
webviews/apps/plus/home/components Expand file tree Collapse file tree 3 files changed +38
-7
lines changed Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ export class QuickWizardRootStep implements QuickPickStep<QuickCommand> {
115115 }
116116
117117 if ( args ?. command === 'startWork' ) {
118- this . hiddenItems . push ( new StartWorkCommand ( container ) ) ;
118+ this . hiddenItems . push ( new StartWorkCommand ( container , args ) ) ;
119119 }
120120 }
121121
Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ type StartWorkTypeItem = { type: StartWorkType };
6565export interface StartWorkCommandArgs {
6666 readonly command : 'startWork' ;
6767 source ?: Sources ;
68+ type ?: StartWorkType ;
6869}
6970
7071export const supportedStartWorkIntegrations = [ HostingIntegrationId . GitHub , IssueIntegrationId . Jira ] ;
@@ -87,7 +88,8 @@ export class StartWorkCommand extends QuickCommand<State> {
8788 }
8889
8990 this . initialState = {
90- counter : 0 ,
91+ counter : args ?. type != null ? 1 : 0 ,
92+ type : args ?. type ,
9193 } ;
9294 }
9395
@@ -108,7 +110,7 @@ export class StartWorkCommand extends QuickCommand<State> {
108110 const hasConnectedIntegrations = this . hasConnectedIntegrations ( context ) ;
109111 context . title = this . title ;
110112
111- if ( state . counter < 1 ) {
113+ if ( state . counter < 1 || state . type == null ) {
112114 if ( this . container . telemetry . enabled ) {
113115 this . container . telemetry . sendEvent (
114116 opened ? 'startWork/steps/type' : 'startWork/opened' ,
@@ -124,6 +126,7 @@ export class StartWorkCommand extends QuickCommand<State> {
124126 const result = yield * this . selectTypeStep ( state ) ;
125127 if ( result === StepResultBreak ) continue ;
126128 state . type = result . type ;
129+
127130 if ( this . container . telemetry . enabled ) {
128131 this . container . telemetry . sendEvent (
129132 'startWork/type/chosen' ,
Original file line number Diff line number Diff line change @@ -112,7 +112,30 @@ export class GlLaunchpad extends SignalWatcher(LitElement) {
112112 } ) ;
113113
114114 get startWorkCommand ( ) {
115- return createCommandLink < StartWorkCommandArgs > ( Commands . StartWork , { command : 'startWork' , source : 'home' } ) ;
115+ return createCommandLink < StartWorkCommandArgs > ( Commands . StartWork , {
116+ command : 'startWork' ,
117+ source : 'home' ,
118+ type : 'issue' ,
119+ } ) ;
120+ }
121+
122+ get createBranchCommand ( ) {
123+ return createCommandLink < StartWorkCommandArgs > ( Commands . StartWork , {
124+ command : 'startWork' ,
125+ source : 'home' ,
126+ type : 'branch' ,
127+ } ) ;
128+ // TODO: Switch to using the base git command once we support sending source telemetry to that command, and then clean up start work
129+ // command to just be for issues and remove "type" param
130+ /*return createCommandLink<BranchGitCommandArgs>(Commands.GitCommands, {
131+ command: 'branch',
132+ state: {
133+ subcommand: 'create',
134+ suggestNameOnly: true,
135+ suggestRepoOnly: true,
136+ confirmOptions: ['--switch', '--worktree'],
137+ },
138+ });*/
116139 }
117140
118141 override connectedCallback ( ) {
@@ -133,9 +156,14 @@ export class GlLaunchpad extends SignalWatcher(LitElement) {
133156 < span slot ="heading "> GitLens Launchpad</ span >
134157 < div class ="summary "> ${ this . renderSummaryResult ( ) } </ div >
135158 < button-container >
136- < gl-button full class ="start-work " href =${ this . startWorkCommand }
137- > < code-icon icon ="custom-start-work " slot ="prefix "> </ code-icon > Start Work</ gl-button
138- >
159+ < gl-button full class ="start-work " href =${ this . startWorkCommand } > Start Work on an Issue</ gl-button >
160+ < gl-button
161+ appearance ="secondary "
162+ density ="compact "
163+ class ="start-work "
164+ href =${ this . createBranchCommand }
165+ > < code-icon icon ="custom-start-work "> </ code-icon
166+ > </ gl-button >
139167 </ button-container >
140168 </ gl-section >
141169 ` ;
You can’t perform that action at this time.
0 commit comments