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

Bug 1879372 - Add enabled/disabled nav button states #5997

Merged
merged 2 commits into from
Mar 13, 2024

Conversation

mavduevskiy
Copy link
Contributor

@mavduevskiy mavduevskiy commented Mar 12, 2024

Screenshots are order as a navigation sequence: wiki --> link --> back

Old New

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=1879372

@github-actions github-actions bot added the work in progress Not ready to land yet. Work in progress (WIP). label Mar 12, 2024
@mavduevskiy mavduevskiy marked this pull request as ready for review March 12, 2024 23:35
@github-actions github-actions bot added 🕵️‍♀️ needs review PRs that need to be reviewed and removed work in progress Not ready to land yet. Work in progress (WIP). labels Mar 12, 2024
Copy link
Contributor

@DreVla DreVla left a comment

Choose a reason for hiding this comment

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

ltgm!

@@ -74,16 +76,22 @@ fun BrowserNavBar(
browserState.normalTabs.size
}
}.value
val canGoBack = browserStore
.observeAsComposableState { state -> state.selectedTab?.content?.canGoBack }.value ?: false
Copy link
Contributor

Choose a reason for hiding this comment

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

Can use observeAsState as above that returns a non null result. Same for the one below.

An idea 💡 : Could create a NavBarUIModel/State to drive the NavBars so there's only one observeAsState that maps to the same UIModel.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

adjusted to observeAsState👍

I like the idea but couldn't find any examples of the usage, usually it's multiple of observeAsComposableState or observeAsState, and hesitant to introduce a new approach in this PR (trying to merge stuff before Friday). Could you point me to an example? Could do it as a follow up.

@github-actions github-actions bot added approved PR that has been approved and removed 🕵️‍♀️ needs review PRs that need to be reviewed labels Mar 13, 2024
@mavduevskiy mavduevskiy added the 🛬 needs landing PRs that are ready to land label Mar 13, 2024
@mergify mergify bot merged commit c38b385 into mozilla-mobile:main Mar 13, 2024
23 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved PR that has been approved 🛬 needs landing PRs that are ready to land
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants