11import { consume } from '@lit/context' ;
22import { html , LitElement } from 'lit' ;
3- import { customElement , state } from 'lit/decorators.js' ;
3+ import { customElement , query , state } from 'lit/decorators.js' ;
44import { Commands } from '../../../../constants.commands' ;
55import { createCommandLink } from '../../../../system/commands' ;
66import type { State } from '../../../home/protocol' ;
77import { DismissWalkthroughSection } from '../../../home/protocol' ;
8+ import type { GlButton } from '../../shared/components/button' ;
89import { ipcContext } from '../../shared/context' ;
910import type { HostIpc } from '../../shared/ipc' ;
1011import { stateContext } from '../context' ;
1112import { homeBaseStyles , walkthroughProgressStyles } from '../home.css' ;
12- import '../../shared/components/button' ;
1313import '../../shared/components/code-icon' ;
1414import '../../shared/components/overlays/tooltip' ;
1515
@@ -25,33 +25,31 @@ export class GlOnboarding extends LitElement {
2525 @state ( )
2626 private _ipc ! : HostIpc ;
2727
28- private dismissWalkthroughSection ( ) {
29- this . _state . showWalkthroughProgress = false ;
30- this . requestUpdate ( ) ;
31- this . _ipc . sendCommand ( DismissWalkthroughSection ) ;
32- }
28+ @query ( '#open-walkthrough' )
29+ private _openWalkthroughButton ! : GlButton ;
3330
3431 override render ( ) {
3532 if ( ! this . _state . showWalkthroughProgress ) {
3633 return undefined ;
3734 }
3835
3936 return html `
40- < section class ="walkthrough-progress ">
37+ < section class ="walkthrough-progress " @click = ${ ( e : MouseEvent ) => this . onFallthroughClick ( e ) } >
4138 < header class ="walkthrough-progress__title ">
4239 < span
4340 > GitLens Walkthrough
4441 (${ this . _state . walkthroughProgress . doneCount } /${ this . _state . walkthroughProgress . allCount } )</ span
4542 >
4643 < nav >
4744 < gl-button
45+ id ="open-walkthrough "
4846 href =${ createCommandLink ( Commands . OpenWalkthrough , { } ) }
4947 class ="walkthrough-progress__button"
5048 appearance="toolbar"
5149 > < code-icon icon ="play "> </ code-icon
5250 > </ gl-button >
5351 < gl-button
54- @click =${ this . dismissWalkthroughSection . bind ( this ) }
52+ @click =${ this . onDismissWalkthrough . bind ( this ) }
5553 class ="walkthrough-progress__button"
5654 appearance="toolbar"
5755 > < code-icon icon ="x "> </ code-icon
@@ -65,4 +63,17 @@ export class GlOnboarding extends LitElement {
6563 </ section >
6664 ` ;
6765 }
66+
67+ private onDismissWalkthrough ( ) {
68+ this . _state . showWalkthroughProgress = false ;
69+ this . requestUpdate ( ) ;
70+ this . _ipc . sendCommand ( DismissWalkthroughSection ) ;
71+ }
72+
73+ private onFallthroughClick ( e : MouseEvent ) {
74+ if ( ( e . target as HTMLElement ) ?. closest ( 'gl-button' ) ) {
75+ return ;
76+ }
77+ this . _openWalkthroughButton . click ( ) ;
78+ }
6879}
0 commit comments