Closed Bug 1932489 Opened 9 months ago Closed 6 months ago

Tab group label should shift over when dragging first tab out of group

Categories

(Firefox :: Tabbed Browser, defect, P1)

defect
Points:
3

Tracking

()

VERIFIED FIXED
136 Branch
Tracking Status
firefox136 --- verified

People

(Reporter: amylee, Assigned: dao)

References

(Blocks 1 open bug, Regressed 1 open bug)

Details

(Whiteboard: [fidefe-tabgrps-dnd] [UX-tabgrps-review])

Attachments

(2 files, 2 obsolete files)

Steps to reproduce [can add screenshots or video recordings for reference]:

  1. Create a tab group with 2 or more tabs and have an ungroup tab to the left of the group
  2. Drag the first tab in the group (next to label) to the left and out of the group

Expected behavior [What should have happened?]:
The tab group shifts over to the right

Actual behavior [What actually happened?]:
Tab group doesn't move so the ungrouped tab on the left shifts over and overlaps with the tab group label (see video)

Blocks: 1907101
Points: --- → 2
Depends on: 1926382
Priority: -- → P1
Summary: Tab group label should shift over when dragging tab out of group → Tab group label should shift over when dragging first tab out of group
Whiteboard: [fidefe-tabgrps-tabbrowser] [UX-tabgrps-review] → [fidefe-tabgrps-dnd] [UX-tabgrps-review]

Removing the first tab from a group shouldn't move that tab to the end of the group instead it should attach the group label to the next tab.

ungroupTab(tab) {
      if (!tab.group) {
        return;
      }

      this._handleTabMove(tab, () =>
        gBrowser.tabContainer.insertBefore(tab, tab.group.nextElementSibling)
      );
    }

add check here if the tab is the first in the group and not the last tab or single tab use gBrowser.tabContainer.insertBefore(tab, tab.group.previousElementSibling.nextElementSibling)

Severity: -- → S4

Bug 1926382 fixed most of the visual/interface issues with tab group labels during drag drop using a simple code change. The tradeoff was that the tab group label and the first tab in that tab group are being animated together, which doesn't allow for the first tab in the tab group to be dragged well.

I haven't been able to think of a clever shortcut to making tabs and tab group labels work together well in all cases.

No longer blocks: 1935307

(In reply to tabmix.onemen from comment #1)

Removing the first tab from a group shouldn't move that tab to the end of the group instead it should attach the group label to the next tab.

ungroupTab(tab) {
      if (!tab.group) {
        return;
      }

      this._handleTabMove(tab, () =>
        gBrowser.tabContainer.insertBefore(tab, tab.group.nextElementSibling)
      );
    }

add check here if the tab is the first in the group and not the last tab or single tab use gBrowser.tabContainer.insertBefore(tab, tab.group.previousElementSibling.nextElementSibling)

I think you are describing a different interaction. This bug is about dragging the first tab out of a tab group. It sounds like you are describing the behavior for the "Remove from Group" context menu option when right-clicking on a tab inside of a tab group.

I filed bug 1935307 to capture your recommendation. Thanks!

Assignee: nobody → sthompson
Attachment #9446578 - Attachment description: WIP: Bug 1932489: drag/drop with `elementFromPoint` and "tab strip position" → Bug 1932489: drag/drop with `nodesFromRect` and a new "tab strip position" `elementIndex` r=dao,dwalker,jswinarton
Points: 2 → 3
Attachment #9446578 - Attachment is obsolete: true
Attachment #9460424 - Attachment description: WIP: Bug 1932489: Drag/drop based on "element index" instead of tab index → Bug 1932489: Drag/drop based on "element index" instead of tab index. r=jswinarton
Attachment #9461559 - Attachment is obsolete: true
Assignee: sthompson → dao+bmo
Duplicate of this bug: 1944466
Duplicate of this bug: 1926387
Pushed by dgottwald@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f8fda1ba5cd3 Drag/drop based on "element index" instead of tab index. r=tabbrowser-reviewers,jswinarton
Status: NEW → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 136 Branch

Verified as fixed in our latest Nightly build 136.0a1 (2025-01-30).

Status: RESOLVED → VERIFIED
Regressions: 1944844

The comment above greatestOverlap indicate
If the elements have different sizes, then this returns the larger overlap percentage.

but there is a 3rd case that you did not cover

*   p2            p1      p1+s1    p2+s2
*    |             |        |        |
*    ---------------------------------
*    =================================
*                   s2
*                  ==========
*                      s1
*                  ==========
*                   overlap

When element 1 is completely inside element 2 set overlapSize = s1
and the function greatestOverlap should return s1 in this case

Dragging tabs is a mess in RTL browser

Regressions: 1945440

(In reply to tabmix.onemen from comment #13)

Dragging tabs is a mess in RTL browser

I've filed bug 1945440, will attach a patch shortly. Please file new bugs if you find more issues.

Blocks: 1945463
Regressions: 1945788
Regressions: 1946349

Updating the Status flag for this issue since this was already verified, unless there is a reason why this was changed back to Fixed in which case I apologize for updating it again.

No longer blocks: 1938049
Blocks: 1950113
See Also: → 1955391
Regressions: 1974305
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: