From 376c64c892ddef3ff4478e9f3fd19264bbd586a9 Mon Sep 17 00:00:00 2001 From: "Mr. M" Date: Wed, 11 Jun 2025 02:17:24 +0200 Subject: [PATCH] chore: Updated l10n packs and fixed opening glance and startup, b=no-bug, c=glance, workspaces --- l10n | 2 +- src/zen/glance/ZenGlanceManager.mjs | 2 + src/zen/workspaces/ZenWorkspaces.mjs | 72 +++++++++++++++------------- 3 files changed, 42 insertions(+), 34 deletions(-) diff --git a/l10n b/l10n index a98bf7979..1bcb131a4 160000 --- a/l10n +++ b/l10n @@ -1 +1 @@ -Subproject commit a98bf797971ff06742aa4179400e18e0fd465946 +Subproject commit 1bcb131a45ea5e5f7ced55bffb5386156542278a diff --git a/src/zen/glance/ZenGlanceManager.mjs b/src/zen/glance/ZenGlanceManager.mjs index fe893bc23..e59e926e8 100644 --- a/src/zen/glance/ZenGlanceManager.mjs +++ b/src/zen/glance/ZenGlanceManager.mjs @@ -228,6 +228,7 @@ } ) .then(() => { + gBrowser.tabContainer._invalidateCachedTabs(); this.#currentBrowser.removeAttribute('animate-glance-open'); this.overlay.style.removeProperty('overflow'); this.browserWrapper.removeAttribute('animate'); @@ -615,6 +616,7 @@ } finishOpeningGlance() { + gBrowser.tabContainer._invalidateCachedTabs(); gZenWorkspaces.updateTabsContainers(); this.browserWrapper.removeAttribute('animate-full'); this.overlay.classList.remove('zen-glance-overlay'); diff --git a/src/zen/workspaces/ZenWorkspaces.mjs b/src/zen/workspaces/ZenWorkspaces.mjs index fc5e11d0b..0693e6f45 100644 --- a/src/zen/workspaces/ZenWorkspaces.mjs +++ b/src/zen/workspaces/ZenWorkspaces.mjs @@ -381,42 +381,48 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature { } async initializeTabsStripSections() { + await SessionStore.promiseInitialized; await SessionStore.promiseAllWindowsRestored; const perifery = document.getElementById('tabbrowser-arrowscrollbox-periphery'); perifery.setAttribute('hidden', 'true'); - const tabs = gBrowser.tabContainer.allTabs; - const workspaces = await this._workspaces(); - for (const workspace of workspaces.workspaces) { - await this._createWorkspaceTabsSection(workspace, tabs); - } - if (tabs.length) { - const defaultSelectedContainer = this.workspaceElement(this.activeWorkspace).querySelector( - '.zen-workspace-normal-tabs-section' - ); - const pinnedContainer = this.workspaceElement(this.activeWorkspace).querySelector( - '.zen-workspace-pinned-tabs-section' - ); - // New profile with no workspaces does not have a default selected container - if (defaultSelectedContainer) { - for (const tab of tabs) { - if (tab.hasAttribute('zen-essential')) { - this.getEssentialsSection(tab).appendChild(tab); - continue; - } else if (tab.pinned) { - pinnedContainer.insertBefore(tab, pinnedContainer.lastChild); - continue; - } - // before to the last child (perifery) - defaultSelectedContainer.insertBefore(tab, defaultSelectedContainer.lastChild); + await new Promise((resolve) => { + setTimeout(async () => { + const tabs = gBrowser.tabContainer.allTabs; + const workspaces = await this._workspaces(); + for (const workspace of workspaces.workspaces) { + await this._createWorkspaceTabsSection(workspace, tabs); } - } - gBrowser.tabContainer._invalidateCachedTabs(); - } - perifery.setAttribute('hidden', 'true'); - this._hasInitializedTabsStrip = true; - this.registerPinnedResizeObserver(); - this._fixIndicatorsNames(workspaces); - this._resolveSectionsInitialized(); + if (tabs.length) { + const defaultSelectedContainer = this.workspaceElement( + this.activeWorkspace + ).querySelector('.zen-workspace-normal-tabs-section'); + const pinnedContainer = this.workspaceElement(this.activeWorkspace).querySelector( + '.zen-workspace-pinned-tabs-section' + ); + // New profile with no workspaces does not have a default selected container + if (defaultSelectedContainer) { + for (const tab of tabs) { + if (tab.hasAttribute('zen-essential')) { + this.getEssentialsSection(tab).appendChild(tab); + continue; + } else if (tab.pinned) { + pinnedContainer.insertBefore(tab, pinnedContainer.lastChild); + continue; + } + // before to the last child (perifery) + defaultSelectedContainer.insertBefore(tab, defaultSelectedContainer.lastChild); + } + } + gBrowser.tabContainer._invalidateCachedTabs(); + } + perifery.setAttribute('hidden', 'true'); + this._hasInitializedTabsStrip = true; + this.registerPinnedResizeObserver(); + this._fixIndicatorsNames(workspaces); + this._resolveSectionsInitialized(); + resolve(); + }, 0); + }); } getEssentialsSection(container = 0) { @@ -859,9 +865,9 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature { } this.onWindowResize(); await gZenSessionStore.promiseInitialized; + await this.workspaceBookmarks(); await this.initializeTabsStripSections(); this._initializeEmptyTab(); - await this.workspaceBookmarks(); await gZenPinnedTabManager.refreshPinnedTabs({ init: true }); await this.changeWorkspace(activeWorkspace, { onInit: true }); this._fixTabPositions();