Skip to content

On boarding flow: add a screen to select account provider among a fixed list #4769

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented May 23, 2025

Content

When EnterpriseService provides a fixed list of account providers, i.e. at least 2 account providers and no "*", the login flow follows a new path so that when the user clicks on "Sign in manually", a screen with the list of available account providers is displayed.

Motivation and context

Handle specific case where a fixed list of account providers is configured in the application.

Screenshots / GIFs

See recorded screenshot. Note that the UI does not exactly match what was provided in Figma, but match with the existing code. I may iterate the UI in a future dedicated PR.

Tests

  • Need to hack the code. Let DefaultEnterpriseService.defaultHomeserverList() return a list of homeserver like listOf("matrix.org", "element.io")
  • Run the app and start the login flow
  • Click on "Sign in manually
  • See the new screen
  • Click on "matrix.org" this should open mas.matrix.org
  • Go back
  • Click on "element.io" this should open mas.element.io

The login flow can be finished normally

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

  • Changes have been tested on an Android device or Android emulator with API 24
  • UI change has been tested on both light and dark themes
  • Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
  • Pull request is based on the develop branch
  • Pull request title will be used in the release note, it clearly define what will change for the user
  • Pull request includes screenshots or videos if containing UI changes
  • You've made a self review of your PR

@bmarty bmarty requested a review from a team as a code owner May 23, 2025 07:43
@bmarty bmarty removed the request for review from a team May 23, 2025 07:43
@bmarty bmarty added the PR-Change For updates to an existing feature label May 23, 2025
@bmarty bmarty requested a review from jmartinesp May 23, 2025 07:43
Copy link
Contributor

github-actions bot commented May 23, 2025

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/XNvUjM

Copy link

codecov bot commented May 23, 2025

Codecov Report

Attention: Patch coverage is 98.31933% with 4 lines in your changes missing coverage. Please review.

Project coverage is 80.40%. Comparing base (5a2aeac) to head (b29546d).
Report is 10 commits behind head on develop.

Files with missing lines Patch % Lines
...chooseaccountprovider/ChooseAccountProviderView.kt 96.66% 1 Missing and 1 partial ⚠️
...n/impl/accountprovider/AccountProviderOtherView.kt 96.15% 0 Missing and 1 partial ⚠️
...gin/impl/screens/onboarding/OnBoardingPresenter.kt 92.85% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4769      +/-   ##
===========================================
+ Coverage    80.33%   80.40%   +0.06%     
===========================================
  Files         2135     2142       +7     
  Lines        56431    56642     +211     
  Branches      7067     7081      +14     
===========================================
+ Hits         45336    45545     +209     
- Misses        8678     8679       +1     
- Partials      2417     2418       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jmartinesp
Copy link
Member

I just tried using listOf("*", "matrix.org", "element.io") to check what would happen and I got some weird UI. I think we may be lacking some filter somewhere?

any-provider.mp4

@bmarty
Copy link
Member Author

bmarty commented May 23, 2025

Good catch, let me handle this case a bit better, even if IRL it should barely occurs.

Generally the list can have the values:

  • listOf("server.tld") -> one server, no way to use another one
  • listOf("server1.tld", "server2.tld") -> fixed list of servers
  • listOf("server.tld", "*") -> one sever, allow to use any other

The code should maybe just ensure that "*" is moved to the end of the list

bmarty added 3 commits May 23, 2025 12:11
This should not happen IRL, but better be robust against issue in application configuration.
Copy link

Copy link
Member

@jmartinesp jmartinesp left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for fixing the issue. Having to select a provider then click on 'Continue' is a bit weird, although I guess this will be improved in the following PRs.

@bmarty
Copy link
Member Author

bmarty commented May 23, 2025

LGTM, thanks for fixing the issue. Having to select a provider then click on 'Continue' is a bit weird, although I guess this will be improved in the following PRs.

This is the design but it's true that it's for iOS, so we may take some shortcut for Android...

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Change For updates to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants