Open Bug 1961586 Opened 27 days ago Updated 25 days ago

Closing Last Visible Tab Causes Unexpected Expansion of Adjacent Collapsed Tab Group Instead of Opening New Tab at the End

Categories

(Firefox :: Tabbed Browser, defect)

Firefox 139
defect

Tracking

()

Tracking Status
firefox-esr115 --- unaffected
firefox-esr128 --- unaffected
firefox137 --- ?
firefox138 --- ?
firefox139 --- affected

People

(Reporter: tabmix.onemen, Unassigned)

References

(Blocks 1 open bug)

Details

Description

When the last visible tab is closed, and there are collapsed tab groups present, a new tab should ideally open at the end of the tab strip (to the right in left-to-right mode, or to the left in right-to-left mode).

However, instead of opening a new tab at the expected position, the collapsed tab group immediately to the right of the closed tab (or to the left if the closed tab was the last tab on the right) unexpectedly expands.

This behavior is inconsistent with the expected behavior of opening a new tab after closing the last visible one, especially when collapsed groups are present.

Steps to Reproduce

  1. Open Firefox and create several tabs.
  2. Group some of these tabs into one or more collapsed tab groups. Ensure there is only one visible tab.
  3. Close the last remaining visible tab.
  4. Observe the behavior of the collapsed tab groups.
  • repeat test test by position the visible tab in different position related to the collapsed group.

Expected Results

Upon closing the last visible tab, a new tab should be opened at the end of the tab strip, without affecting the state (collapsed/expanded) of any existing tab groups.

Actual Results

Instead of opening a new tab at the end, the collapsed tab group immediately adjacent to the closed tab (to the right if tabs are closed from left to right, or to the left if the closed tab was the last one) unexpectedly expands.

See Also: → 1962182

@tabmix.onemen Thanks for the report. We have iterated over time on what behavior to use when the tab strip loses its last visible tab. For this specific scenario (closing the the last visible, ungrouped tab when there are collapsed tab groups in the tab strip), we did at one point open a new tab. However, if the user then closes that new tab (which is now the last visible, ungrouped tab), we then reopen the new tab immediately in its place. This made it seem like that new tab is "stuck."

From what I recall, we agreed in principle that when a user closes the last visible tab, they most likely want to start a new task and so automatically opening a new tab is the most helpful action.

Here is the current behavior for falling back to a tab in a collapsed tab group https://searchfox.org/mozilla-central/source/browser/components/tabbrowser/content/tabbrowser.js#5288-5304

The behavior you expect (opening a new tab) is something we do in the case when you collapse a tab group and, after the collapse, there are no visible tabs left. https://searchfox.org/mozilla-central/source/browser/components/tabbrowser/content/tabs.js#297-309

Severity: -- → S4

When browser.tabs.closeWindowWithLastTab is false opening new tab instead of the close one does not considered "stuck."
opening collapsed group is totally not accepted, user can have many tabs i a collapsed group.

You need to log in before you can comment on or make changes to this bug.