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

For #12287: Add Synced Tabs to Tabs Tray #13893

Merged
merged 4 commits into from
Aug 19, 2020

Conversation

jonalmeida
Copy link
Contributor

The feature is put behind a feature flag from the Secret Settings. Might be easier to review per commit.

Abstract design link to verify against.

out

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

@jonalmeida
Copy link
Contributor Author

The parts I'm most unsure of are the navigation graph additions.

@codecov-commenter
Copy link

codecov-commenter commented Aug 18, 2020

Codecov Report

Merging #13893 into master will increase coverage by 0.13%.
The diff coverage is 49.60%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #13893      +/-   ##
============================================
+ Coverage     29.76%   29.90%   +0.13%     
- Complexity     1117     1125       +8     
============================================
  Files           422      425       +3     
  Lines         17204    17293      +89     
  Branches       2232     2241       +9     
============================================
+ Hits           5121     5171      +50     
- Misses        11709    11747      +38     
- Partials        374      375       +1     
Impacted Files Coverage Δ Complexity Δ
...pp/src/main/java/org/mozilla/fenix/HomeActivity.kt 6.58% <0.00%> (-0.03%) 11.00 <0.00> (ø)
...org/mozilla/fenix/components/BackgroundServices.kt 23.61% <0.00%> (+0.32%) 0.00 <0.00> (ø)
...lla/fenix/components/toolbar/DefaultToolbarMenu.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...p/src/main/java/org/mozilla/fenix/home/HomeMenu.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...g/mozilla/fenix/settings/SecretSettingsFragment.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
.../fenix/settings/account/AccountSettingsFragment.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
.../java/org/mozilla/fenix/sync/SyncedTabsFragment.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...org/mozilla/fenix/tabtray/TabTrayDialogFragment.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...main/java/org/mozilla/fenix/tabtray/TabTrayView.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...in/java/org/mozilla/fenix/sync/SyncedTabsLayout.kt 11.11% <14.28%> (-18.16%) 0.00 <0.00> (ø)
... and 14 more

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 2743c37...f49de18. Read the comment docs.

Copy link
Contributor

@ekager ekager left a comment

Choose a reason for hiding this comment

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

Pulled this down and looks good overall, but I noticed a few things:

  1. Do we want this to show in the private tab in the tabs tray?
  2. We probably want to hide this in multiselect mode like we do for the save to collection button because otherwise it looks a bit strange?
    Screenshot_20200818-120650
  3. When opening the tabs tray with synced tabs enabled and 1 open tab, it seems to jump to the synced tabs section and opens at an awkward point in the list.
    ezgif com-video-to-gif(7)
  4. Sometimes (can't repro 100%) it even opens further down on the synced tabs list and I would have to scroll way up to see open tabs. When I swipe up to try to scroll, it closes. Got a video from after it opened.
    ezgif com-video-to-gif(8)

Moving this into it's own Tabs Tray Tab (phew mouthful) would likely solve all these problems, so if we decide to move that way (via this comment #12287 (comment) ) we can probably disregard these issues.

cc @topotropic

@jonalmeida
Copy link
Contributor Author

jonalmeida commented Aug 18, 2020

Thanks for the review; super helpful!

  1. Do we want this to show in the private tab in the tabs tray?

We currently don't have it in private tabs similar to the 'Add to collections' button, although I'll leave it up to @topotropic to comment (and to also consider the separate tab idea that Sorin mentioned).

  1. We probably want to hide this in multiselect mode like we do for the save to collection button because otherwise it looks a bit strange?

Fixed! Check out the last commit that addresses the review comments.

  1. When opening the tabs tray with synced tabs enabled and 1 open tab, it seems to jump to the synced tabs section and opens at an awkward point in the list.
  2. Sometimes (can't repro 100%) it even opens further down on the synced tabs list and I would have to scroll way up to see open tabs. When I swipe up to try to scroll, it closes. Got a video from after it opened.

These two are related and are a side-effect to how the tabs tray scrolls to the selected tab. The hacky approach that we currently have (calculate the index based on the adapter size), does not consider that the adapter is loaded async and we need to scroll when all the adapters are complete.

I've filed #13905 to address this and added it as a blocker for removing the feature flag.

Moving this into it's own Tabs Tray Tab (phew mouthful) would likely solve all these problems, so if we decide to move that way (via this comment #12287 (comment) ) we can probably disregard these issues.

Yes! I'd really like us to look into this but I don't think it'll block us from landing this change.

@jonalmeida jonalmeida requested a review from ekager August 18, 2020 22:20
Copy link
Contributor

@ekager ekager left a comment

Choose a reason for hiding this comment

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

Sounds good, I don't think the UX questions/bugs should block the flagged feature!

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.

3 participants