Closed Bug 1980999 Opened 8 months ago Closed 8 months ago

Can't expand collapsed tab group while hover preview is open

Categories

(Firefox :: Tabbed Browser, defect, P2)

Firefox 143
Unspecified
Linux
defect

Tracking

()

RESOLVED DUPLICATE of bug 1981197
Tracking Status
firefox143 --- affected

People

(Reporter: sthompson, Unassigned)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [fidefe-tabgrps])

Attachments

(2 files)

Report from a Firefox Linux user of Nightly 143 (2025-08-03) that clicking the tab group label of a collapsed tab group does not expand the group as expected.

Cannot reproduce on macOS.

It seems from the video like it's possible to expand the group if the tab group hover preview panel is not present. When the tab group hover preview panel is present and the user clicks, the panel flickers but the tab group stays collapsed. This suggests that the click event may not be propagating to the <tab-group> element, but that is not proven.

I can reproduce on Ubuntu 24.04 with Wayland, but I can't reproduce with Ubuntu 24.04 with X11.

Sometimes, if I move my mouse onto the tab group label slowly from the bottom, the tab group hover preview panel pops up such that the cursor is right near the top of the panel. When I click, nothing appears to happen. In this scenario, I'm able to capture the click event using a handler on the tabGroupPreviewPanel.panel element in tabs.js and the target of the click is menupopup#tabgroup-preview-panel.toolbar-menupopup.

However, sometimes I move my mouse and hover over the tab group label and it appears that my mouse is over the tab group label, not the panel. When I click, the panel disappears and reappears very quickly, the same way it appears in the video attached to this bug. In this scenario, neither the click handler on the <tab-group> nor the click handler I installed on the preview panel were receiving the click. I'm not sure where the click is going...

If I move my mouse onto the tab group label from the left, top, or right, I see a single call to activate. If I move my mouse onto the tab group label from the bottom, I see several activate <-> deactivate cycles in a fraction of a second, which is visible to me as a flickering menu. That has the same appearance as what I described above when clicking the tab group label and getting a flickering menu.

In the normal case, the tab group hover preview gets activated from tabgroup.js:on_mouseover dispatching TabGroupLabelHoverStart to tabs.js. The preview is deactivated from tabgroup.js:on_mouseout dispatching TabGroupLabelHoverEnd.

In the buggy case, right after activation, the tabgroup-hover-preview.mjs:handleEvent gets a mouseout event from the panel, which deactivates it. That causes an immediate reactivation from the tabgroup.js:on_mouseover, and then another immediate deactivation. I've observed this cycle happening between 2 to 4 times. I'm not sure what condition is leading to the cycle ending and the panel staying open.

When mousing across the horizontal tab strip, the handoff between the tab hover preview and the tab group hover preview is not always foolproof on Wayland. Maybe there is a different pattern of event emissions? The oddity around the bottom edge of the tab group labels also seems weird because I wouldn't expect there to be differences in the position of the menu.

When I tweak the -2 in https://searchfox.org/mozilla-central/rev/4fd0d5e4669bfa2d0888b730684d8adea061fd30/browser/components/tabbrowser/content/tabgroup-hover-preview.mjs#122 to 0, making the menu sit a bit lower, the number of flickering cycles decreases substantially but is still present. Usually only 1 cycle. Sometimes I saw an activate -> activate -> deactivate cycle, which I hadn't seen before. When I made it 2 in order for the menu not to overlap the tab group label at all, flickering was still rare but also still present. Increasing to 4 led to activate -> deactivate -> deactivate, I assume since there was a gap between the label and the panel so that both received a mouseout.

Flags: needinfo?(jswinarton)

Hi Stephen, thanks for the detailed write-up. I have a couple thoughts.

  1. The issue with the flickering was known and was addressed as part of my work on bug1971237 (one of the criteria was "It should be possible to switch between this panel and THP without animation jitters." This has been resolved as part of that patch).

  2. I was able to reproduce the issue that prevents the label from consuming the click. For me it only seems to happen if the cursor is in an area that is very close to the hover panel, which is presumably being interpreted as part of the panel's bounding box. However, we also have bug1981197 on file to adjust the positioning of the panel which is currently not to spec. In horizontal mode, the top edge of the panel should line up with the top edge of the tab hover panel, which is positioned just below the tab strip. I believe that this fix will remove the overlap between the two elements and will probably fix the issue in passing.

If you agree, I think it may be best to call this a duplicate of bug1981197 and re-open it if for some reason that does not resolve the issue.

Flags: needinfo?(jswinarton) → needinfo?(sthompson)
Status: NEW → RESOLVED
Closed: 8 months ago
Duplicate of bug: 1981197
Flags: needinfo?(sthompson)
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: