fix: FIxed restoring pined and essential tabs not being on the correct parent element, b=(bug #8726), c=tests, workspaces

This commit is contained in:
Mr. M
2025-05-31 21:32:51 +02:00
parent 4abb3d2249
commit a710d5949e
5 changed files with 153 additions and 49 deletions

View File

@@ -3322,4 +3322,20 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
}
});
}
fixTabInsertLocation(tab) {
if (tab.hasAttribute('zen-essential')) {
// Essential tabs should always be inserted at the end of the essentials section
const essentialsSection = this.getEssentialsSection(tab);
if (essentialsSection) {
essentialsSection.appendChild(tab);
}
} else if (tab.pinned) {
// Pinned tabs should always be inserted at the end of the pinned tabs container
const pinnedContainer = this.pinnedTabsContainer;
if (pinnedContainer) {
pinnedContainer.insertBefore(tab, pinnedContainer.lastChild);
}
}
}
})();