-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Multi-selection: Bookmarking #5716
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: Bookmarking #5716
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
bb287ba to
a5f3410
Compare
353ba9a to
d955785
Compare
a5f3410 to
173c9d6
Compare
41850ad to
aaa0d58
Compare
16b8b26 to
8b87fde
Compare
8b87fde to
f8eb8b9
Compare
aaa0d58 to
0e745d2
Compare
f8eb8b9 to
9dd1c3b
Compare
3db6a74 to
c80ecea
Compare
9dd1c3b to
d984ebe
Compare
c80ecea to
2cc684b
Compare
19f70d4 to
d33cb74
Compare
2cc684b to
cf6b2c2
Compare
d33cb74 to
bd9aa77
Compare
3412b1c to
fc005e5
Compare
6f05751 to
38b575a
Compare
fc005e5 to
cf68075
Compare
a7c1150 to
d365cf5
Compare
77f1d22 to
73fef25
Compare
723af33 to
31011ee
Compare
73fef25 to
099b529
Compare
099b529 to
f232f7e
Compare
5a8c063 to
4b2cfaa
Compare
9b68851 to
3d875be
Compare
fee4dba to
3d875be
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Works as expected 🎉
I think the last testing step should read
"Navigate to Bookmarks and verify the 2 3 bookmarks added previously were really created"
correct?
| } | ||
|
|
||
| private val snackbar = Snackbar.make(anchorView, message, Snackbar.LENGTH_LONG) | ||
| .setDuration(SNACKBAR_DISPLAY_TIME_MS) // 3.5 seconds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔍Maybe we can remove the comment here as we're using a constant that might change
| import com.google.android.material.snackbar.BaseTransientBottomBar | ||
| import com.google.android.material.snackbar.Snackbar | ||
|
|
||
| class TabSwitcherSnackbar( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
|
|
||
| fun undoBookmarkAction() { | ||
| recentlySavedBookmarks.forEach { bookmark -> | ||
| viewModelScope.launch(dispatcherProvider.io()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡Would it make more sense to move the launch outside the forEach? This is only going to get called if we're actually undoing something so we definitely will deleting something, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I just thought I'd parallelize the calls but I guess it doesn't really matter here.
| } | ||
| } | ||
|
|
||
| private suspend fun saveSiteBookmark(tabId: String) = withContext(dispatcherProvider.io()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔍I find this function a little difficult to read, there's quite a bit going on here and lots of null checks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hopefully this change will make it a bit more readable.
|
Thanks @mikescamell!
No. Because of the step |
|
|
||
| private val snackbar = Snackbar.make(anchorView, message, Snackbar.LENGTH_LONG) | ||
| .setDuration(SNACKBAR_DISPLAY_TIME_MS) // 3.5 seconds | ||
| .setDuration(SNACKBAR_DISPLAY_TIME_MS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
| fun undoBookmarkAction() { | ||
| recentlySavedBookmarks.forEach { bookmark -> | ||
| viewModelScope.launch(dispatcherProvider.io()) { | ||
| viewModelScope.launch(dispatcherProvider.io()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
ed2738d to
57d8234
Compare
3d875be to
5849087
Compare
9aa5957
into
feature/ondrej/tab-multi-selection

Task/Issue URL: https://app.asana.com/0/72649045549333/1209118961868653
Description
This PR adds the bookmarking functionality to the tab switcher.
Steps to test this PR
Bookmarking selected tabs
Select TabSelect Allmenu is availabeBookmark 2 Tabs?dialog appears2 bookmarks addedUndo bookmark action
1 bookmarks addedwith theUndoactionUndoactionBookmarking unique and non-NTP tabs
Select TabsSelect AllBookmark 4 Tabs?dialog appears2 bookmarks added(NTP and the existing bookmark skipped)0 bookmarks added, now without theUndoaction