fix: Fixed compact mode sidebar infinitily expanding when creating a new workspace, b=no-bug, c=compact-mode, workspaces

This commit is contained in:
mr. m
2025-06-14 23:28:33 +02:00
parent 7f28047f82
commit 0693bb7a61
3 changed files with 5 additions and 3 deletions

View File

@@ -2,7 +2,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
pref('zen.view.sidebar-height-throttle', 200); // in ms
pref('zen.view.sidebar-height-throttle', 0); // in ms
pref('zen.view.sidebar-expanded.max-width', 500);
#ifdef XP_MACOSX

View File

@@ -215,8 +215,9 @@ var gZenCompactModeManager = {
let sidebarWidth = this.sidebar.getBoundingClientRect().width;
const shouldRecalculate =
this.preference || document.documentElement.hasAttribute('zen-creating-workspace');
const sidebarExpanded = document.documentElement.hasAttribute('zen-sidebar-expanded');
if (sidebarWidth > 1) {
if (shouldRecalculate && gZenVerticalTabsManager._prefsSidebarExpanded) {
if (shouldRecalculate && sidebarExpanded) {
sidebarWidth = Math.max(sidebarWidth, 150);
}
// Second variable to get the genuine width of the sidebar
@@ -225,7 +226,7 @@ var gZenCompactModeManager = {
if (
event &&
shouldRecalculate &&
gZenVerticalTabsManager._prefsSidebarExpanded &&
sidebarExpanded &&
!gZenVerticalTabsManager._hadSidebarCollapse
) {
return;

View File

@@ -170,6 +170,7 @@
document.getElementById('nav-bar').style.visibility = 'collapse';
}
this.style.visibility = 'visible';
gZenCompactModeManager.getAndApplySidebarWidth();
this.resolveInitialized();
gZenUIManager.motion
.animate(