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

Bug 1842203 - Implement the final UX for the FedCM provider prompt#3091

Merged
mergify[bot] merged 3 commits into
mozilla-mobile:mainfrom
titooan:bug1842203-fedcm-provider-prompt
Sep 25, 2023
Merged

Bug 1842203 - Implement the final UX for the FedCM provider prompt#3091
mergify[bot] merged 3 commits into
mozilla-mobile:mainfrom
titooan:bug1842203-fedcm-provider-prompt

Conversation

@titooan
Copy link
Copy Markdown
Contributor

@titooan titooan commented Aug 2, 2023

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=1842203
https://bugzilla.mozilla.org/show_bug.cgi?id=1847784

@github-actions github-actions Bot added the 🕵️‍♀️ needs review PRs that need to be reviewed label Aug 2, 2023
@titooan titooan marked this pull request as draft August 2, 2023 17:21
@github-actions github-actions Bot added work in progress Not ready to land yet. Work in progress (WIP). and removed 🕵️‍♀️ needs review PRs that need to be reviewed labels Aug 2, 2023
@titooan titooan force-pushed the bug1842203-fedcm-provider-prompt branch 2 times, most recently from c0ed29b to 663a7b3 Compare August 14, 2023 15:23
@Amejia481
Copy link
Copy Markdown
Contributor

Thanks for putting this patch, it is looking really good!
My main concern will be to see how we will be handling dark and light themes , I'm not sure if we are already handling compose themes on AC.

There are some components that are already using compose, but not sure if they are already handling Themes.
https://github.com/mozilla-mobile/firefox-android/blob/main/fenix/app/src/main/java/org/mozilla/fenix/search/awesomebar/AwesomeBarWrapper.kt
https://github.com/mozilla-mobile/firefox-android/blob/main/android-components/components/compose/cfr/src/main/java/mozilla/components/compose/cfr/CFRPopupFullscreenLayout.kt

@Amejia481
Copy link
Copy Markdown
Contributor

It looks like in the previous compose implementation we didn't have the concept of themes, we were just passing colors https://github.com/mozilla-mobile/firefox-android/blob/main/android-components/components/compose/awesomebar/src/main/java/mozilla/components/compose/browser/awesomebar/AwesomeBarDefaults.kt#L24-L30.

@Amejia481
Copy link
Copy Markdown
Contributor

Ideally we would like to create a generic class or contract for all AC components to use, and apps could provide to AC, which just covers the minimal colors and theme management for now and we could extend later. This is what we are doing in Fenix for themes , we would like to have simplify version on AC, which could live on our Colors components or even better if we could create a new component for having everything related to compose where we could have themes, theme management, and a maybe (in the future) have based reusable compose components which could be reuse across AC ✨.

@Amejia481
Copy link
Copy Markdown
Contributor

Ideally this contract could be pass to PromptFeature or there AC components which will compose.

PromptFeature(
    private val provideTheme : ()-> ACTheme
//....
)

Having a function could help us to delegate the responsibility of theme management to the app and AC will only query the actual correct theme dark or light.

Copy link
Copy Markdown
Contributor

@MozillaNoah MozillaNoah left a comment

Choose a reason for hiding this comment

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

first pass. I mainly have a bunch of nits, but this is coming together well!

startComposable: (@Composable () -> Unit)? = null,
) {
// Used to propagate the ripple effect to the whole row
val interactionSource = remember { MutableInteractionSource() }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

was this necessary? Normally Modifier.clickable applies a ripple to the entire layout.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

For some reason I don't understand, not using this interactionSource gives a "solid" selected state that isn't a ripple :

no-ripple.mov

This is the result I get when using the interactionSource:

ripple.mov

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If I had to guess, it's likely because of the lack of MaterialTheme wrapping all of the Compose code, which might be addressed by the patch we've talked about offline.

Comment thread android-components/components/lib/crash/docs/metrics.md Outdated
@titooan titooan force-pushed the bug1842203-fedcm-provider-prompt branch from 663a7b3 to 8f66a5d Compare August 17, 2023 21:16
@titooan titooan force-pushed the bug1842203-fedcm-provider-prompt branch from 8f66a5d to f572f8f Compare August 30, 2023 14:32
Copy link
Copy Markdown
Contributor

@MozillaNoah MozillaNoah left a comment

Choose a reason for hiding this comment

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

second pass. this is probably good to come out of draft now!

<string name="mozac_feature_prompts_manage_address">Manage addresses</string>

<!-- Federated Credential Management prompts -->
<!--Content description for the Provider favicon in the Select Provider FedCM prompt -->
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You might want to be a little more descriptive and avoid some of the business acronyms for the comments, since a lot of the localizers don't necessarily poke into everything in the app to be able to have the context.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I realised I ended up not using this string, as I think there's no need for the Screen Reader to read a view that is purely decorative. (see Cases that don't require content labels in Google Documentation.

Thanks for pointing this out!

startComposable: (@Composable () -> Unit)? = null,
) {
// Used to propagate the ripple effect to the whole row
val interactionSource = remember { MutableInteractionSource() }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If I had to guess, it's likely because of the lack of MaterialTheme wrapping all of the Compose code, which might be addressed by the patch we've talked about offline.

@titooan titooan force-pushed the bug1842203-fedcm-provider-prompt branch from f572f8f to b7375e1 Compare August 31, 2023 19:22
@titooan titooan marked this pull request as ready for review September 18, 2023 18:47
@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 Sep 18, 2023
@titooan titooan force-pushed the bug1842203-fedcm-provider-prompt branch from b7375e1 to 53a2b6b Compare September 18, 2023 18:49
@titooan titooan changed the title WIP - Bug 1842203 - Implement the final UX for the FedCM provider prompt Bug 1842203 - Implement the final UX for the FedCM provider prompt Sep 20, 2023
@titooan titooan added approved PR that has been approved 🛬 needs landing PRs that are ready to land and removed 🕵️‍♀️ needs review PRs that need to be reviewed 🛬 needs landing PRs that are ready to land labels Sep 21, 2023
@titooan titooan force-pushed the bug1842203-fedcm-provider-prompt branch from 53a2b6b to b34e7c9 Compare September 21, 2023 13:21
@titooan titooan added the 🛬 needs landing PRs that are ready to land label Sep 21, 2023
@titooan titooan removed the 🛬 needs landing PRs that are ready to land label Sep 21, 2023
@titooan titooan force-pushed the bug1842203-fedcm-provider-prompt branch 3 times, most recently from 8eb5047 to 133c811 Compare September 21, 2023 21:40
@titooan titooan force-pushed the bug1842203-fedcm-provider-prompt branch 3 times, most recently from bc8d695 to 42f4c97 Compare September 22, 2023 17:41
@titooan titooan force-pushed the bug1842203-fedcm-provider-prompt branch from 42f4c97 to eadef48 Compare September 22, 2023 18:00
@titooan titooan added the 🛬 needs landing PRs that are ready to land label Sep 25, 2023
@mergify mergify Bot merged commit 06ba878 into mozilla-mobile:main Sep 25, 2023
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