From 09ed192fc4be871a9fab1986e40ce90f3e18db9c Mon Sep 17 00:00:00 2001 From: Ashvin Jangid <142579833+ashvwinn@users.noreply.github.com> Date: Sat, 23 May 2026 15:56:13 +0530 Subject: [PATCH] gh-13642: fix unexpected sidebar width increase in compact mode (gh-13794) `getAndApplySidebarWidth()` does handle this case but in the condition it requires the event. ``` if ( event && shouldRecalculate && sidebarExpanded && !gZenVerticalTabsManager._hadSidebarCollapse ) { return; } ``` If the function does not return here then it makes the `--zen-sidebar-width` = `--actual-zen-sidebar-width` which adds the padding's width to the sidebar. I don't know if not passing event in the function was intentional, but this seems to fix the issue. fixes: #13642 --- src/zen/common/modules/ZenUIManager.mjs | 2 +- src/zen/spaces/ZenSpaceCreation.mjs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/zen/common/modules/ZenUIManager.mjs b/src/zen/common/modules/ZenUIManager.mjs index beef37687..4553c5bb6 100644 --- a/src/zen/common/modules/ZenUIManager.mjs +++ b/src/zen/common/modules/ZenUIManager.mjs @@ -1510,7 +1510,7 @@ window.gZenVerticalTabsManager = { this.navigatorToolbox.after(splitter); window.dispatchEvent(new Event("resize")); if (!isCompactMode) { - gZenCompactModeManager.getAndApplySidebarWidth(); + gZenCompactModeManager.getAndApplySidebarWidth({}); } gZenUIManager.updateTabsToolbar(); this.rebuildURLBarMenus(); diff --git a/src/zen/spaces/ZenSpaceCreation.mjs b/src/zen/spaces/ZenSpaceCreation.mjs index 26690eabf..5792d2120 100644 --- a/src/zen/spaces/ZenSpaceCreation.mjs +++ b/src/zen/spaces/ZenSpaceCreation.mjs @@ -219,7 +219,7 @@ class nsZenWorkspaceCreation extends MozXULElement { document.getElementById("nav-bar").style.visibility = "collapse"; } this.style.visibility = "visible"; - gZenCompactModeManager.getAndApplySidebarWidth(); + gZenCompactModeManager.getAndApplySidebarWidth({}); this.resolveInitialized(); let animation = gZenUIManager.motion.animate( this.elementsToAnimate,