tabs.group() to a new window prepends a split view instead of appending it
Categories
(WebExtensions :: Frontend, defect, P2)
Tracking
(firefox151 fixed)
| Tracking | Status | |
|---|---|---|
| firefox151 | --- | fixed |
People
(Reporter: robwu, Assigned: robwu)
References
(Blocks 1 open bug)
Details
(Whiteboard: [addons-jira])
Attachments
(1 file)
|
48 bytes,
text/x-phabricator-request
|
Details |
In bug 2029099, I wrote a unit test that a split view can join a tab group in another window. The unit test however failed and demonstrates that the adoption of a split view results in the split view unexpectedly appearing at the left of the tab group, instead of at the right.
This is because internally, group.addTabs is called, which ought append tabs to a tab group.
In the regular case, tabIndex is used to select the last tab, but in the split view case, somehow elementIndex is used instead by addTabs (source). Changing it to tabIndex causes the unit test to pass.
I'm splitting the fix from bug 2029099, because the implementation changes in the other bug are 100% extension code, whereas this bug is caused by the implementation of tabbrowser. This logic was added relatively recently in bug 2006386.
| Assignee | ||
Comment 1•1 month ago
|
||
Btw, changing elementIndex to tabIndex does not cause the test from bug 2029099 to fail, because the test there only checks whether the split view was moved, not where exactly it moved to: https://searchfox.org/firefox-main/rev/0989a082704f0bda8d370ccd57402645d834757e/browser/components/tabbrowser/test/browser/tabs/browser_tab_groups_tabContextMenu.js#567-572
Perhaps the exact location is not significant for the UI, but in the extension API we want consistent behavior, so I'm going to propose a patch that changes elementIndex to tabIndex.
Updated•1 month ago
|
| Assignee | ||
Comment 2•1 month ago
|
||
The regular (non split view) case already uses tabIndex, which
results in the desired effect of appending tabs to a group.
In the split view case, the use of elementIndex instead of tabIndex
caused the split view to be inserted before ab existing group instead of
appended. Changing this to tabIndex fixes this inconsistency.
Updated•1 month ago
|
Comment 4•1 month ago
|
||
| bugherder | ||
Description
•