From ec2ae0e190ecaa313b111761cfd26fd347dab4a6 Mon Sep 17 00:00:00 2001 From: Andrew Pareles Date: Fri, 21 Mar 2025 22:31:24 -0700 Subject: [PATCH 1/2] more persistent update message --- .../contrib/void/browser/voidUpdateActions.ts | 41 ++++++++++++++++--- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/src/vs/workbench/contrib/void/browser/voidUpdateActions.ts b/src/vs/workbench/contrib/void/browser/voidUpdateActions.ts index d08d0890..ce71b601 100644 --- a/src/vs/workbench/contrib/void/browser/voidUpdateActions.ts +++ b/src/vs/workbench/contrib/void/browser/voidUpdateActions.ts @@ -17,11 +17,41 @@ import * as dom from '../../../../base/browser/dom.js'; -const notifyYesUpdate = (notifService: INotificationService, msg?: string) => { - const message = msg || 'This is a very old version of void, please download the latest version! [Void Editor](https://voideditor.com/download-beta)!' - notifService.notify({ +const notifyYesUpdate = (notifService: INotificationService, res: { message?: string } = {}) => { + const message = res?.message || 'This is a very old version of Void, please download the latest version! [Void Editor](https://voideditor.com/download-beta)!' + const notifController = notifService.notify({ severity: Severity.Info, message: message, + sticky: true, + source: 'Void Team', + actions: { + primary: [{ + id: 'void.updater.update', + enabled: true, + label: `Reinstall`, + tooltip: '', + class: undefined, + run: () => { + const { window } = dom.getActiveWindow() + window.open('https://voideditor.com/download-beta') + } + }, + { + id: 'void.updater.site', + enabled: true, + label: `Visit Site`, + tooltip: '', + class: undefined, + run: () => { + const { window } = dom.getActiveWindow() + window.open('https://voideditor.com/') + } + }] + }, + }) + const d = notifController.onDidClose(() => { + notifyYesUpdate(notifService, res) + d.dispose() }) } const notifyNoUpdate = (notifService: INotificationService) => { @@ -35,6 +65,7 @@ const notifyErrChecking = (notifService: INotificationService) => { notifService.notify({ severity: Severity.Info, message: message, + sticky: true, }) } @@ -57,7 +88,7 @@ registerAction2(class extends Action2 { metricsService.capture('Void Update Manual: Checking...', {}) const res = await voidUpdateService.check() if (!res) { notifyErrChecking(notifService); metricsService.capture('Void Update Manual: Error', { res }) } - else if (res.hasUpdate) { notifyYesUpdate(notifService, res.message); metricsService.capture('Void Update Manual: Yes', { res }) } + else if (res.hasUpdate) { notifyYesUpdate(notifService, res); metricsService.capture('Void Update Manual: Yes', { res }) } else if (!res.hasUpdate) { notifyNoUpdate(notifService); metricsService.capture('Void Update Manual: No', { res }) } } }) @@ -75,7 +106,7 @@ class VoidUpdateWorkbenchContribution extends Disposable implements IWorkbenchCo this.metricsService.capture('Void Update Startup: Checking...', {}) const res = await this.voidUpdateService.check() if (!res) { notifyErrChecking(this.notifService); this.metricsService.capture('Void Update Startup: Error', { res }) } - else if (res.hasUpdate) { notifyYesUpdate(this.notifService, res.message); this.metricsService.capture('Void Update Startup: Yes', { res }) } + else if (res.hasUpdate) { notifyYesUpdate(this.notifService, res); this.metricsService.capture('Void Update Startup: Yes', { res }) } else if (!res.hasUpdate) { this.metricsService.capture('Void Update Startup: No', { res }) } // display nothing if up to date } From 995f39b61f03952af6ccb26d3ccaea6590540850 Mon Sep 17 00:00:00 2001 From: Andrew Pareles Date: Fri, 21 Mar 2025 22:38:26 -0700 Subject: [PATCH 2/2] No X button --- src/vs/workbench/contrib/void/browser/voidUpdateActions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/void/browser/voidUpdateActions.ts b/src/vs/workbench/contrib/void/browser/voidUpdateActions.ts index ce71b601..da0e5fc7 100644 --- a/src/vs/workbench/contrib/void/browser/voidUpdateActions.ts +++ b/src/vs/workbench/contrib/void/browser/voidUpdateActions.ts @@ -23,7 +23,7 @@ const notifyYesUpdate = (notifService: INotificationService, res: { message?: st severity: Severity.Info, message: message, sticky: true, - source: 'Void Team', + progress: { worked: 0, total: 100 }, actions: { primary: [{ id: 'void.updater.update', @@ -39,7 +39,7 @@ const notifyYesUpdate = (notifService: INotificationService, res: { message?: st { id: 'void.updater.site', enabled: true, - label: `Visit Site`, + label: `Void Site`, tooltip: '', class: undefined, run: () => {