Add temporary attribute to disable tab animations during workspace changes for smoother transitions

This commit is contained in:
mr. M
2025-01-02 17:05:24 +01:00
parent b4b26979de
commit fc12649028
2 changed files with 9 additions and 0 deletions

View File

@@ -254,6 +254,10 @@
animation-duration: 0.2s;
animation-timing-function: ease;
}
#tabbrowser-tabs[dont-animate-tabs] & {
opacity: 0;
}
}
&:not([zen-essential='true']):active {

View File

@@ -1327,6 +1327,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
const visibleTabs = new Set();
const lastSelectedTab = this._lastSelectedWorkspaceTabs[workspaceUuid];
this.tabContainer.setAttribute('dont-animate-tabs', 'true');
for (const tab of gBrowser.tabs) {
const tabWorkspaceId = tab.getAttribute('zen-workspace-id');
const isEssential = tab.getAttribute("zen-essential") === "true";
@@ -1350,6 +1351,10 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
gBrowser.hideTab(tab, undefined, true);
}
}
window.requestAnimationFrame(() => {
this.tabContainer.removeAttribute('dont-animate-tabs');
});
return visibleTabs;
}