-
Notifications
You must be signed in to change notification settings - Fork 739
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
FTUE - Choose a display name #5211
Conversation
@@ -897,6 +899,21 @@ class OnboardingViewModel @AssistedInject constructor( | |||
fun getFallbackUrl(forSignIn: Boolean, deviceId: String?): String? { | |||
return authenticationService.getFallbackUrl(forSignIn, deviceId) | |||
} | |||
|
|||
private fun updateDisplayName(displayName: String) { | |||
setState { copy(asyncDisplayName = Loading()) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this uses the same async state mechanism as the other parts of the onboarding state (sign in/register), the login V2 converts this to a simple isLoading: boolean
but I've avoided doing the same change here to keep the diff smaller
} | ||
|
||
private fun onDisplayNameUpdated() { | ||
// TODO go to the real profile picture fragment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will be the next PR
@@ -102,10 +102,16 @@ class SharedSecureStorageViewModelTest { | |||
viewModel.handle(SharedSecureStorageAction.UseKey) | |||
|
|||
test | |||
.assertState(aViewState( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assertState
was removed in favour of a helper to assert all the states (including the initial state)
Matrix SDKIntegration Tests Results:
|
cdd121c
to
98f1085
Compare
… introduce the profile picture screen
- cases for the personalisation and display name actions
98f1085
to
4a01193
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice PR, thanks.
Just a quick remark about error management.
|
||
override fun onBackPressed(toolbarButton: Boolean): Boolean { | ||
viewModel.handle(OnboardingAction.PostViewEvent(OnboardingViewEvents.OnTakeMeHome)) | ||
return false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah 🤦 thought I'd included updates from the previous PR comments, will fix!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated 8dec4fd
views.displayNameInput.editText?.addTextChangedListener(object : SimpleTextWatcher() { | ||
override fun afterTextChanged(s: Editable) { | ||
val newContent = s.toString() | ||
views.displayNameSubmit.isEnabled = newContent.isNotEmpty() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be nice to reset the error here.
Because the error when setting display name could be displayed in the TextInputLayout. You can trigger an error for instance by setting a display name with @
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mixed between display name and userId, my bad.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still it could be nice to display the error in the TextInputLayout. You can do it easily by overidding onError
in FtueAuthChooseDisplayNameFragment
.
For network error (in airplane mode for instance), it's maybe better if the error is displayed in a dialog (so just call super.onError
in this case).
Long display name can be rejected by the homeserver, and other rules may apply, that's why it could be nice to inline the error in such case IMO, instead of
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the screenshot and explanation! I've checked in with product/design, we'd like to do a pass of all the onboarding errors and their copy
I'll create another subtask in #5200 to revisit the error handling here in case there's other types of errors we'd like to capture within the text field instead of dialog and I'll need to track down all the possible error types (and their copy)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack
<com.google.android.material.textfield.TextInputEditText | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:maxLines="1" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be nice to set an inputType and android:imeOptions="actionDone"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great idea, will do 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added 6fb5d05
6fb5d05
to
16424f7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update.
Note a blocker, but could be nice to handle #5211 (comment)
thanks for the review 💯 the scope of the errors has increased a bit, I'll merge this in favour of a separate task/PR for the error updates #5211 (comment) |
Depends on #5158 Part of #5200
Type of change
Content
Adds a
Choose a display name
screen to the onboarding personalisation flow, sits behind the FTUE personailzation feature flag.Motivation and context
To allow the user to personalise their account during the account creation process
Screenshots / GIFs
*the gif animations are odd because the emulator has them turned off
Tests
OnboardingViewModel
(along with the fakes needed to setup the class) to ensure the display name is updated and errors are handledTested devices