Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-selection: Tab switcher #5464

Open
wants to merge 82 commits into
base: develop
Choose a base branch
from

Conversation

0nko
Copy link
Member

@0nko 0nko commented Jan 14, 2025

Task/Issue URL: https://app.asana.com/0/1207418217763355/1209148925370449/f

Description

This PR is the feature branch for the tab switcher multi-selection project.

Steps to test this PR

Nothing to test, this will serve as a feature branch.

Copy link
Member Author

0nko commented Jan 14, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@0nko 0nko added the QA-Optional label Jan 14, 2025 — with Graphite App
@0nko 0nko marked this pull request as ready for review January 14, 2025 11:07
@0nko 0nko force-pushed the feature/ondrej/tab-multi-selection branch from 42e94eb to 0d73e35 Compare January 14, 2025 11:09
@0nko 0nko changed the title Add a new feature flag for multi-selection Multi-selection: Add a new feature flag for multi-selection Jan 14, 2025
@0nko 0nko force-pushed the feature/ondrej/tab-multi-selection branch from 0b382b2 to 8492b52 Compare January 15, 2025 17:28
@0nko 0nko force-pushed the feature/ondrej/tab-multi-selection branch from 8492b52 to c4c3cf8 Compare January 27, 2025 10:12
@0nko 0nko force-pushed the feature/ondrej/tab-multi-selection branch 2 times, most recently from c3270a9 to e6e2148 Compare January 31, 2025 15:26
@0nko 0nko force-pushed the feature/ondrej/tab-multi-selection branch from e6e2148 to ff15dd9 Compare February 3, 2025 20:20
@0nko 0nko force-pushed the feature/ondrej/tab-multi-selection branch from ff15dd9 to 02fb482 Compare February 13, 2025 10:54
@0nko 0nko requested review from mikescamell and removed request for malmstein and nalcalag February 13, 2025 10:58
@mikescamell mikescamell self-assigned this Feb 13, 2025
Comment on lines 39 to 36
@ContributesMultibinding(
scope = AppScope::class,
boundType = ApiInterceptorPlugin::class,
)
class BlockListInterceptorApiPlugin @Inject constructor(
class BlockListInterceptorApiPlugin constructor(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ Why was this removed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, seems like this was added with a rebase.

Copy link
Contributor

@mikescamell mikescamell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good apart from that BlockListInterceptorApiPlugin change 👍

@0nko 0nko force-pushed the feature/ondrej/tab-multi-selection branch 2 times, most recently from eab74f4 to 3d62cf6 Compare February 14, 2025 14:01
@0nko 0nko force-pushed the feature/ondrej/tab-multi-selection branch from 3d62cf6 to 01126c4 Compare February 27, 2025 17:15
@0nko 0nko mentioned this pull request Feb 27, 2025
19 tasks
@0nko 0nko force-pushed the feature/ondrej/tab-multi-selection branch from 01126c4 to b38ddf4 Compare February 28, 2025 17:43
@0nko 0nko mentioned this pull request Feb 28, 2025
32 tasks
@0nko 0nko force-pushed the feature/ondrej/tab-multi-selection branch 2 times, most recently from cca1829 to da3cae9 Compare March 3, 2025 20:28
@0nko 0nko force-pushed the feature/ondrej/tab-multi-selection branch from 8d39da7 to c6a75d1 Compare March 20, 2025 11:50
Task/Issue URL: https://app.asana.com/0/72649045549333/1209118961868652

### Description

This pull request introduces significant changes to the tab management
functionality in the `TabsDao` and `TabDataRepository` classes, as well
as updates to the `TabSwitcherActivity` to support multi-tab selection
and deletion. The main changes include the addition of new methods for
handling multiple tabs and updates to the UI to reflect these changes.

#### Tab Management Enhancements:

* `TabsDao`:
  * Added `deleteTabs` method to delete multiple tabs by their IDs.
* Added `markTabsAsDeletable` method to mark multiple tabs as deletable.
* Added `undoDeletableTabs` method to undo the deletable status of
multiple tabs.
* Added `deleteTabsAndUpdateSelection` method to delete multiple tabs
and update the tab selection.

* `TabDataRepository`:
* Introduced `deleteTabs` method to delete multiple tabs and clear their
site data.
* Introduced `markDeletable` method to mark multiple tabs as deletable.
* Introduced `undoDeletable` method to undo the deletable status of
multiple tabs.
* Updated `purgeDeletableTabs` to clear site data if the multi-selection
feature is enabled.

#### UI Updates for Multi-Tab Selection:

* `TabSwitcherActivity`:
* Enhanced `updateToolbarTitle` to display the number of selected tabs.
* Added logic to show a snackbar when tabs are deleted and allow undoing
the deletion.
[1](diffhunk://#diff-62a06ae9c304fc73ca47f7d6e81559a33e64c83a06bcec7b664985c6fc81d185L610-R620)
[2](diffhunk://#diff-62a06ae9c304fc73ca47f7d6e81559a33e64c83a06bcec7b664985c6fc81d185R631-R641)
* Updated `processCommand` to handle new commands for closing and
deleting multiple tabs.
* Added methods to show confirmation dialogs for closing all tabs or
selected tabs.
* Modified various methods to support the new multi-tab selection and
deletion functionality.
[1](diffhunk://#diff-62a06ae9c304fc73ca47f7d6e81559a33e64c83a06bcec7b664985c6fc81d185L561-R578)
[2](diffhunk://#diff-62a06ae9c304fc73ca47f7d6e81559a33e64c83a06bcec7b664985c6fc81d185L574-R589)

### Steps to test this PR

_Closing of all tabs in normal mode_
- [x] Prepare a few tabs beforehand
- [x] Go to the tab switcher
- [x] Tap on the more menu
- [x] Tap on Close All Tabs
- [x] Verify a confirmation dialog is shown
- [x] Tap on Close tabs
- [x] Verify all tabs are cleared, the tab switcher is closed and a NTP
is loaded

_Closing tabs in selection mode_
- [x] Prepare a few tabs beforehand
- [x] Go to the tab switcher
- [x] Tap on the more menu
- [x] Tap on Select Tabs
- [x] Select some (not all) tabs
- [x] Tap on Close Tabs
- [x] Verify a confirmation dialog is shown
- [x] Tap on Close tabs
- [x] Verify the selected tabs are closed
- [x] Verify an undo snackbar is shown
- [x] Tap on Undo
- [x] Verify the the deleted tabs are restored

_Closing "other tabs" in selection mode_
- [x] Prepare a few tabs beforehand
- [x] Go to the tab switcher
- [x] Tap on the more menu
- [x] Tap on Select Tabs
- [x] Select some (not all) tabs
- [x] Tap on Close Other Tabs
- [x] Verify a confirmation dialog is shown
- [x] Tap on Close tabs
- [x] Verify all tabs except the selected tabs are closed
- [x] Verify an undo snackbar is shown
- [x] Tap on Undo
- [x] Verify the the deleted tabs are restored

_Closing all tabs in selection mode_
- [x] Prepare a few tabs beforehand
- [x] Go to the tab switcher
- [x] Tap on the more menu
- [x] Tap on Select Tabs
- [x] Tap on the More menu and tap on Select All
- [x] Verify all tabs are selected
- [x] Tap on the Close Tabs FAB
- [x] Verify a confirmation dialog is shown
- [x] Tap on Close tabs
- [x] Verify all tabs are cleared, the tab switcher is closed and a NTP
is loaded
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants