Closes #18253: Bookmark and History open new tabs in the background #19275
Conversation
device-2021-04-27-175943.mp4 |
Codecov Report
@@ Coverage Diff @@
## master #19275 +/- ##
============================================
- Coverage 34.87% 34.85% -0.03%
- Complexity 1618 1619 +1
============================================
Files 540 540
Lines 21816 21846 +30
Branches 3249 3259 +10
============================================
+ Hits 7609 7615 +6
- Misses 13307 13330 +23
- Partials 900 901 +1
Continue to review full report at Codecov.
|
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.
Thanks! I know @vesta0 answered to the original issue so it might be good for her to review it! I don't think we need to open the tab tray when people open a tab in the background but just show a snackbar – similar to what we do when people open links in the background when on a site.
@topotropic Thanks for reviewing. It's my mistake that I didn't check with you first. I was trying to behave the same as when we open multiple bookmark or history tabs. Current tabs tray is shown when opening multiple tabs, shouldn't we behave the same when just opening one bookmark or history tab in the background? |
@rocketsroger If people just open one bookmark via the menu, we can show the snackbar ("New tab opened" | "Switch", "New private tab opened" | "Switch") that we currently use when people open a link via context menu on a site. Let me know if you have any questions. Thank you! |
Sounds good. I'll update my implementation. Thanks! |
The snack bar implementation will be much bigger then originally estimated. As discussed offline, I've created an issue #19365 to track the follow up work. Thanks, |
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.
LGTM ✅
@@ -169,7 +173,7 @@ class DefaultBookmarkController( | |||
} | |||
} | |||
|
|||
private fun openInNewTab( | |||
private fun openInNewTabAndShow( |
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
(activity as HomeActivity).browsingModeManager.mode = mode | ||
(activity as HomeActivity).components.useCases.tabsUseCases.let { tabsUseCases -> |
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.
nit
(activity as HomeActivity).browsingModeManager.mode = mode | |
(activity as HomeActivity).components.useCases.tabsUseCases.let { tabsUseCases -> | |
val homeActivity = activity as HomeActivity | |
homeActivity.browsingModeManager.mode = mode | |
homeActivity.components.useCases.tabsUseCases.let { tabsUseCases -> |
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'll update. Thanks!
Pull Request checklist
To download an APK when reviewing a PR: