From 520c971e3e9335cec74ae74c4eac79c66e734681 Mon Sep 17 00:00:00 2001 From: Andrew Pareles Date: Thu, 23 Jan 2025 21:41:03 -0800 Subject: [PATCH] remove jitter on load --- .../parts/editor/editorGroupWatermark.ts | 27 +++---------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/src/vs/workbench/browser/parts/editor/editorGroupWatermark.ts b/src/vs/workbench/browser/parts/editor/editorGroupWatermark.ts index 787632ae..42f4a7a7 100644 --- a/src/vs/workbench/browser/parts/editor/editorGroupWatermark.ts +++ b/src/vs/workbench/browser/parts/editor/editorGroupWatermark.ts @@ -146,25 +146,6 @@ export class EditorGroupWatermark extends Disposable { private render(): void { - // const enabled = this.configurationService.getValue('workbench.tips.enabled'); - - // if (enabled === this.enabled) { - // return; - // } - - // this.enabled = enabled; - - - // if (!enabled) { - // return; - // } - - // const hasFolder = this.workbenchState !== WorkbenchState.EMPTY; - // const selected = (hasFolder ? folderEntries : noFolderEntries) - // .filter(entry => !('when' in entry) || this.contextKeyService.contextMatchesRules(entry.when)) - // .filter(entry => !('mac' in entry) || entry.mac === (isMacintosh && !isWeb)) - // .filter(entry => !!CommandsRegistry.getCommand(entry.id)) - // .filter(entry => !!this.keybindingService.lookupKeybinding(entry.id)); this.clear(); const voidIconBox = append(this.shortcuts, $('.watermark-box')); @@ -176,6 +157,10 @@ export class EditorGroupWatermark extends Disposable { const update = async () => { + // put async at top so don't need to wait (this prevents a jitter on load) + const recentlyOpened = await this.workspacesService.getRecentlyOpened() + .catch(() => ({ files: [], workspaces: [] })).then(w => w.workspaces); + clearNode(voidIconBox); clearNode(recentsBox); @@ -206,10 +191,6 @@ export class EditorGroupWatermark extends Disposable { // Recents - const recentlyOpened = await this.workspacesService.getRecentlyOpened() - .catch(() => ({ files: [], workspaces: [] })).then(w => w.workspaces); - - if (recentlyOpened.length !== 0) { voidIconBox.append(