chore: Updated l10n packs and fixed opening glance and startup, b=no-bug, c=glance, workspaces

This commit is contained in:
Mr. M
2025-06-11 02:17:24 +02:00
parent 548ed6e0f5
commit 376c64c892
3 changed files with 42 additions and 34 deletions

View File

@@ -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();