Commit Graph

700 Commits

Author SHA1 Message Date
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
Narcis Beleuzu
ce7684de06 Bug 1959350 - Don't move tabs when we shouldn't translate and we don't have a dropIndex or dropElement. r=dwalker,tabbrowser-reviewers
This reverts commit 43aaf24757.
2025-05-01 15:17:10 +00:00
Sebastian Hengst
43aaf24757 Revert "Bug 1959350 - Don't move tabs when we shouldn't translate and we don't have a dropIndex or dropElement. r=dwalker,tabbrowser-reviewers" for failing browser-chrome's browser_914138_widget_API_overflowable_toolbar.js
This reverts commit 8c9266bae9.
2025-05-01 13:57:01 +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
Dão Gottwald
8c9266bae9 Bug 1959350 - Don't move tabs when we shouldn't translate and we don't have a dropIndex or dropElement. r=dwalker,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D247339
2025-05-01 02:26:28 +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
Dão Gottwald
a820b8f226 Bug 1962696 - Explicitly select the dragged tab. r=jswinarton,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D247064
2025-04-29 15:38:04 +00:00
Vasish Baungally
9ca170316a Bug 1951374 - damp browser-toolbox.styleeditor-ready.DAMP (Windows) regression on Tue February 18 2025 r=dao,tabbrowser-reviewers,ngrato
Differential Revision: https://phabricator.services.mozilla.com/D241510
2025-04-29 15:20:17 +00:00
Emilio Cobos Álvarez
dc6f105b8b Bug 1962688 - Fix vertical tabs on right drop zone calculation. r=tabbrowser-reviewers,nsharpley
Noticed this while going through this code. The end should be all the
way to the right, not left...

Differential Revision: https://phabricator.services.mozilla.com/D246830
2025-04-28 15:08:59 +00:00
Emilio Cobos Álvarez
d025939892 Bug 1962688 - Fix tab drop zone calculation to account for window decorations correctly. r=tabbrowser-reviewers,nsharpley
This is more visible on Linux because the decorations there are bigger, but I
believe this also fixes issues on windows specially if you have the titlebar
checkbox on.

You need to use mozInnerScreen* coords in order to get the screen coordinates
of the client area.

Differential Revision: https://phabricator.services.mozilla.com/D246829
2025-04-28 15:08:59 +00:00
Greg Stoll
45a91ceccb Bug 1962641 - only style explicitly unloaded tabs with grayscale favicon, etc. r=tabbrowser-reviewers,dao
Tabs can also be unloaded for low memory conditions, so only add the
"discarded" attribute if the tab was unloaded explicitly.

Differential Revision: https://phabricator.services.mozilla.com/D246766
2025-04-25 15:43:31 +00:00
Rob Wu
6521fc35e2 Bug 1962592 - Reduce tab moves in adoptTabGroup r=tabbrowser-reviewers,dao
Differential Revision: https://phabricator.services.mozilla.com/D246702
2025-04-25 13:44:46 +00:00
Rob Wu
cbf77f8d55 Bug 1962475 - Do not fire tabGroups.onRemoved and onCreated when moving across windows r=zombie,tabbrowser-reviewers,dao
Differential Revision: https://phabricator.services.mozilla.com/D246688
2025-04-25 13:44:45 +00:00
zombie
7063143eaf Bug 1961660 - Implement tabGroups.move and onMoved r=robwu,tabbrowser-reviewers,dwalker,sthompson
Differential Revision: https://phabricator.services.mozilla.com/D246378
2025-04-25 13:44:44 +00:00
zombie
0f0180e660 Bug 1961657 - Implement tabGroups.update and onUpdated r=robwu,tabbrowser-reviewers,dwalker,sthompson
Differential Revision: https://phabricator.services.mozilla.com/D246164
2025-04-25 13:44:44 +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
Nikki Sharpley
5633312c69 Bug 1959407 - Use scrollPosition instead of scrollTop for vertical-pinned-tabs-container r=tabbrowser-reviewers,sthompson
Differential Revision: https://phabricator.services.mozilla.com/D246493
2025-04-24 13:59:25 +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
Vasish Baungally
f000a5003b Bug 1961621 - Fix Preprocessing Text for Smart Tabs when Group Names are Present. r=rrando,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D246106
2025-04-23 19:21:37 +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
Vasish Baungally
52f0c4bab6 Bug 1961085 - Add Config for Testing Smart Tabs Suggest Methods. r=rrando,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D245851
2025-04-23 14:02:46 +00:00
Dão Gottwald
e55da1505a Bug 1961224 - Remove bogus "panel" class from tab group panel. r=sthompson,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D245959
2025-04-18 03:14:59 +00:00
Nika Layzell
0e460c11ec Bug 1958350 - Part 1: Fall back to the triggeringRemoteType when available for initial browser remoteType, r=Gijs,tabbrowser-reviewers,mconley
Differential Revision: https://phabricator.services.mozilla.com/D244444
2025-04-17 17:28:29 +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
Dão Gottwald
7f2c8ae7a1 Bug 1961150 - Add tooltips to tab group editor buttons to deal with locales that may have longer button labels. r=sthompson,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D245911
2025-04-17 15:06:13 +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
Rob Wu
2004e55a76 Bug 1959713 - Expose tabs.Tab.groupId r=zombie,dao,tabbrowser-reviewers,frontend-codestyle-reviewers
This patch exposes a groupId field on tabs.Tab objects in extensions.

On mobile (Android), the value is always -1.

On desktop, the value is the numeric representation composed from the
internal ID, which happens to fit in a safe integer. As long as the
browser is not running past year 2255, this works. As a fallback,
when an ID in a different format is encountered, the logic falls back
to returning a new unique ID based on a counter. This ID is then
stored in an internal in-memory map to maintain stable consistency.
Since it is unclear when exactly it is safe to discard this value, this
map is never cleared. This minor memory leak is acceptable because it
does not happen in practice, and even if it does, the number of tab
groups over the lifetime of a Firefox session is not going to reach
excessive values.

Differential Revision: https://phabricator.services.mozilla.com/D245159
2025-04-11 23:07:15 +00: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
Dão Gottwald
13ed8c114d Bug 1955333 - Add tab to group context menu favicon should always be solid for opened groups regardlesss if it's collapsed. r=dwalker,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D245222
2025-04-11 15:01:45 +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