Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Closes #18253: Bookmark and History open new tabs in the background #19275

Merged
merged 1 commit into from May 3, 2021

Conversation

rocketsroger
Copy link
Contributor

Pull Request checklist

  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Screenshots: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not
  • Accessibility: The code in this PR follows accessibility best practices or does not include any user facing features. In addition, it includes a screenshot of a successful accessibility scan to ensure no new defects are added to the product.

To download an APK when reviewing a PR:

  1. click on Show All Checks,
  2. click Details next to "Taskcluster (pull_request)" after it appears and then finishes with a green checkmark,
  3. click on the "Fenix - assemble" task, then click "Run Artifacts".
  4. the APK links should be on the left side of the screen, named for each CPU architecture

@rocketsroger rocketsroger added the needs:review PRs that need to be reviewed label Apr 27, 2021
@rocketsroger rocketsroger requested review from a team as code owners April 27, 2021 21:27
@rocketsroger
Copy link
Contributor Author

device-2021-04-27-175943.mp4

@codecov-commenter
Copy link

codecov-commenter commented Apr 27, 2021

Codecov Report

Merging #19275 (ebb2f9b) into master (d71df4d) will decrease coverage by 0.02%.
The diff coverage is 28.20%.

❗ Current head ebb2f9b differs from pull request most recent head 69c5c9e. Consider uploading reports for the commit 69c5c9e to get more accurate results
Impacted file tree graph

@@             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     
Impacted Files Coverage Δ Complexity Δ
...ozilla/fenix/library/bookmarks/BookmarkFragment.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...g/mozilla/fenix/library/history/HistoryFragment.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...illa/fenix/library/bookmarks/BookmarkController.kt 74.57% <87.50%> (+0.99%) 0.00 <0.00> (ø)
...mozilla/fenix/library/history/HistoryController.kt 80.00% <100.00%> (ø) 0.00 <0.00> (ø)
...mozilla/fenix/library/history/HistoryInteractor.kt 92.85% <100.00%> (ø) 13.00 <2.00> (ø)
...pp/src/main/java/org/mozilla/fenix/FeatureFlags.kt 100.00% <0.00%> (ø) 6.00% <0.00%> (+1.00%)
...p/src/main/java/org/mozilla/fenix/home/HomeMenu.kt 0.00% <0.00%> (ø) 0.00% <0.00%> (ø%)
.../org/mozilla/fenix/settings/DataChoicesFragment.kt 0.00% <0.00%> (ø) 0.00% <0.00%> (ø%)
...lla/fenix/components/toolbar/DefaultToolbarMenu.kt 0.00% <0.00%> (ø) 0.00% <0.00%> (ø%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d71df4d...69c5c9e. Read the comment docs.

@rocketsroger rocketsroger changed the title Closes #18253: Bookmark and History open new tabs in the background Closes #19289: Bookmark and History open new tabs in the background Apr 28, 2021
@rocketsroger rocketsroger changed the title Closes #19289: Bookmark and History open new tabs in the background Closes #18253: Bookmark and History open new tabs in the background Apr 28, 2021
Copy link

@topotropic topotropic left a 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.

@rocketsroger
Copy link
Contributor Author

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?

@topotropic
Copy link

@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!

@rocketsroger
Copy link
Contributor Author

@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!

@rocketsroger rocketsroger added pr:work-in-progress PRs that are not ready to be reviewed yet and are actively being worked on pr:do-not-land and removed needs:UX-review labels May 3, 2021
@rocketsroger
Copy link
Contributor Author

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,

@rocketsroger rocketsroger removed pr:do-not-land pr:work-in-progress PRs that are not ready to be reviewed yet and are actively being worked on labels May 3, 2021
Copy link
Contributor

@jonalmeida jonalmeida left a 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(
Copy link
Contributor

Choose a reason for hiding this comment

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

nice

Comment on lines 267 to 268
(activity as HomeActivity).browsingModeManager.mode = mode
(activity as HomeActivity).components.useCases.tabsUseCases.let { tabsUseCases ->
Copy link
Contributor

Choose a reason for hiding this comment

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

nit

Suggested change
(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 ->

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll update. Thanks!

@jonalmeida jonalmeida removed the needs:review PRs that need to be reviewed label May 3, 2021
@rocketsroger rocketsroger merged commit 79cf3fc into mozilla-mobile:master May 3, 2021
@rocketsroger rocketsroger deleted the FB_18253 branch May 3, 2021 21:27
pkirakosyan pushed a commit to gexsi/user-agent-android that referenced this pull request Aug 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants