From a5585c5619835e4dc6a3ce1747fc6977c7e5e2f1 Mon Sep 17 00:00:00 2001 From: Fernando Omori <54488262+fernandoomorifaria@users.noreply.github.com> Date: Sat, 29 Aug 2026 07:35:31 -0300 Subject: [PATCH] gh-14380: Fix sidebar width getting stuck when toggling layout on the right side (gh-15092) --- src/zen/common/modules/ZenUIManager.mjs | 27 ++++++++++++++----------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/zen/common/modules/ZenUIManager.mjs b/src/zen/common/modules/ZenUIManager.mjs index dbb1bd2ca..405361ccf 100644 --- a/src/zen/common/modules/ZenUIManager.mjs +++ b/src/zen/common/modules/ZenUIManager.mjs @@ -1348,18 +1348,21 @@ window.gZenVerticalTabsManager = { document.documentElement.removeAttribute("zen-right-side"); } - delete this._hadSidebarCollapse; - if (isSidebarExpanded) { - this._hadSidebarCollapse = !document.documentElement.hasAttribute( - "zen-sidebar-expanded" - ); - this.navigatorToolbox.setAttribute("zen-sidebar-expanded", "true"); - document.documentElement.setAttribute("zen-sidebar-expanded", "true"); - gBrowser.tabContainer.setAttribute("expanded", "true"); - } else { - this.navigatorToolbox.removeAttribute("zen-sidebar-expanded"); - document.documentElement.removeAttribute("zen-sidebar-expanded"); - gBrowser.tabContainer.removeAttribute("expanded"); + const wasSidebarExpanded = document.documentElement.hasAttribute( + "zen-sidebar-expanded" + ); + if (isSidebarExpanded !== wasSidebarExpanded) { + delete this._hadSidebarCollapse; + if (isSidebarExpanded) { + this._hadSidebarCollapse = true; + this.navigatorToolbox.setAttribute("zen-sidebar-expanded", "true"); + document.documentElement.setAttribute("zen-sidebar-expanded", "true"); + gBrowser.tabContainer.setAttribute("expanded", "true"); + } else { + this.navigatorToolbox.removeAttribute("zen-sidebar-expanded"); + document.documentElement.removeAttribute("zen-sidebar-expanded"); + gBrowser.tabContainer.removeAttribute("expanded"); + } } const appContentNavbarContaienr = document.getElementById(