From 64188c15645851ca7dc364540a60e31efd6a8874 Mon Sep 17 00:00:00 2001 From: onemen Date: Thu, 5 Dec 2024 20:06:54 +0200 Subject: [PATCH] chore: followup bug 1927774 - Add closed tab groups to history menus --- addon/chrome/content/minit/tablib.js | 4 +- .../content/overlay/tabContextMenu.xhtml | 6 +- addon/chrome/content/session/sessionStore.js | 297 ++++++++++++++---- addon/chrome/content/tabmix.xhtml | 4 +- types/addon.d.ts | 42 ++- types/custom.gecko.dom.d.ts | 12 +- types/extraTabmixUtils.d.ts | 8 +- types/general.d.ts | 5 +- types/numberInput.d.ts | 2 +- 9 files changed, 291 insertions(+), 89 deletions(-) diff --git a/addon/chrome/content/minit/tablib.js b/addon/chrome/content/minit/tablib.js index 61d0ae37..7e7355fa 100644 --- a/addon/chrome/content/minit/tablib.js +++ b/addon/chrome/content/minit/tablib.js @@ -876,6 +876,7 @@ Tabmix.tablib = { return; } + Tabmix.closedObjectsUtils.addSeparatorIfMissing(undoPopup); let restoreAllWindows = undoPopup.lastChild; restoreAllWindows.setAttribute("value", "-2"); let clearList = document.createXULElement(undoPopup.__tagName || "menuitem"); @@ -1520,7 +1521,6 @@ Tabmix.tablib = { {checkboxLabel2 = "", restoreSession = null} = {} ) { let warningTitle = "", buttonLabel = "", chkBoxLabel = "", warningText = ""; - // if (shouldPrompt === 1 || numProtected === 0) { if (shouldPrompt === 1) { // @ts-expect-error - return types are strings [warningTitle, buttonLabel, chkBoxLabel] = gBrowser.tabLocalization.formatValuesSync([ @@ -1529,7 +1529,7 @@ Tabmix.tablib = { args: {tabCount: tabsToClose}, }, {id: "tabbrowser-confirm-close-tabs-button"}, - {id: "tabbrowser-confirm-close-tabs-checkbox"}, + {id: `tabbrowser-${Tabmix.isVersion(1350) ? "ask" : "confirm"}-close-tabs-checkbox`}, ]); } else if (numProtected === 0) { // @ts-expect-error - return types are strings diff --git a/addon/chrome/content/overlay/tabContextMenu.xhtml b/addon/chrome/content/overlay/tabContextMenu.xhtml index 9460160c..1b92aecb 100644 --- a/addon/chrome/content/overlay/tabContextMenu.xhtml +++ b/addon/chrome/content/overlay/tabContextMenu.xhtml @@ -86,9 +86,9 @@ tmp_iconic="menu-iconic closedtabs-icon" label="&undoCloseListMenu.label;" accesskey="&undoCloseListMenu.accesskey;"> + onpopupshowing="if (event.target === this) {Tabmix.closedObjectsUtils.populateClosedTabsMenu(this.parentNode); event.stopPropagation();}" + onpopupshown="if (event.target === this) event.stopPropagation();" + onpopuphidden="if (event.target === this) TabmixAllTabs.hideCommonList(this);"/>