Commit Graph

531 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
Jeremy Swinarton
72de1640b1 Bug 1959438: Prevent tab from entering tab group label DOM element on tab insert r=sthompson,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D244931
2025-04-10 02:51:29 +00:00
Jeremy Swinarton
6483fac085 Bug 1957723: tabs.create() extensions API correctly adds tabs to groups r=sthompson,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D244613
2025-04-08 15:08:12 +00:00
Dão Gottwald
25cb4ac928 Bug 1957434 - Remove workaround for bug 1954163. r=dwalker,tabbrowser-reviewers
I expect that bug 1955112 was really a duplicate of bug 1954163. Based on that, let's remove this workaround since it's causing trouble.

Differential Revision: https://phabricator.services.mozilla.com/D244564
2025-04-07 14:54:05 +00:00
Nikki Sharpley
a550747f4f Bug 1956565 - Fix drag to new window for vertical tabs on the right r=tabbrowser-reviewers,dao
Differential Revision: https://phabricator.services.mozilla.com/D244603
2025-04-07 14:37:48 +00:00
Florian Quèze
9ec8cc29a6 Bug 1956726 - Migrate histograms to use Glean APIs in browser/, r=chutten,sessionstore-reviewers,tabbrowser-reviewers,mconley,nsharpley.
Differential Revision: https://phabricator.services.mozilla.com/D243706
2025-04-03 17:09:35 +00:00
Stephen Thompson
895511dc6f Bug 1938430 - add delete tab group event r=jswinarton,tabbrowser-reviewers,sessionstore-reviewers
Record when users delete an open group from the tab group context menu or delete an open group from a context menu in the all-tabs menu.

This will not record when users close a window or close all of the individual tabs in a tab group, even though those cases have the logical side effect of deleting a tab group.

Differential Revision: https://phabricator.services.mozilla.com/D241884
2025-04-03 14:12:43 +00:00
Kelly Cochrane
43f88580f8 Bug 1956909 - Prevent expand on hover jumping animation after browser restart r=tabbrowser-reviewers,sidebar-reviewers,jsudiaman,nsharpley
Differential Revision: https://phabricator.services.mozilla.com/D244203
2025-04-03 10:09:14 +00:00
Rolf Rando
830f66b654 Bug 1955955 - Handle user cancel of Smart Tab Grouping Opt-in or clustering r=ngrato,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D244086
2025-04-02 18:02:22 +00:00
Nick Grato
5d6e28533b Bug 1957708 - Add link place holder to optin message r=fluent-reviewers,tabbrowser-reviewers,firefox-ai-ml-reviewers,flod,txia
Adding additional functionality for there to be a link in the message part of the optin component. Using a place holder link to support for now. This will be updated to a new SUMO article.

Differential Revision: https://phabricator.services.mozilla.com/D244069
2025-04-02 16:28:38 +00:00
Nick Grato
9202f6836f Bug 1957777 - highlight name field when label is suggested r=dwalker,tabbrowser-reviewers
highlight text when label is suggested but also un-focus the input when a user clicks out of the input anywhere on the panel.

Differential Revision: https://phabricator.services.mozilla.com/D244096
2025-04-02 16:10:37 +00:00
Vasish Baungally
7a6a4ff8f9 Bug 1957097 - Add telemetry for empty suggestion from ML topic model. r=rrando,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D243465
2025-04-01 20:35:12 +00:00
Stephen Thompson
8f903ac1e3 Bug 1952530 - prevent pinned tabs from dropping outside of pinned area r=dao,tabbrowser-reviewers
When dragging a pinned tab into an overflowing tab strip, it's possible to drop the pinned tab after the first unpinned tab. This causes one of the pinned tabs to be covered up, it breaks the browser's count of pinned tabs, and it can lead to breakages in drag-drop and the visual rendering of the tab strip.

An additional constraint on the drop position will make sure that a pinned tab can't drop between unpinned tabs and an unpinned tab can't drop between pinned tabs.

Differential Revision: https://phabricator.services.mozilla.com/D242748
2025-04-01 14:30:25 +00:00
Rolf Rando
24ded0f086 Bug 1956522 - Fix issue with private tab and smart tab grouping r=tabbrowser-reviewers,vazish
Differential Revision: https://phabricator.services.mozilla.com/D243392
2025-03-28 15:50:02 +00:00
Jeremy Swinarton
b5d0e3b6a6 Bug 1953801: Update SessionStore cache immediately after creating a tab group. r=sthompson,sessionstore-reviewers,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D241634
2025-03-28 15:16:23 +00:00
Fred Chasen
f43d5bc2ba Bug 1953534 - Clean up Review Checker location change handlers. r=shopping-reviewers,kpatenio,tabbrowser-reviewers
Now that the ReviewChecker sidebar can auto-open and close, the logic for finding distinct navigations needs to be updated.
This allow us to detect the first time new products URLs are requested to shown in the sidebar and to check if a tab should auto-open the sidebar after it was closed.

- `isDistinctProductPageVisit` now works the same as it did in the ShoppingSidebar, indicating that there was a product navigation while a tab was in the background.
- `reviewCheckerWasClosed` now prevents the sidebar from re-opening on tab changes for a location it was closed on.
- `isSimulated` is set to false in the location change handlers on tab changes where there was an unhandled background product navigation.
- Moves the `isSameProduct` check to `ShoppingUtils` and use that to test previous URIs passed to `hasLocationChanged`.
- Manager will only handle product page specific parts of location changes when the sidebar is not open to handle them.

Differential Revision: https://phabricator.services.mozilla.com/D241446
2025-03-28 00:07:40 +00:00
Nick Grato
21173d07c3 Bug 1956643 - Change Select all tabs to a checkbox from a toggle button r=fluent-reviewers,desktop-theme-reviewers,tabbrowser-reviewers,bolsson,sthompson,hjones
when the user is presented with the AI suggested tabs in STG, change the action button that toggles the select and deselect actions to just being a simple select all checkbox that only selects all when checked. Remove the deselect all functionality.

Differential Revision: https://phabricator.services.mozilla.com/D243221
2025-03-27 20:49:38 +00:00
Dão Gottwald
e1ac9df163 Bug 1939518 - Reimplement vertical tab group line to be more consistent with horizontal tabs, and move container tab line to the end of the tab. r=sthompson,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D242949
2025-03-27 19:27:07 +00:00
Jeremy Swinarton
34d9e59418 Bug 1938426: Record telemetry event when saving a tab group r=dwalker,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D242984
2025-03-27 15:29:19 +00:00
Nikki Sharpley
52f6f5d35b Bug 1954966 - Update drag behaviour for pinned tabs in expand on hover mode r=sidebar-reviewers,tabbrowser-reviewers,sclements
Differential Revision: https://phabricator.services.mozilla.com/D242768
2025-03-27 13:51:25 +00:00
Kelly Cochrane
6685a37131 Bug 1950419 - Prevent sidebar from collapsing when opening context menu if expand on hover is enabled r=tabbrowser-reviewers,sidebar-reviewers,jsudiaman
Differential Revision: https://phabricator.services.mozilla.com/D242740
2025-03-26 19:14:46 +00:00
Cosmin Sabou
ced1f3c105 Backed out changeset 68d101b370d8 (bug 1938430) for permafailures on browser_tab_manager_groups.js (Bug 1938697). 2025-03-27 00:21:30 +02:00
Nick Grato
4113c7ce84 Bug 1956077 - Enhance STG user flow with assorted UX callouts r=rrando,fluent-reviewers,desktop-theme-reviewers,tabbrowser-reviewers,firefox-ai-ml-reviewers,sthompson,bolsson,hjones
Update strings in STG user flow. Update button styles. Add new footer paragraph and link to model optin component. Expand the panel when showing suggested tabs. Fix messaging coloring when there are no tabs to suggest.

Differential Revision: https://phabricator.services.mozilla.com/D242786
2025-03-26 17:16:39 +00:00
Chris Shiohama
79000c00ff Bug 1945404 - Added focusUrlBar property to new tabs created with right click context menu. r=tabbrowser-reviewers,dwalker
Differential Revision: https://phabricator.services.mozilla.com/D242855
2025-03-26 16:33:41 +00:00
Vasish Baungally
2e7c7849b7 Bug 1956073 - Add Opt-in & additional telemetry for Smart Tab Grouping r=rrando,dwalker,tabbrowser-reviewers
- Telemetry for opt-in
     - For each onboarding step
- Telemetry updates for existing
     - Clicking away with ML group name without explicitly clicking "done" or "cancel"
     - When there are no suggestions for "suggest other tabs"
     - Add group id to ml telemetry
     - Move stg telemetry under tab group telemetry
     - Remove num_ from events

Differential Revision: https://phabricator.services.mozilla.com/D242784
2025-03-26 15:41:49 +00:00
Stephen Thompson
78282be03c Bug 1938430 - add delete tab group event r=jswinarton,tabbrowser-reviewers,sessionstore-reviewers
Record when users delete an open group from the tab group context menu or delete an open group from a context menu in the all-tabs menu.

This will not record when users close a window or close all of the individual tabs in a tab group, even though those cases have the logical side effect of deleting a tab group.

Differential Revision: https://phabricator.services.mozilla.com/D241884
2025-03-25 21:16:37 +00:00