Commit Graph

356 Commits

Author SHA1 Message Date
Jeremy Swinarton
520c64e4d9 Bug 1905944: Fix intermittents in browser_tab_preview.js r=sthompson,tabbrowser-reviewers, a=test-only
This patch fixes a number of issues that clear up a few different
intermittents in browser_tab_preview.js.

1. In browser_tab_groups_tab_interactions_telemetry.js, a call to "close
   duplicate tabs" would automatically open the confirmation hint panel.
   If not manually closed, it seems to persist in a half-way open state
   where the `animating` attribute is always `true`. This is now fixed.

2. There is a test somewhere that seems to apply the
   `sidebar.verticalTabs` pref and doesn't turn it off. I would like to
   figure out which test is causing this, but as a last defence I have
   made sure this is always properly set within this test suite.

3. Some tests check that THP is disabled if another panel is open. These
   used to work by opening the `appMenu-popup` menu (the hamburger menu
   in the top right of the browser). The problem with this approach is
   that this panel (and basically every other panel) are very complex
   and are prone to change. This was causing an intermittent failure
   where attempting to close this panel threw an error in console that
   seemed to be specifically related to this panel. I fixed this by
   creating a fake minimal panel that is guaranteed to not change as
   application code changes. (I borrowed this technique from
   https://searchfox.org/mozilla-central/source/browser/base/content/test/popupNotifications/browser_popupNotification_queue.js).

4. There is a suite of tests that checks that THP is disabled in the
   event that a drag operation is performed. The problem is that
   dragging a tab by 100px sometimes detaches the tab and creates a new
   window, breaking the test run. Reducing the drag amount seems to fix
   this.

5. As a last line of defence, I have added a state reset function at the
   start of each test to ensure that all panels are closed and that the
   mouse is not hovering over the tab strip. (The latter was being done at
   the end of some tests already, but this makes sure it is consistently
   applied everywhere.)

Closes bug1898099, bug1905944, bug1933597.

Differential Revision: https://phabricator.services.mozilla.com/D258976
2025-08-05 20:51:35 +00:00
Jeremy Swinarton
1f70d01002 Bug 1961161: Additional metrics for closing tabs within groups r=dwalker,fxview-reviewers,tabbrowser-reviewers,nsharpley
Differential Revision: https://phabricator.services.mozilla.com/D248438
2025-05-22 22:03:01 +00:00
Sandor Molnar
630b142f33 Bug 1648512 - Disable test browser_newwindow_tabstrip_overflow.js on linux debug for frequent failures. r=tabbrowser-reviewers,dao DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D250593
2025-05-22 10:46:54 +00:00
Serban Stanca
aca3a7922b Bug 1921835 - fix lint failure in browser/components/tabbrowser/test/browser/tabs/browser_multiselect_tabs_move.js. 2025-05-21 15:14:08 +00:00
Jeremy Swinarton
13b5e48685 Bug 1921835: Move tab to start/end enabled when collapsed group on tab strip edge r=dao,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D249846
2025-05-21 13:55:24 +00:00
Dão Gottwald
e0a00e5f7d Bug 1966912 - Remove addTab's index alias for the tabIndex parameter. r=extension-reviewers,sessionstore-reviewers,tabbrowser-reviewers,robwu,dwalker
Differential Revision: https://phabricator.services.mozilla.com/D249783
2025-05-20 12:06:21 +00:00
Sandor Molnar
32b4815cfe Revert "Bug 1966912 - Remove addTab's index alias for the tabIndex parameter. r=extension-reviewers,sessionstore-reviewers,tabbrowser-reviewers,robwu,dwalker" for causing remote failures @ browser_TabManager.js
This reverts commit 38a0034022.
2025-05-19 21:07:58 +00:00
Dão Gottwald
38a0034022 Bug 1966912 - Remove addTab's index alias for the tabIndex parameter. r=extension-reviewers,sessionstore-reviewers,tabbrowser-reviewers,robwu,dwalker
Differential Revision: https://phabricator.services.mozilla.com/D249783
2025-05-19 19:48:54 +00:00
Dão Gottwald
0007fe7bd1 Bug 1966617 - Make adoptTabGroup support both elementIndex and tabIndex, and stop converting tab indices to element indices. r=robwu,sthompson,tabbrowser-reviewers,sessionstore-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D249619
2025-05-16 00:39:26 +00:00
Vasish Baungally
33c648d5ab Bug 1964774 - Improve Suggest Latency for Smart Tabs by preloading. r=ngrato,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D248098
2025-05-13 01:47:38 +00:00
Stephen Thompson
5b3f57be44 Bug 1954005 - URL bar search should not show saved tab groups in private windows r=dao,dwalker,urlbar-reviewers,tabbrowser-reviewers
In bug 1933744 we prevented SessionStore from reopening a saved tab group into a private window. In bug 1946761 we prevented users from saving tab groups from a private window. The general design principle has been to prevent tab group information leaking between private and non-private windows.

ActionsProviderTabGroups already respected privacy through the implementation of `Tabbrowser.getAllTabGroups`, but `SessionStore.getSavedTabGroups` doesn't respect privacy. Perhaps it should. But in any case, this patch ensures that search results in private windows don't include saved tab groups.

Differential Revision: https://phabricator.services.mozilla.com/D248351
2025-05-12 15:19:01 +00:00
DJ
4c6277efaf Bug 1957488 - record reopen event when reopening a deleted tab group. r=sthompson,sessionstore-reviewers,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D248250
2025-05-09 15:00:22 +00:00
DJ
37e0d71a14 Bug 1956458 - Always place group after pinned tabs when creating a group from the context menu. r=sthompson,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D248533
2025-05-09 14:56:17 +00:00
Gijs Kruitbosch
728ff6d544 Bug 1965273 - support up/down shortcut keys on macOS for tabswitches, r=tabbrowser-reviewers,sthompson
Differential Revision: https://phabricator.services.mozilla.com/D248464
2025-05-08 21:37:15 +00:00
Stephen Thompson
b7d69dd476 Bug 1963713 - add tab group ungroup metric event r=dao,tabbrowser-reviewers
Record when a user ungroups the tabs of a tab group.

We ungroup an entire group when the user selects the "Ungroup tabs" context menu item on the tab group, but we also do that if the user cancels out of tab group creation context menu. We are particularly interested in understanding when users cancel out of the creation process. This may give us a better indicator about accidental tab group creation, e.g. when the user intended to drag and drop to move a tab but ended up creating a tab group from two tabs.

Differential Revision: https://phabricator.services.mozilla.com/D247633
2025-05-07 15:05:43 +00:00
DJ
4e0c51a78e Bug 1956458 - Unpin tabs when they are added to a group. r=dao,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D247597
2025-05-07 13:30:59 +00:00
Jeremy Swinarton
186b5eaa63 Bug 1964152: Dispatch TabGrouped and TabUngrouped from the tab group, not the tab r=dao,sthompson,tabbrowser-reviewers,zombie
Differential Revision: https://phabricator.services.mozilla.com/D247660
2025-05-06 15:43:04 +00:00
Vasish Baungally
fa152cc2f8 Bug 1962228 - Add Telemetry for Pref Changes for Smart Tab Groups. r=rrando,tabbrowser-reviewers,sthompson
Differential Revision: https://phabricator.services.mozilla.com/D246800
2025-05-01 21:19:51 +00:00
DJ
1a51ae6a74 Bug 1952900 - improve resilience of tab group removal in browser_tab_groups_closed.js. r=jswinarton,sessionstore-reviewers,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D247115
2025-05-01 20:50:13 +00:00
Vasish Baungally
9d3b433aa4 Bug 1963120 - Update Nimbus Recipe for Smart Tab Groups. r=rrando,Mardak,tabbrowser-reviewers
New Parameters Added:
1. Suggest Other Tabs Methods
2. Topic and Embedding Model Revisions
3. Nearest Neighbor Threshold

Differential Revision: https://phabricator.services.mozilla.com/D246968
2025-05-01 02:27:16 +00:00
Stephen Thompson
37cc744292 Bug 1962434 - raise TabGroupCreate when tab group element mounts r=dao,tabbrowser-reviewers
Session restore code doesn't use the standard Tabbrowser.addTabGroup API, so tab groups that enter the DOM via session restore don't raise any TabGroupCreate events. To be consistent, and in order to support addons that need to have an up-to-date view of the tab strip, this patch fires TabGroupCreate on each tab group that enters the DOM.

This patch renames the existing `TabGroupCreate` fired from Tabbrowser.addTabGroup to `TabGroupCreateByUser`. This new event will fire after the tab group enters the DOM (therefore after `TabGroupCreate`) in scenarios where code calls Tabbrowser.addTabGroup with `isUserTriggered = true` to indicate that a user took an explicit action to create this tab group as a new tab group.

Differential Revision: https://phabricator.services.mozilla.com/D246630
2025-04-29 20:08:49 +00:00
Vasish Baungally
ec0f2e522f Bug 1962327 - Add Logistic Regression Method for Smart Tab Groups Suggest. r=rrando,tabbrowser-reviewers
We are still using the nearest neighbor approach as default. This method will be tested along with Kmeans via Nimbus.

From preliminary perf. testing, it's also more performant.

Differential Revision: https://phabricator.services.mozilla.com/D246551
2025-04-24 19:49:17 +00:00
Vasish Baungally
11f63f2b75 Bug 1961641 - Add Telemetry when Smart Tab Model has no suggestion. r=ngrato,tabbrowser-reviewers
We were initializing two SmartTabGroupingManager instances in tabbrowser and tabgroup-menu. This was
causing issues with telemetry. This is now cleaned up.

Also, adding the model reason for no suggestion per DS request.

Differential Revision: https://phabricator.services.mozilla.com/D246113
2025-04-24 15:43:23 +00:00
Stephen Thompson
f8fe0335c0 Bug 1938401 - tab group interaction metrics r=dwalker,sessionstore-reviewers,tabbrowser-reviewers
Records counts of user interactions with tab groups:

- expand a collapsed tab group
- collapse an expanded tab group
- rename a tab group
- change a tab group's color
- save and close a tab group
- delete a tab group
- reopen a deleted tab group
- ungroup a tab group
- move a tab group to a new window
- reopen a saved and closed tab group from the list all tabs menu
- reopen a saved and closed tab group from a URL bar suggestion
- reopen a recently closed tab group from the recently closed tabs menu

Differential Revision: https://phabricator.services.mozilla.com/D246123
2025-04-24 02:20:14 +00:00
Stanca Serban
00a5fe61ef Backed out changeset b39679990d56 (bug 1961086) for causing mochitests failures in browser_tab_grouping.js. CLOSED TREE 2025-04-24 03:59:01 +03:00
Rolf Rando
aab9a34904 Bug 1961086 - search suggest r=vazish,tabbrowser-reviewers,dwalker
Differential Revision: https://phabricator.services.mozilla.com/D245852
2025-04-23 22:48:24 +00:00
Stephen Thompson
36e1885b72 Bug 1951859 Part 3 - add tab group name to tab tooltips/a11y description r=dwalker,tabbrowser-reviewers,fluent-reviewers,bolsson
For the first and last tab in a tab group, include the tab group's name in the accessibility description read by screen readers when the tab is in focus. As keyboard users go through the tab strip, the users will receive clues that they are passing into/out of a tab group.

This also reformats the tab tooltips in general.

Before:
```
$title $pid $active - $containerName
$audioPlaying
```
After:
```
$title
$pid $active
$tabGroupName - $containerName
$audioPlaying
```
For each portion of the tab tooltip string, parts of the string might not appear due to configuration (PIDs and active only shown with pref) or user state (container name only shown for a container tab, etc.) or UX choices (don't include the title in the accessibility description because screen readers already read out a tab's title by default)

Differential Revision: https://phabricator.services.mozilla.com/D245186
2025-04-23 17:49:15 +00:00
Stephen Thompson
eacb38eda0 Bug 1961159 - only refresh TabsList DOM when it is open r=dwalker,tabbrowser-reviewers
If a DOM rebuild was scheduled on a previous frame but the rebuild is no longer needed (e.g. due to the "list all tabs" menu no longer being open) then do not clean up nor populate the DOM.

In bug 1953533 we debounced and delayed full DOM rebuilds of the "list all tabs" menu due to severe performance impacts during event-heavy operations like restoring an entire browser session.

When the "list all tabs" menu is closed, it's supposed to get emptied and stop responding to events. However, it was possible to perform actions in the "list all tabs" menu that would trigger events and close the menu at the same time. The triggered event would schedule a "list all tabs" menu rebuild on the next frame, which would then build the "list all tabs" menu DOM despite the menu being closed. When the menu was reopened, the menu builds the menu DOM by inserting new DOM elements, but since the menu was already built, you end up with a doubled version of the tab strip.

Differential Revision: https://phabricator.services.mozilla.com/D246047
2025-04-23 17:45:16 +00:00
Jeremy Swinarton
39096a611c Bug 1960360: Tab interaction metrics for dragging tabs out of groups r=sthompson,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D245749
2025-04-17 16:29:29 +00:00
Jeremy Swinarton
4a0e2c38cc Bug 1938405: Tab interaction metrics for tab groups r=dao,sthompson,tabbrowser-reviewers
This patch adds the most basic tab interaction metrics for tab groups.
As discussed in standup, we agreed to move the `remove_` class of
metrics into its own bug due to extra complexity involved in correctly
capturing these events.

One other thing we discussed was what the scope of events should be for
the `close_` class of events, i.e. should we *only* capture an event
when someone clicks the "X" button or closes from the TOM menu, or
should we also account for things like context menus, keyboard
shortcuts, etc.? Originally we agreed to capture _all_ tab close events
and mark any source that was not one of the above mentioned two as
unknown. However, after thinking about this more, I don't believe this
is the right approach. There are many places in the codebase where a tab
is closed but not because a user deliberately did it (e.g. when moving a
tab to a new window — this is actually done by creating a new tab in a
new window and closing the old). We currently don't distinguish between
user-initiated close actions, so it would take some time to find all
these places and exclude them.

I favour an explicit inclusion approach (which is what we are doing
elsewhere). In this patch I added events for:
  - closing a tab from the "X" close button (`close_tabstrip`)
  - closing a tab from the tab context menu (`close_tabstrip`)
  - closing a tab from the TOM (`close_tabmenu`)

There are other places that could potentially be
addressed, so I suggest moving these to a follow-up bug and addressing
them for 139.

Differential Revision: https://phabricator.services.mozilla.com/D244915
2025-04-16 15:01:28 +00:00
Cosmin Sabou
2d6874fa8c Backed out changeset d3742b523ca9 (bug 1956381) for not working. 2025-04-16 04:46:25 +03:00
Stephen Thompson
a69b839b0d Bug 1951859 Part 2 - set ARIA posinset/setsize on tabs in tab groups r=jswinarton,tabbrowser-reviewers
Set aria-setsize on grouped tabs to the number of tabs in the tab group. Set aria-posinset on grouped tabs to the 1-based index of the tab within the tab group. This allows some a11y tools to report to the user that a tab is, for example, tab "2 of 7" in a tab group.

The tab strip uses the `tablist` ARIA role. The ARIA spec and Firefox's a11y engine both forbid nesting `group` ARIA roles inside of `tablist`. As a result, a11y tools always read individual tabs as being tab "X of Y", where Y is the number of tabs in the tab strip and X is the index of the tab in the tab strip. This is good information, but it does not give the user a sense of where a tab is within a tab group.

Differential Revision: https://phabricator.services.mozilla.com/D245185
2025-04-15 19:49:58 +00:00
Stephen Thompson
a428585296 Bug 1951859 Part 1 - set aria-level on tabs r=jswinarton,tabbrowser-reviewers
Tabs outside of tab groups are at the top level (level 1) while tabs inside of tab groups are at the next lower level (level 2). This helps unsighted users get a better sense about the hierarchy of the tab strip.

Differential Revision: https://phabricator.services.mozilla.com/D245184
2025-04-15 19:25:18 +00:00
Vasish Baungally
ef0b50f888 Bug 1960683 - Prevent event from being sent for Smart Tab Grouping if not opted-in. r=tabbrowser-reviewers,sthompson
Differential Revision: https://phabricator.services.mozilla.com/D245601
2025-04-15 16:52:05 +00:00
DJ
5aee67aeb3 Bug 1956381 - fix window leak in browser_tab_groups_telemetry.js. r=dao,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D245432
2025-04-15 14:26:07 +00:00
Cristian Tuns
064788b440 Backed out changeset 09282b03f0cf (bug 1951859) for causing eslint failures CLOSED TREE 2025-04-15 10:19:02 -04:00
Stephen Thompson
bfd5fbb4d0 Bug 1951859 Part 1 - set aria-level on tabs r=jswinarton,tabbrowser-reviewers
Tabs outside of tab groups are at the top level (level 1) while tabs inside of tab groups are at the next lower level (level 2). This helps unsighted users get a better sense about the hierarchy of the tab strip.

Differential Revision: https://phabricator.services.mozilla.com/D245184
2025-04-15 14:03:09 +00:00
Butkovits Atila
710980cfd1 Bug 1934436 - disable browser_bfcache_exemption_about_pages.js for frequent Linux Debug failures. r=intermittent-reviewers,tabbrowser-reviewers,mak,jmaher DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D245345
2025-04-14 21:12:25 +00:00
Stephen Thompson
8551cfa4aa Bug 1938398 - add saved tab group metrics r=jswinarton,sessionstore-reviewers,tabbrowser-reviewers
- record number of saved tab groups
- record min/max/median/average number of tabs in saved tab groups

This patch adds a new observable topic `sessionstore-saved-tab-groups-changed` to SessionStore. This is emitted when a saved tab group is added or removed from the session. BrowserUsageTelemetry subscribes to that topic and updates saved tab group-related metrics.

BrowserUsageTelemetry is also setting those saved tab group-related metrics on startup. BrowserGlue initializes BrowserUsageTelemetry after the session has been restored/set up, so saved tab group information will be available at that time. This is also important to make sure that we keep this metric correct even if a user doesn't touch their saved tab groups during the course of a session.

Differential Revision: https://phabricator.services.mozilla.com/D245138
2025-04-14 16:01:39 +00:00
Dão Gottwald
157f63d52d Bug 1960296 - Account for moz-button in addition to toolbarbutton when handling the Enter key. r=dwalker,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D245392
2025-04-14 16:00:57 +00:00
DJ
a148a1cdd9 Bug 1948702 - when grouping a tab via the context menu, select it. r=dao,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D245323
2025-04-14 14:54:09 +00:00
Dão Gottwald
a07bd270a0 Bug 1953179 - Fix enter key handling on toolbarbuttons in tab group menu. r=dwalker,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D245220
2025-04-13 10:34:15 +00:00
Cristina Horotan
58439062ed Backed out changeset fa742bc59c5c (bug 1953179) for causing perma bc failures at browser_tab_groups.js. CLOSED TREE 2025-04-12 06:00:55 +03:00
DJ
8d4e1072b5 Bug 1959981 - ensure scotchBonnet is enabled for tabgroup telemetry tests. r=tabbrowser-reviewers,dao
Differential Revision: https://phabricator.services.mozilla.com/D245281
2025-04-11 19:46:35 +00:00
Dão Gottwald
d07c1829fd Bug 1959730 - Dispatch TabMove events when moving a group within the tab strip. r=sthompson,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D245218
2025-04-11 15:18:48 +00:00
Dão Gottwald
f33d1d2b0c Bug 1953179 - Fix enter key handling on toolbarbuttons in tab group menu. r=dwalker,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D245220
2025-04-11 15:02:06 +00:00
Stephen Thompson
f2e07044ae Bug 1938424 - metrics event when tabs added to tab group r=dao,jswinarton,tabbrowser-reviewers,extension-reviewers,robwu
When using the tab context menu or drag-dropping tabs to put them into a group, record a metric for the number of tabs added to the group.

Data Science asked us to launch with this metric disabled so that they could control it using server knobs. They expect a high volume of events, so they expect to only enable this metric for some proportion of users.

I converted the existing `TabMove` event derived from `UIEvent` being fired when tabs change their tab index in the tab strip. `UIEvent` doesn't allow for attaching additional context/detail to the event. `TabMove` is now a `CustomEvent` that provides more context about the moved tab and it fires in more cases -- it's possible for the tab index not to change despite the tab having "moved" into/out of a tab group.

This approach would not capture tab movements that occur across multiple frames/event loop iterations.

Differential Revision: https://phabricator.services.mozilla.com/D244616
2025-04-11 13:52:22 +00:00
DJ
91384c4388 Bug 1938425 - add telemetry for reopening saved groups. r=dao,sessionstore-reviewers,tabbrowser-reviewers,urlbar-reviewers,sthompson
Differential Revision: https://phabricator.services.mozilla.com/D243737
2025-04-10 17:35:20 +00:00
Butkovits Atila
b9dc6231d7 Backed out changeset 4711e76ce475 (bug 1938425) for causing failures at browser_tab_groups_telemetry.js. CLOSED TREE 2025-04-10 09:35:44 +03:00
DJ
cdc29e0d0d Bug 1938425 - add telemetry for reopening saved groups. r=dao,sessionstore-reviewers,tabbrowser-reviewers,urlbar-reviewers,sthompson
Differential Revision: https://phabricator.services.mozilla.com/D243737
2025-04-10 03:02:30 +00:00