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

For #14980 - Effectively disable tabs tray STATE_HALF_EXPANDED #16052

Merged
merged 1 commit into from
Nov 4, 2020
Merged

For #14980 - Effectively disable tabs tray STATE_HALF_EXPANDED #16052

merged 1 commit into from
Nov 4, 2020

Conversation

Mugurell
Copy link
Contributor

@Mugurell Mugurell commented Oct 20, 2020

STATE_HALF_EXPANDED cannot be disabled while also keeping fitToContents = true
based on which the tabs tray layout is currently set.
To work around this we'll set a a minuscule height for the tab tray when in this
state and then immediately advance to STATE_HIDDEN so to make it imperceptible
to the users.

TabsTrayNoHalfExpanded
video

Pull Request checklist

  • Tests: No tests. Small UI changes in a not yet tested component.
  • Screenshots: This PR includes screenshots or GIFs of the changes made.
  • Accessibility: The code in this PR does not include any a11y user facing features.

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

@Mugurell Mugurell requested review from a team as code owners October 20, 2020 12:39
Copy link
Contributor

@Amejia481 Amejia481 left a comment

Choose a reason for hiding this comment

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

The patch looks great, could we add test to verify the feature and avoid future regressions? :)

@Amejia481 Amejia481 self-assigned this Oct 20, 2020
@gabrielluong gabrielluong added the needs:UX-feedback Needs UX Feedback label Oct 21, 2020
@Mugurell
Copy link
Contributor Author

Mugurell commented Oct 21, 2020

The patch looks great, could we add test to verify the feature and avoid future regressions? :)

I tried to but I think I'm gonna need some pointers.
With the code being in TabTrayView unit testing is troublesome.
TabTrayView can't be instantiated because of InflateExceptions (Robolectric doesn't have all of our Views), so the init can't be completed to be able to test the halfExpandedRatio set and also if a bottomSheetCallback is set or in our case what that anonymous one does.

@Mugurell
Copy link
Contributor Author

There is a failing verifyContextMenuShortcuts ui test apparently unrelated to these changes.
Closing and reopening the ticket to rerun CI tasks.

@Mugurell Mugurell closed this Oct 21, 2020
@Mugurell Mugurell reopened this Oct 21, 2020
@codecov-io
Copy link

codecov-io commented Oct 21, 2020

Codecov Report

Merging #16052 into master will decrease coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #16052      +/-   ##
============================================
- Coverage     29.97%   29.97%   -0.01%     
+ Complexity     1203     1202       -1     
============================================
  Files           451      451              
  Lines         18463    18466       +3     
  Branches       2541     2542       +1     
============================================
  Hits           5535     5535              
- Misses        12500    12503       +3     
  Partials        428      428              
Impacted Files Coverage Δ Complexity Δ
...main/java/org/mozilla/fenix/tabtray/TabTrayView.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 9bb3440...f2daf0f. Read the comment docs.

STATE_HALF_EXPANDED cannot be disabled while also keeping fitToContents = true
based on which the tabs tray layout is currently set.
To work around this we'll set a a minuscule height for the tab tray when in
this state and then immediately advance to STATE_HIDDEN so to make it
imperceptible to the users.
Since I couldn't write unit tests because of InflateExceptions in Robolectric
I've write UI tests to protect against regressions.
@Mugurell
Copy link
Contributor Author

Added some UI tests for the changes here if unit testing doesn't work.
@Amejia481 @topotropic can you please re-review?

@Amejia481
Copy link
Contributor

Sure!

@Amejia481 Amejia481 self-requested a review October 30, 2020 19:16
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.

this PR will also fix #13777, thanks!

@topotropic topotropic removed the needs:UX-feedback Needs UX Feedback label Nov 4, 2020
@Mugurell Mugurell merged commit 172977f into mozilla-mobile:master Nov 4, 2020
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

5 participants