Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Bug 1854131 - Three-dot main menu falls off screen, disappears in landscape mode #5663

Closed
wants to merge 1 commit into from

Conversation

AdrianaMaries
Copy link

@AdrianaMaries AdrianaMaries commented Feb 20, 2024

Bug 1854131 - Three-dot main menu falls off screen, disappears in landscape mode

The popup doesn't fits up or fits down, because both availableHeightToTop and availableHeightToBottom are smaller than containerHeight. Because of this the popup is not displayed. As the popup is scrollable we should display it where the height is bigger (top or bottom).

https://bugzilla.mozilla.org/show_bug.cgi?id=1854131

Pull Request checklist

  • Quality: This PR builds and passes detekt/ktlint checks (A pre-push hook is recommended)
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Changelog: This PR includes a changelog entry or does not need one
  • Accessibility: The code in this PR follows accessibility best practices or does not include any user facing features

After merge

  • Breaking Changes: If this is a breaking Android Components change, please push a draft PR on Reference Browser to address the breaking issues.

To download an APK when reviewing a PR (after all CI tasks finished running):

  1. Click on Checks at the top of the PR page.
  2. Click on the firefoxci-taskcluster group on the left to expand all tasks.
  3. Click on the build-apk-{fenix,focus,klar}-debug task you're interested in.
  4. Click on View task in Taskcluster in the new DETAILS section.
  5. The APK links should be on the right side of the screen, named for each CPU architecture.

GitHub Automation

https://bugzilla.mozilla.org/show_bug.cgi?id=1854131

@github-actions github-actions bot added the 🕵️‍♀️ needs review PRs that need to be reviewed label Feb 20, 2024
@t-p-white t-p-white self-assigned this Feb 20, 2024
Copy link
Contributor

@t-p-white t-p-white left a comment

Choose a reason for hiding this comment

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

Great job @AdrianaMaries, this fix looks good to me. Can we add a unit test also please to assert this new condition? 🙏

@AdrianaMaries
Copy link
Author

@t-p-white Added a unit test to assert the new condition.

@t-p-white
Copy link
Contributor

t-p-white commented Feb 23, 2024

Thanks @AdrianaMaries! Sorry for the delay, should we also have a test for availableHeightToBottom is less than availableHeightToTop?

@AdrianaMaries
Copy link
Author

@t-p-white Please see my changes. Thanks.

}

@Test
fun `GIVEN inferMenuPositioningData WHEN availableHeightToTop is bigger than availableHeightToBottom THEN it returns a new MenuPositioningData populated with all data needed to show a PopupWindow that fits down`() {
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be:

Suggested change
fun `GIVEN inferMenuPositioningData WHEN availableHeightToTop is bigger than availableHeightToBottom THEN it returns a new MenuPositioningData populated with all data needed to show a PopupWindow that fits down`() {
fun `GIVEN inferMenuPositioningData WHEN availableHeightToTop is bigger than availableHeightToBottom THEN it returns a new MenuPositioningData populated with all data needed to show a PopupWindow that fits up`() {

?

Copy link
Author

Choose a reason for hiding this comment

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

@t-p-white Yes. Updated.

Copy link
Contributor

@t-p-white t-p-white left a comment

Choose a reason for hiding this comment

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

Thanks @AdrianaMaries! Just a minor comment from me

…dscape mode

The popup doesn't fits up or fits down, because both availableHeightToTop and availableHeightToBottom are smaller than containerHeight. Because of this the popup is not displayed. As the popup is scrollable we should display it where the height is bigger (top or bottom).
@AdrianaMaries
Copy link
Author

@t-p-white Please see my changes.

@github-actions github-actions bot mentioned this pull request Mar 20, 2024
4 tasks
@t-p-white t-p-white added approved PR that has been approved and removed 🕵️‍♀️ needs review PRs that need to be reviewed followup PR that needs to be followed up labels Mar 20, 2024
@t-p-white
Copy link
Contributor

t-p-white commented Mar 20, 2024

Thanks @AdrianaMaries! lgtm 😎 With the move to the monorepo this PR will be closed and your changes will be included in https://phabricator.services.mozilla.com/D205207

@t-p-white t-p-white closed this Mar 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved PR that has been approved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants