Closed Bug 1891157 Opened 2 months ago Closed 1 month ago

Add basic support for closing synced tabs

Categories

(Fenix :: Accounts and Sync, enhancement, P3)

All
Android
enhancement

Tracking

(firefox127 fixed)

RESOLVED FIXED
127 Branch
Tracking Status
firefox127 --- fixed

People

(Reporter: lina, Assigned: lina)

References

(Blocks 1 open bug)

Details

Attachments

(3 files, 1 obsolete file)

We (the Sync Ecosystem team 😊) are working on a feature to let users close synced tabs that are currently open on their other devices. This has been a pretty common feature request for Synced Tabs over the years, and our team is at the point where we have a lot of the foundational infrastructure in place to make it happen!

Under the hood, closing synced tabs will piggyback on the same infrastructure as Send Tab: a new API in the FxA Client Rust component that talks to FxA device commands, and an integration with Push.

This ticket covers the Fenix-side work for the initial integration. We'll land a big chunk of it in this bug—behind a Nimbus variable and off by default—and use follow-up bugs for additional work as we get the feature ready for rollout.

Blocks: 1891158
Priority: P2 → P3
Depends on: 1892324

This commit introduces plumbing for sending "close tab" commands to
other devices that are signed in to the same Mozilla account, and for
receiving "close tab" commands from other devices.

This commit wires up the Android Components CloseTabsFeature (for
receiving "close tabs" commands from other devices that are signed in
to the same account) and CloseTabsUseCase (for sending commands to
other devices).

The integration works like this:

  • When we receive a "close tabs" command, we close the tabs
    (BackgroundServices), and show a status bar notification
    (NotificationManager.showSyncedTabsClosed()). If a notification
    is already showing, we update its text instead of showing a new one,
    to avoid filling up the user's lock screen with notifications if
    they close multiple tabs. Tapping the notification opens the
    "recently closed tabs" fragment
    (OpenRecentlyClosedIntentProcessor).
  • When the user opens the synced tabs tray, we show a "close" action
    button (SyncedTabsListItem.Tab.Action) next to any tabs whose
    devices support the "close tabs" command.

Depends on D208051

This commit adds a feature variable that, when enabled:

  • Advertises support for the "close tabs" device capability in the
    FxA device record. This lets other devices that are signed in to the
    same account know that this device has the capability.
  • Installs the CloseTabsFeature that shows status bar notifications
    when a "close tabs" command is received from another device.
  • Shows the "close" action button in the synced tabs tray next to
    tabs on other devices that support the capability.

Depends on D208052

Attachment #9396360 - Attachment is obsolete: true
Keywords: leave-open
Pushed by lbutler@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ea67e3b59c22
Add a feature and a use case for closing synced tabs. r=jonalmeida,android-reviewers,007
Duplicate of this bug: 1895052
Keywords: leave-open
Pushed by lbutler@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/93aaa8e973aa
Add support for closing synced tabs to Fenix. r=jonalmeida,007,android-reviewers
https://hg.mozilla.org/integration/autoland/rev/175150c47af5
Hide closing synced tabs behind a Nimbus feature variable. r=jonalmeida,android-reviewers
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 127 Branch
Regressions: 1895711
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: