@@ -2,14 +2,15 @@ import { consume } from '@lit/context';
22import { SignalWatcher } from '@lit-labs/signals' ;
33import type { TemplateResult } from 'lit' ;
44import { css , html , LitElement , nothing } from 'lit' ;
5- import { customElement } from 'lit/decorators.js' ;
5+ import { customElement , state } from 'lit/decorators.js' ;
66import type { BranchGitCommandArgs } from '../../../../../commands/git/branch' ;
77import { Commands } from '../../../../../constants.commands' ;
88import type { LaunchpadCommandArgs } from '../../../../../plus/launchpad/launchpad' ;
99import { createCommandLink } from '../../../../../system/commands' ;
1010import { pluralize } from '../../../../../system/string' ;
11- import type { GetLaunchpadSummaryResponse } from '../../../../home/protocol' ;
11+ import type { GetLaunchpadSummaryResponse , State } from '../../../../home/protocol' ;
1212import { GetLaunchpadSummary } from '../../../../home/protocol' ;
13+ import { stateContext } from '../../../home/context' ;
1314import { AsyncComputedState } from '../../../shared/components/signal-utils' ;
1415import { ipcContext } from '../../../shared/context' ;
1516import type { Disposable } from '../../../shared/events' ;
@@ -93,6 +94,10 @@ export class GlLaunchpad extends SignalWatcher(LitElement) {
9394 ` ,
9495 ] ;
9596
97+ @consume < State > ( { context : stateContext , subscribe : true } )
98+ @state ( )
99+ private _homeState ! : State ;
100+
96101 @consume ( { context : ipcContext } )
97102 private _ipc ! : HostIpc ;
98103 private _disposable : Disposable | undefined ;
@@ -130,8 +135,12 @@ export class GlLaunchpad extends SignalWatcher(LitElement) {
130135 < span slot ="heading "> GitLens Launchpad</ span >
131136 < div class ="summary "> ${ this . renderSummaryResult ( ) } </ div >
132137 < button-container >
133- < gl-button full class ="start-work " href =${ this . startWorkCommand }
134- > < code-icon icon ="git-branch " slot ="prefix "> </ code-icon > Start work</ gl-button
138+ < gl-button
139+ full
140+ class ="start-work "
141+ href =${ this . startWorkCommand }
142+ ?disabled =${ this . _homeState . repositories . openCount === 0 }
143+ > < code-icon icon ="custom-start-work " slot ="prefix "> </ code-icon > Start Work</ gl-button
135144 >
136145 </ button-container >
137146 </ gl-section >
@@ -142,7 +151,10 @@ export class GlLaunchpad extends SignalWatcher(LitElement) {
142151 return this . _summaryState . render ( {
143152 pending : ( ) => this . renderPending ( ) ,
144153 complete : summary => this . renderSummary ( summary ) ,
145- error : ( ) => html `< span > Error</ span > ` ,
154+ error : ( ) =>
155+ html `< ul class ="menu ">
156+ < li > Error loading summary</ li >
157+ </ ul > ` ,
146158 } ) ;
147159 }
148160
@@ -161,11 +173,15 @@ export class GlLaunchpad extends SignalWatcher(LitElement) {
161173 private renderSummary ( summary : LaunchpadSummary | undefined ) {
162174 if ( summary == null ) return nothing ;
163175 if ( summary . total === 0 ) {
164- return html `< p > You are all caught up!</ p > ` ;
176+ return html `< ul class ="menu ">
177+ < li > You are all caught up!</ li >
178+ </ ul > ` ;
165179 }
166180 if ( ! summary . hasGroupedItems ) {
167- return html `< p > No pull requests need your attention</ p >
168- < p > (${ summary . total } other pull requests)</ p > ` ;
181+ return html `< ul class ="menu ">
182+ < li > No pull requests need your attention</ li >
183+ < li > (${ summary . total } other pull requests)</ li >
184+ </ ul > ` ;
169185 }
170186
171187 const result : TemplateResult [ ] = [ ] ;
0 commit comments