Backed out 2 changesets (bug 1946188, bug 1945927) for causing bc failures @ browser_sidebar_max_width.js

Backed out changeset 12f92dcdff8d (bug 1946188)
Backed out changeset b71374a4ec8d (bug 1945927)
This commit is contained in:
Alexandru Marc
2025-02-10 16:59:42 +02:00
parent 69bac46f86
commit 88bcc4fdba
6 changed files with 43 additions and 74 deletions

View File

@@ -286,10 +286,9 @@ export class SidebarState {
this.#props.launcherExpanded = false;
return;
}
const previousExpanded = this.#props.launcherExpanded;
this.#props.launcherExpanded = expanded;
this.#launcherEl.expanded = expanded;
if (expanded && !previousExpanded) {
if (expanded) {
Glean.sidebar.expand.record();
}
// Marking the tab container element as expanded or not simplifies the CSS logic
@@ -336,17 +335,18 @@ export class SidebarState {
set launcherWidth(width) {
this.#props.launcherWidth = width;
const { document, requestAnimationFrame } = this.#controllerGlobal;
if (!document.documentElement.hasAttribute("inDOMFullscreen")) {
requestAnimationFrame(() => {
this.#panelEl.style.maxWidth = `calc(${SIDEBAR_MAXIMUM_WIDTH} - ${width}px)`;
// Expand the launcher when it gets wide enough.
if (lazy.verticalTabsEnabled) {
this.launcherExpanded = width >= LAUNCHER_MINIMUM_WIDTH;
} else {
this.launcherExpanded = false;
}
});
if (
!this.#controllerGlobal.document.documentElement.hasAttribute(
"inDOMFullscreen"
)
) {
this.#panelEl.style.maxWidth = `calc(${SIDEBAR_MAXIMUM_WIDTH} - ${width}px)`;
// Expand the launcher when it gets wide enough.
if (lazy.verticalTabsEnabled) {
this.launcherExpanded = width >= LAUNCHER_MINIMUM_WIDTH;
} else {
this.launcherExpanded = false;
}
}
}