Skip to content
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

refactor: update text input logic to v2 TextFieldState, part 2 [WPB-8779] #3031

Merged
merged 6 commits into from
May 29, 2024

Conversation

saleniuk
Copy link
Contributor

@saleniuk saleniuk commented May 23, 2024

TaskWPB-8779 Introduce BasicTextField2


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Android Compose has new v2 version of text field inputs, and with that, they are going away from the previous approach with TextFieldValue and onValueChanged and replacing it with TextFieldState.
We already updated text fields to v2 but still are using "hybrid" solution which synchronises between TextFieldValue/onValueChanged and TextFieldState.

In this PR, following screens, their ViewModels logic and tests are updated to use TextFieldState:

  • LoginEmailScreen
  • LoginSSOScreen
  • ProxyScreen
  • LoginEmailVerificationCodeScreen
  • CreateAccountCodeScreen
  • CreateAccountDetailsScreen
  • CreateAccountEmailScreen

Also, states for login are split into two dedicated for email login and sso login as having one for both was making a confusion, especially when having instances of all three LoginViewModel, LoginEmailViewModel and LoginSSOViewModel was giving impression that the state is shared between them but in theory they could have different values.

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

How to Test

Use text fields from any of listed screens.


PR Post Submission Checklist for internal contributors (Optional)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

Copy link

Ups 🫰🟨

This PR is too big. Please try to break it up into smaller PRs.

@AndroidBob
Copy link
Collaborator

Build 4944 failed.

Copy link
Contributor

github-actions bot commented May 23, 2024

Test Results

930 tests   930 ✅  16m 52s ⏱️
124 suites    0 💤
124 files      0 ❌

Results for commit 7f8a502.

♻️ This comment has been updated with latest results.

@codecov-commenter
Copy link

codecov-commenter commented May 23, 2024

Codecov Report

Attention: Patch coverage is 45.34413% with 135 lines in your changes are missing coverage. Please review.

Project coverage is 44.24%. Comparing base (19032ec) to head (7f8a502).
Report is 3 commits behind head on develop.

Current head 7f8a502 differs from pull request most recent head c54a399

Please upload reports for the commit c54a399 to get more accurate results.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3031      +/-   ##
===========================================
- Coverage    44.32%   44.24%   -0.08%     
===========================================
  Files          450      449       -1     
  Lines        14521    14526       +5     
  Branches      2497     2492       -5     
===========================================
- Hits          6436     6427       -9     
- Misses        7375     7397      +22     
+ Partials       710      702       -8     
Files Coverage Δ
...d/ui/authentication/login/email/LoginEmailState.kt 100.00% <100.00%> (ø)
...droid/ui/authentication/login/sso/LoginSSOState.kt 100.00% <100.00%> (ø)
...tication/verificationcode/VerificationCodeState.kt 100.00% <ø> (ø)
...on/create/details/CreateAccountDetailsViewState.kt 0.00% <0.00%> (ø)
...wire/android/ui/authentication/login/LoginState.kt 80.00% <80.00%> (-5.72%) ⬇️
...cation/create/email/CreateAccountEmailViewState.kt 0.00% <0.00%> (ø)
.../android/ui/authentication/login/LoginViewModel.kt 73.68% <46.66%> (-3.37%) ⬇️
...cation/create/email/CreateAccountEmailViewModel.kt 0.00% <0.00%> (ø)
.../authentication/login/email/LoginEmailViewModel.kt 75.78% <77.41%> (+2.51%) ⬆️
...d/ui/authentication/login/sso/LoginSSOViewModel.kt 71.94% <68.62%> (+0.40%) ⬆️
... and 3 more

... and 26 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 482c179...c54a399. Read the comment docs.

@AndroidBob
Copy link
Collaborator

Build 4946 succeeded.

The build produced the following APK's:

Copy link
Contributor

APKs built during tests are available here. Scroll down to Artifacts!

@AndroidBob
Copy link
Collaborator

Build 4956 succeeded.

The build produced the following APK's:

@saleniuk saleniuk requested review from a team, typfel, yamilmedina, borichellow, MohamadJaara and Garzas and removed request for a team May 23, 2024 16:22
…-v2-textfieldstate-pt2

# Conflicts:
#	app/src/main/kotlin/com/wire/android/ui/authentication/create/code/CreateAccountCodeScreen.kt
Copy link

sonarcloud bot commented May 28, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.1% Duplication on New Code

See analysis details on SonarCloud

@AndroidBob
Copy link
Collaborator

Build 5048 succeeded.

The build produced the following APK's:

Copy link
Contributor

@borichellow borichellow left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@saleniuk saleniuk added this pull request to the merge queue May 29, 2024
Merged via the queue into develop with commit ac41864 May 29, 2024
11 checks passed
@saleniuk saleniuk deleted the refactor/update-to-v2-textfieldstate-pt2 branch May 29, 2024 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants