Closed Bug 1635883 Opened 4 years ago Closed 4 years ago

Ask confirmation to close tabs when clicking "close other tabs"

Categories

(Firefox :: Tabbed Browser, enhancement)

76 Branch
enhancement
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 887515

People

(Reporter: monteiro, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0

Steps to reproduce:

It is very easy to mistakenly click on closing all tabs when you go frequently on the same menu to click on undo close tab because they are next to each other and if that happens if you have a lot of tabs opened then it will take a while to restore them one by one and they will not be on the place they where before.

Actual results:

All tabs are closed.

Expected results:

Ask before closing the tabs.

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Tabbed Browser

Firstly: I can replicate this on Firefox 75 (I should upgrade; regardless: Linux, NixOS, x86_64)

Secondly, I've done some Bugzilla digging. There's a bunch of interesting (and unfortunate) history here:

Firstly, this pref was originally introduced long ago in #772319

Secondly, in #1135303 (5 years ago) it was reported that it wasn't properly wired up in the UI. Specifically, from what I can gather:

  • The pref controlled whether the prompt would appear or not, but
  • The checkbox in that prompt wasn't properly wired up to the pref (it appears the checkbox was just hidden? so there was no user-facing way to customize this prompt)

That bug was resolved in this changeset last year: https://hg.mozilla.org/integration/autoland/rev/f5b403254529
The code appears broadly similar in tip: https://hg.mozilla.org/mozilla-central/file/tip/browser/base/content/tabbrowser.js#l3040

The behavior since then is that:

  • If you're closing less tabs than fit in the sessionstore's tab restore capacity (which defaults to 25), you won't be prompted
  • If you're closing more than that, you will

I'm not sure if that original bug was fixed then. Regardless, experimenting today, if I create more than 25 (the default sessionstore capacity) tabs and click "Close other tabs", I do get prompted without a checkbox. Note that these can't be "blank" tabs: I actually had to load a website in all of them, which was mildly irritating to test

Now, #1135303 links to a small collection of Interesting and relevant historical bugs. Most notably, #887515: "Replace multiple-tab-closing prompt with the ability to restore multiple tabs"

I can see how, if that had been implemented, the current behavior would make sense: An "Undo closed tabs" button (similar to what Chrome has) would make recovering from this mistake reasonably straightforward (bonus points if the Chrome feature of persistently grouping together the batches of tabs closed by one "Close other tabs" click in the tab history, so I can recover from more than just the most recent click, made its way across to Firefox).

However, presently the tabs just shoot into my tab history panel to mingle with every other tab I've closed. I think they go into there from left to right, so in theory if I can identify the leftmost tab I had in my bar I could manually extract them one by one. In practice I've never successfully done this: my mental tab context ends up so messed up by the process that I end up throwing everything away anyway. This happens to me at least once a month due to a mis-click when trying to reach the "Undo Close Tab" button; its by great distance the biggest thing which is driving me to consider returning to Chromium.

The idea that actions should be "reversible"/that the user interface should be "forgiving" is generally considered a major principle of UI design. That broadly means that either

  • Destructive actions should have an undo, or
  • The user should be warned before performing a destructive action

The "Close other tabs" and "Close tabs to the right" buttons in Firefox currently really fail at this.

My personal preference here would be (in ranked order, best to worst):

  1. Firefox gets a proper "Undo closed tabs" feature
  2. The Close other tabs/Close tabs to the right options are removed from the right click menu (I don't think I've ever intentionally used the former and have used the latter intentionally... approximately three times)
  3. These buttons obey the warning preferences even when the tabs fit into the Undo stack

I feel like 2 would be unpalatable to the project, and I wouldn't seriously suggest it (though a pref to remove those menu options would make me very happy...), and 3 is likely the easiest immediate-term fix.

I've cc'd the people responsible for the patch for #1135303 going in, to see if they have any input. (Apologies if this violates any BZ etiquette!)

Flags: needinfo?(rgurzau)
Flags: needinfo?(jaws)

Leaving this to the dev involved, i was just moving the patch to another tree.

Flags: needinfo?(rgurzau)

I'm working on a patch and will put it on bug 887515.

Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Flags: needinfo?(jaws)
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.