commit e2c68930ed327b9afb136604d96fc7cc035d95bf
parent f99458ed5ccc7fc38573722d2921ad737ec041b7
Author: Kyler Riggs <100742516+ky-ler@users.noreply.github.com>
Date: Mon, 20 Oct 2025 11:24:47 +0000
Bug 1992031 - Show menu separator on 'Flexible Space' items when in customize mode r=firefox-desktop-core-reviewers ,Gijs
Differential Revision: https://phabricator.services.mozilla.com/D268323
Diffstat:
2 files changed, 43 insertions(+), 1 deletion(-)
diff --git a/browser/components/customizableui/ToolbarContextMenu.sys.mjs b/browser/components/customizableui/ToolbarContextMenu.sys.mjs
@@ -266,7 +266,8 @@ export var ToolbarContextMenu = {
!showSidebarActions || isVerticalTabStripMenu;
document.getElementById("customizationMenuSeparator").hidden =
toolbarItem?.id == "tabbrowser-tabs" ||
- toolbarItem?.localName == "toolbarspring";
+ (toolbarItem?.localName == "toolbarspring" &&
+ !CustomizationHandler.isCustomizing());
// View -> Toolbars menu doesn't have the moveToPanel or removeFromToolbar items.
if (!moveToPanel || !removeFromToolbar) {
diff --git a/browser/components/customizableui/test/browser_customization_context_menus.js b/browser/components/customizableui/test/browser_customization_context_menus.js
@@ -713,3 +713,44 @@ add_task(async function downloads_button_context() {
await hiddenPromise;
await SpecialPowers.popPrefEnv();
});
+
+// Bug 1992031 - During customization mode, a separator should be shown
+// between "Remove from toolbar" and "Menu Bar" for flexible spaces
+add_task(async function flexible_space_context_menu_customize_mode() {
+ await startCustomizing();
+ CustomizableUI.addWidgetToArea("spring", "nav-bar");
+ let springs = document.querySelectorAll("#nav-bar toolbarspring");
+ let lastSpring = springs[springs.length - 1];
+ ok(lastSpring, "we added a spring");
+ let contextMenu = document.getElementById("toolbar-context-menu");
+ let shownPromise = popupShown(contextMenu);
+ EventUtils.synthesizeMouse(lastSpring, 2, 2, {
+ type: "contextmenu",
+ button: 2,
+ });
+ await shownPromise;
+
+ let expectedEntries = [
+ ["#toolbar-context-toggle-vertical-tabs", true],
+ ["---"],
+ [".customize-context-moveToPanel", false],
+ [".customize-context-removeFromToolbar", true],
+ ["---"],
+ ];
+
+ if (!isOSX) {
+ expectedEntries.push(["#toggle_toolbar-menubar", true]);
+ }
+
+ expectedEntries.push(
+ ["#toggle_PersonalToolbar", true],
+ ["---"],
+ [".viewCustomizeToolbar", false]
+ );
+
+ checkContextMenu(contextMenu, expectedEntries);
+ contextMenu.hidePopup();
+ gCustomizeMode.removeFromArea(lastSpring);
+ ok(!lastSpring.parentNode, "Spring should have been removed successfully.");
+ await endCustomizing();
+});