Skip to content

Commit 47019fc

Browse files
committed
Makes entire walkthrough clickable on home
1 parent 0453c0b commit 47019fc

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

src/webviews/apps/home/components/onboarding.ts

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import { consume } from '@lit/context';
22
import { html, LitElement } from 'lit';
3-
import { customElement, state } from 'lit/decorators.js';
3+
import { customElement, query, state } from 'lit/decorators.js';
44
import { Commands } from '../../../../constants.commands';
55
import { createCommandLink } from '../../../../system/commands';
66
import type { State } from '../../../home/protocol';
77
import { DismissWalkthroughSection } from '../../../home/protocol';
8+
import type { GlButton } from '../../shared/components/button';
89
import { ipcContext } from '../../shared/context';
910
import type { HostIpc } from '../../shared/ipc';
1011
import { stateContext } from '../context';
1112
import { homeBaseStyles, walkthroughProgressStyles } from '../home.css';
12-
import '../../shared/components/button';
1313
import '../../shared/components/code-icon';
1414
import '../../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
}

src/webviews/apps/home/home.css.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ export const walkthroughProgressStyles = css`
369369
padding-block: 4px;
370370
margin-bottom: 16px;
371371
align-items: stretch;
372+
cursor: pointer;
372373
}
373374
.walkthrough-progress__title {
374375
display: flex;

0 commit comments

Comments
 (0)