Backed out changeset 24d23a09f65c (bug 1944910) for causing bc failures @ browser_newtabButton.js CLOSED TREE

This commit is contained in:
Alexandru Marc
2025-02-08 15:17:08 +02:00
parent e143fe02c6
commit f43ff8bcd9
7 changed files with 24 additions and 74 deletions

View File

@@ -90,15 +90,6 @@ export class SidebarState {
return this.#controller.sidebarContainer;
}
/**
* Get the sidebar panel element.
*
* @returns {XULElement}
*/
get #sidebarBoxEl() {
return this.#controller._box;
}
/**
* Get the sidebar panel.
*
@@ -231,23 +222,9 @@ export class SidebarState {
return this.#props.launcherVisible;
}
/**
* Update the launcher `visible` and `expanded` states to handle the
* following scenarios:
*
* - Toggling "Hide tabs and sidebar" from the customize panel.
* - Clicking sidebar button from the toolbar.
* - Removing sidebar button from the toolbar.
* - Force expand value
*
* @param {boolean} visible
* @param {boolean} onToolbarButtonClick
* @param {boolean} onToolbarButtonRemoval
* @param {boolean} forceExpandValue
*/
updateVisibility(
visible,
onToolbarButtonClick = false,
openedByToolbarButton = false,
onToolbarButtonRemoval = false,
forceExpandValue = null
) {
@@ -264,18 +241,17 @@ export class SidebarState {
}
return;
}
if (!openedByToolbarButton && !visible && this.panelOpen) {
// no-op to handle the case when a user changes the visibility setting via the
// customize panel, we don't want to close anything on them.
return;
}
// we need this set to verticalTabsEnabled to ensure it has the correct state when toggling the sidebar button
this.launcherExpanded = lazy.verticalTabsEnabled && visible;
if (!visible && this.panelOpen) {
if (onToolbarButtonClick) {
// Hiding the launcher with the toolbar button should also close out any open panels and resets panelOpen
this.#controller.hide();
} else {
// Hide the launcher when the pref is set to hide-sidebar
this.launcherVisible = false;
this.#previousLauncherVisible = false;
return;
}
// Hiding the launcher should also close out any open panels and resets panelOpen
this.#controller.hide();
}
this.launcherVisible = visible;
break;
@@ -298,8 +274,6 @@ export class SidebarState {
this.#props.launcherVisible = visible;
this.#launcherContainerEl.hidden = !visible;
this.#updateTabbrowser(visible);
this.#sidebarBoxEl.style.paddingInlineStart =
this.panelOpen && !visible ? "var(--space-small)" : "unset";
}
get launcherExpanded() {