Open Bug 1812871 Opened 2 years ago Updated 4 months ago

Multiple tabs opened from the same page open in reverse order

Categories

(Fenix :: Tabs, defect, P3)

All
Android
defect

Tracking

(Not tracked)

People

(Reporter: boek, Unassigned)

References

Details

(Whiteboard: [fxdroid] [Needs-UX])

From github: https://github.com/mozilla-mobile/fenix/issues/20217.

When I am reading a page and open multiple tabs, I assume the tabs will be listed in the order I opened them. Instead they're opened in reverse.

Steps to reproduce

Open a page with multiple links. We'll use https://www.nhl.com/oilers/roster/ for this example.

  1. Open "L. Draisaitl (A)" In a new tab.
  2. Open "R. Nugent-Hopkins (A)" in a new tab.
  3. Saving the best to read for last, open "C. McDavid (C)" in a new tab.

Expected behavior

My new tabs are listed in the order I opened them. First is Draisaitl, next Nugent-Hopkins, and finally McDavid.

Actual behavior

My new tabs re listed in reverse order from how I opened them. First is McDavid, then Nugent-Hopkins, and finally Draisaitl.
This behavior is counter-intuitive. If I'm opening links as I come across them, that's the order I plan to read them in. Instead I get a reverse order which, if I've opened a half-dozen tabs as I often do, gets a bit confusing to work backwards through.

Device information

  • Device vendor / model and Android version: Pixel 2 XL / Android 11
  • Firefox for Android version: ? 89.1.1 (Build #2015812947)

┆Issue is synchronized with this Jira Task

Change performed by the Move to Bugzilla add-on.

I'm interested on working on this.

Should we make this a settings which could let use choose to 1) append tab next to the parent or 2) append tab next to the last child of parent ?

A quick functional implmenation of 2)

diff --git a/android-components/components/browser/state/src/main/java/mozilla/components/browser/state/reducer/TabListReducer.kt b/android-components/components/browser/state/src/main/java/mozilla/components/browser/state/reducer/TabListReducer.kt
index 99ce05b2..c9092428 100644
--- a/android-components/components/browser/state/src/main/java/mozilla/components/browser/state/reducer/TabListReducer.kt
+++ b/android-components/components/browser/state/src/main/java/mozilla/components/browser/state/reducer/TabListReducer.kt
@@ -25,13 +25,16 @@ internal object TabListReducer {
                 requireUniqueTab(state, action.tab)
 
                 val updatedTabList = if (action.tab.parentId != null) {
-                    val parentIndex = state.tabs.indexOfFirst { it.id == action.tab.parentId }
-                    if (parentIndex == -1) {
-                        throw IllegalArgumentException("The parent does not exist")
+                    val lastChildOrParentIndex =  state.tabs.indexOfLast {
+                        it.parentId == action.tab.parentId || it.id == action.tab.parentId
+                    }
+
+                    if (lastChildOrParentIndex == -1) {
+                        throw IllegalArgumentException("Parent or last child do not exist")
                     }
 
                     // Add the child tab next to its parent
-                    val childIndex = parentIndex + 1
+                    val childIndex = lastChildOrParentIndex + 1
                     state.tabs.subList(0, childIndex) + action.tab + state.tabs.subList(childIndex, state.tabs.size)
                 } else {
                     state.tabs + action.tab
Flags: needinfo?(cpeterson)

Hi Jacky, thanks for your interest in this bug!

I don't know what tab behavior we should use. I will send this bug to our UX design team. Getting an answer could take a few weeks because they have a long backlog of other designs to create and review.

In the meantime, I recommend checking out Android bugs that don't require UX design changes. Here's a list of some good bugs:

https://codetribute.mozilla.org/projects/fenix

Severity: -- → S3
Flags: needinfo?(cpeterson)
Priority: -- → P3
Whiteboard: [fxdroid] [Needs-UX]

@ UX: please review all the comments in the original GitHub issue: https://github.com/mozilla-mobile/fenix/issues/20217

People there say Fenix's current behavior seems intentional but is inconsistent with Firefox Desktop's tab behavior.

Any status update on this? It's extremely annoying to browse my morning news sites, open all the headlines in new tabs, and then have to go to the last tab and read the stories in reverse order.

See Also: → 1812926
See Also: → 1861824
Duplicate of this bug: 1861824

I would like this to be a setting. After some initial annoyance, I started really liking this behavior. For example, with news pages, I read them from top to bottom and open pages in the background. Then I close the news page and start reading the opened pages so that I read them from oldest news to newest one as they happened in reality.

It's worth noting that it seems this was actually previously brought to implementation¹. only to be postponed for purely backend reasons².

Unfortunately, it seems the PR was closed (not merely postponed), then fell through the cracks before being lost in the repository rename and subsequent move to mozilla-central/bugzilla.

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