From 30d415032557400034a1bd764cfbaa1952eb00ab Mon Sep 17 00:00:00 2001 From: nzaytsev Date: Tue, 12 Nov 2024 14:51:43 +0700 Subject: [PATCH 1/5] Fixes new home view bugs - listening to git updates (push/pull/commit) - add an indication of the async task is fetching - fix gl-button click area in case of using tooltip prop - add tooltip to the `publish branch` action - fix promo banner dismissal --- .../apps/home/components/preview-banner.ts | 8 ++--- .../apps/plus/home/components/active-work.ts | 31 +++++++++++++++---- .../plus/home/components/branch-section.ts | 5 ++- .../components/branch-threshold-filter.ts | 14 ++++++--- .../apps/plus/home/components/overview.ts | 8 +++-- src/webviews/apps/shared/components/button.ts | 1 + src/webviews/home/homeWebview.ts | 12 ++++++- 7 files changed, 59 insertions(+), 20 deletions(-) diff --git a/src/webviews/apps/home/components/preview-banner.ts b/src/webviews/apps/home/components/preview-banner.ts index edde5782b74ce..030ff49f84afd 100644 --- a/src/webviews/apps/home/components/preview-banner.ts +++ b/src/webviews/apps/home/components/preview-banner.ts @@ -66,6 +66,10 @@ export class GlPreviewBanner extends LitElement { private _button!: HTMLButtonElement; override render() { + if (this.closed || this._state.previewCollapsed === true) { + return nothing; + } + if (this._state.previewEnabled === true) { return html` @@ -91,10 +95,6 @@ export class GlPreviewBanner extends LitElement { `; } - if (this.closed || this._state.previewCollapsed === true) { - return nothing; - } - return html` +

+ Switch to the new Home View!
We're reinventing GitLens' Home to be a more helpful daily workflow tool. We'll continue to - refine this view and welcome your - feedback. + refine this view and welcome your feedback.

- - this.togglePreview()} full - > Revert to Old Home View - - this.onClose()} - > -
+ `; } + if (this.closed || this._state.previewCollapsed === true) { + return nothing; + } + return html` - - -

- Switch to the new Home View!
+ +

Welcome to the new Home View!

+

We're reinventing GitLens' Home to be a more helpful daily workflow tool. We'll continue to refine - this view and welcome your feedback. + this view and welcome your + feedback.

-
+ + this.togglePreview()} full + > Revert to Old Home View + + this.onClose()} + > + `; } From 02e94d696d0b4c0ccbd1844ff8a7a65a092136b5 Mon Sep 17 00:00:00 2001 From: Keith Daulton Date: Tue, 12 Nov 2024 13:21:03 -0500 Subject: [PATCH 3/5] Prevents error in tooltip when shoelace hasn't upgraded yet --- src/webviews/apps/shared/components/overlays/tooltip.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/webviews/apps/shared/components/overlays/tooltip.ts b/src/webviews/apps/shared/components/overlays/tooltip.ts index 55e80d3ccdd50..d2e05d78ac34f 100644 --- a/src/webviews/apps/shared/components/overlays/tooltip.ts +++ b/src/webviews/apps/shared/components/overlays/tooltip.ts @@ -82,6 +82,9 @@ export class GlTooltip extends LitElement { }); const target: any = this.shadowRoot?.querySelector('sl-tooltip')?.shadowRoot; + // TODO: sometimes sl-tooltip might not be upgraded yet, need to look at watching for the upgrade + if (!target) return; + this.observer.observe(target, { attributes: true, attributeFilter: ['data-current-placement'], From 7559b2ec6b5e27de1c860ad193a2d7f0a3be3c41 Mon Sep 17 00:00:00 2001 From: Keith Daulton Date: Tue, 12 Nov 2024 13:39:44 -0500 Subject: [PATCH 4/5] Adds integration connect link in launchpad summary --- .../apps/plus/home/components/launchpad.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/webviews/apps/plus/home/components/launchpad.ts b/src/webviews/apps/plus/home/components/launchpad.ts index db9adcb535cc9..4097cdda96296 100644 --- a/src/webviews/apps/plus/home/components/launchpad.ts +++ b/src/webviews/apps/plus/home/components/launchpad.ts @@ -148,6 +148,20 @@ export class GlLaunchpad extends SignalWatcher(LitElement) { } private renderSummaryResult() { + if (this._homeState.hasAnyIntegrationConnected === false) { + return html``; + } + return this._summaryState.render({ pending: () => this.renderPending(), complete: summary => this.renderSummary(summary), From 4898cc6793ffb968d1fd6666ac4a6a6f2c0ab5d5 Mon Sep 17 00:00:00 2001 From: Keith Daulton Date: Tue, 12 Nov 2024 13:42:43 -0500 Subject: [PATCH 5/5] Fixes preview banner --- src/webviews/apps/home/components/preview-banner.ts | 12 ++++++++---- .../apps/plus/home/components/active-work.ts | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/webviews/apps/home/components/preview-banner.ts b/src/webviews/apps/home/components/preview-banner.ts index 53e389859451d..8a501394d2033 100644 --- a/src/webviews/apps/home/components/preview-banner.ts +++ b/src/webviews/apps/home/components/preview-banner.ts @@ -74,7 +74,7 @@ export class GlPreviewBanner extends LitElement {

Switch to the new Home View!
- We're reinventing GitLens' Home to be a more helpful daily workflow tool. We'll continue to + We're reimagining GitLens' Home to be a more helpful daily workflow tool. We'll continue to refine this view and welcome your feedback.

@@ -89,12 +89,12 @@ export class GlPreviewBanner extends LitElement {

Welcome to the new Home View!

- We're reinventing GitLens' Home to be a more helpful daily workflow tool. We'll continue to refine + We're reimagining GitLens' Home to be a more helpful daily workflow tool. We'll continue to refine this view and welcome your feedback.

- this.togglePreview()} full + this.togglePreview(true)} full > Revert to Old Home View @@ -105,8 +105,12 @@ export class GlPreviewBanner extends LitElement { `; } - private togglePreview() { + private togglePreview(dismiss = false) { this._ipc.sendCommand(TogglePreviewEnabledCommand); + + if (dismiss) { + this.onClose(); + } } private onClose() { diff --git a/src/webviews/apps/plus/home/components/active-work.ts b/src/webviews/apps/plus/home/components/active-work.ts index 0d9110ec537b1..06375a139e4ec 100644 --- a/src/webviews/apps/plus/home/components/active-work.ts +++ b/src/webviews/apps/plus/home/components/active-work.ts @@ -96,7 +96,7 @@ export class GlActiveWork extends SignalWatcher(LitElement) { () => html`