Open Bug 2003021 Opened 4 months ago Updated 3 months ago

Opening new tabs from collapsed tab group adds them to the end

Categories

(Firefox :: Tabbed Browser, defect, P2)

defect

Tracking

()

People

(Reporter: sfleiter, Unassigned)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [fidefe-tabgrps])

STR

  • Make sure browser.tabs.insertAfterCurrent, browser.tabs.insertRelatedAfterCurrent and browser.tabs.loadInBackground are true
  • Create a tab group with multiple tabs in it
  • Select first tab in group
  • Collapse Tab group
  • Open a new tab f.e. via context menu on a link

Actual result

  • Opened tab is created as last tab in the closed tab group

Expected result

  • Tab should be next to the first one from where it was created from

Bug 1997096 might be related.

Even after Bug 1997096 is fixed on Nightly, that tab group is now opened but the tab is still added at the end of the group effectively ignoring the (default) value of browser.tabs.insertRelatedAfterCurrent.

Thank you for the report. When we open a link in a new tab with insertRelatedAfterCurrent, the code in https://searchfox.org/firefox-main/rev/ac7d7c131dd65058ad6b7ecfa65dc8f31a0f203e/browser/components/tabbrowser/content/tabbrowser.js#4360 identifies the correct index to place the tab. However, we are indexing into dragAndDropElements (and very recently, ariaFocusableItems, with the same semantics) which only has visible items in its array. As a result, the code inserts the tab before the next visible tab, which is the first tab that comes after the entire tab group. This is an edge case that we missed when adding the feature from bug 1971232 to allow the active tab to be in a collapsed tab group.

Blocks: 1971232
Severity: -- → S3
Priority: -- → P2
Whiteboard: [fidefe-tabgrps]
You need to log in before you can comment on or make changes to this bug.