Tab group context menu actions fail when right-clicking the label or icon of a tab groups list row
Categories
(Firefox :: Tabbed Browser: Tab Groups, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox155 | --- | fixed |
People
(Reporter: bugzilla, Assigned: bugzilla, NeedInfo)
Details
Attachments
(1 file)
STR (with browser.tabs.groups.alternateMenu enabled):
- Create a tab group
- Open the tab groups list (app menu > Tab Groups, or the Tab Groups toolbar button)
- Right-click directly on the label text (or icon) of a group row
- Choose any item, e.g. "Delete Group"
Expected results:
- The action applies to the right-clicked tab group
Actual results:
- Nothing happens, and a
TypeError: tabGroup is nullerror is logged frommain-popupset.js
Root cause:
tab-groups-list.mjs opens open-tab-group-context-menu / saved-tab-group-context-menu via openPopupAtScreen(..., event), so the popup's triggerNode is the original event target. When the right-click lands on the row's .tab-group-row-label or icon, the triggerNode is that descendant element rather than the row button carrying data-tab-group-id, so the handlers in main-popupset.js read tabGroupId as undefined and gBrowser.getTabGroupById() returns null. The handlers should resolve the group via triggerNode.closest("[data-tab-group-id]").
Right-clicking the padding area of the row works, which is why this is easy to miss.
See also: https://bugzilla.mozilla.org/show_bug.cgi?id=2044855
The tab group context menus in the tab groups list are opened with
openPopupAtScreen(..., event), so the popup's triggerNode is the
original event target. When the right-click lands on a row's label or
icon, the triggerNode is that descendant element rather than the row
button carrying data-tab-group-id, making every menu action fail with
'tabGroup is null'. Resolve the tab group id via
triggerNode.closest("[data-tab-group-id]") instead.
Updated•3 months ago
|
Comment 2•2 months ago
|
||
Hi :Fede, I'm not able to reproduce this as described in your initial comment on the latest Nightly build (154.0a1 (2026-06-18) on macOS). I tried from both the application menu and the new tab groups toolbar item. I was sure to try clicking on the tab group label text and the icon, but both of them close the tab group correctly and no errors appear in the browser console.
Are you still able to reproduce? If so, could you share a video?
Hi Jeremy, here is a link to a short gif that shows the problem. You can see that when I right click to delete a tab group, it is not immediately visually removed. I first have to close the menu and then go back to it to visually confirm the deletion of the tab group.
I am showing this currently on 153.0a1 Ubuntu 24.04 (WSL). However I can reproduce this in my current Firefox version that I run daily on my Windows. I hope this helps and let me know if you need more information from my side, I'm happy to provide it.
Comment 5•2 months ago
|
||
| bugherder | ||
Comment 6•2 months ago
|
||
| bugherder | ||
Backed out for causing bc failures @browser_tab_groups_list.js.
Comment 9•2 months ago
|
||
There is an r+ patch which didn't land and no activity in this bug for 1 week.
:bugzilla, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit BugBot documentation.
| Assignee | ||
Comment 10•2 months ago
|
||
The backout was caused by a windows-only race in the new test, not by the code change itself. After activating "Delete Group" in the first context menu, the test immediately right-clicked to open the second context menu without waiting for the first one to close. On Windows the menu rollup is slow enough that the second contextmenu event gets swallowed, so the test timed out. I've updated both patches in the stack (D306142, D306143) so the test waits for the context menu's popuphidden event before continuing. This matches what test_contextMenus in the same file already does.
Because I don't have try access to verify on Windows myself, could you push the stack to try and re-land it?
Comment 11•1 month ago
|
||
Comment 12•1 month ago
|
||
| bugherder | ||
Updated•25 days ago
|
Description
•