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: introduce BasicTextField2 [WPB-8779] [WPB-8727] #2991

Merged
merged 11 commits into from May 14, 2024

Conversation

saleniuk
Copy link
Contributor

@saleniuk saleniuk commented May 9, 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?

There are some issues with current text fields, numerous crashes or weird behaviours. Google noticed that some time ago and started working on v2.
This PR is introducing BasicTextField2 into our project, replacing all our current text fields with the new version, at this moment temporarily still using our logic with passing TextFieldValue and onValueChanged callbacks. Ultimately, all text fields should be migrated to use TextFieldState.

In this PR:

  • the compose-foundation library needed to be updated to 1.7.0-alpha05, from which BasicTextField2 has been marked as stable; in versions prior to chosen one, including current newest release version - 1.6.7, BasicTextField2 has some bad issues with the keyboard (https://issuetracker.google.com/issues/339171226) and interaction source (https://issuetracker.google.com/issues/327665606).
  • to use this 1.7.0 version, rememberRipple() needs to be updated to ripple() and AnchoredDraggableState also requires decayAnimationSpec
  • our each input type now has two different versions, one "hybrid" still with TextFieldValue and onValueChanged and second one already with TextFieldState - it applies to WireTextField, WirePasswordTextField and CodeTextField
  • AutoFillTextField is removed and auto fill option is added as a parameter to the WireTextField as it doesn't make sense to keep two almost the same classes
  • common parts of these input pairs are extracted to "layout" composables - for WireTextField and WirePasswordTextField there is WireTextFieldLayout reused, and for CodeTextField there is a CodeTextFieldLayout
  • old "hybrid" text fields use StateSyncingModifier which is based on compose BasicTextFieldWithValueOnValueChangeSample which allows to synchronise between TextFieldState and TextFieldValue with onValueChanged callback

Notes:

  • in newest compose library version that this PR uses, BasicTextField2 has been marked as stable and renamed to regular BasicTextField, so it's quite confusing, but the difference is that new one takes TextFieldState instead of TextFieldValue or String
  • it's a bit related to fix: crashing message composer input [WPB-8727] #2988 as it also fixes this issue but RC PR only updates the text field for the message composer, this PR updates all text fields

Testing

How to Test

All text fields has been updated so ideally all of them should be tested and checked if they behave the same.


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.

Copy link
Contributor

github-actions bot commented May 9, 2024

Test Results

928 tests  ±0   928 ✅ ±0   13m 7s ⏱️ - 1m 38s
123 suites ±0     0 💤 ±0 
123 files   ±0     0 ❌ ±0 

Results for commit b0ab19d. ± Comparison against base commit bb9e765.

♻️ This comment has been updated with latest results.

@AndroidBob
Copy link
Collaborator

Build 4692 failed.

@AndroidBob
Copy link
Collaborator

Build 4693 failed.

Copy link
Contributor

github-actions bot commented May 9, 2024

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

Copy link
Contributor

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

@AndroidBob
Copy link
Collaborator

Build 4716 succeeded.

The build produced the following APK's:

@saleniuk saleniuk requested review from a team, typfel, yamilmedina, alexandreferris, MohamadJaara and vitorhugods and removed request for a team May 13, 2024 08:08
Copy link
Contributor

@alexandreferris alexandreferris left a comment

Choose a reason for hiding this comment

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

Amazing work!

Just have a small nitpick

Copy link
Contributor

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

@AndroidBob
Copy link
Collaborator

Build 4726 succeeded.

The build produced the following APK's:

Copy link
Contributor

@vitorhugods vitorhugods left a comment

Choose a reason for hiding this comment

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

Looks awesome.

Just a small question and a nitpick 🙃

@codecov-commenter
Copy link

codecov-commenter commented May 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 44.15%. Comparing base (bb9e765) to head (b0ab19d).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2991      +/-   ##
===========================================
- Coverage    44.19%   44.15%   -0.05%     
===========================================
  Files          447      447              
  Lines        14548    14548              
  Branches      2498     2498              
===========================================
- Hits          6429     6423       -6     
- Misses        7417     7424       +7     
+ Partials       702      701       -1     
Files Coverage Δ
.../conversations/messages/item/RegularMessageItem.kt 0.00% <ø> (ø)
...nConversation/JoinConversationViaDeepLinkDialog.kt 85.71% <ø> (ø)

... and 2 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 bb9e765...b0ab19d. Read the comment docs.

Copy link
Contributor

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

@AndroidBob
Copy link
Collaborator

Build 4739 succeeded.

The build produced the following APK's:

@saleniuk saleniuk added this pull request to the merge queue May 14, 2024
Merged via the queue into develop with commit 24769c4 May 14, 2024
12 checks passed
@saleniuk saleniuk deleted the refactor/basictextfield2_with_temp_wrapper branch May 14, 2024 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants