remove jitter on load

This commit is contained in:
Andrew Pareles 2025-01-23 21:41:03 -08:00
parent 657e752987
commit 520c971e3e

View file

@ -146,25 +146,6 @@ export class EditorGroupWatermark extends Disposable {
private render(): void {
// const enabled = this.configurationService.getValue<boolean>('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(