feat(you): show username card for auto-assigned handles - #935
Merged
Merged
Conversation
The You screen only offered the custom-username card when the profile had no username, so a user the server auto-assigned a handle to never saw it. The decision now lives in usernameNeedsClaim(username:isAutoAssigned:) and is also true when Profile.isUsernameAutoAssigned is set.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The You screen's custom-username card only showed when the profile had no username. A user whose handle the server auto-assigned when they set a display name never saw it, so nothing prompted them to pick their own.
The decision moved out of
YouScreenintousernameNeedsClaim(username:isAutoAssigned:)inUsernameGate.swift, which is true when there is no handle or whenProfile.isUsernameAutoAssignedis set. Moving it out of the view makes it unit-testable.No local profile patching is needed. Both
ProfileNameScreenandUsernameEntryScreencallsession.updateProfile()after their RPC, so the refetched profile carries the server's flag. Profiles cached before this change decode the flag as false until that refetch, which also runs on session start.Tests: three new
UsernameGateTestscases covering no handle, an auto-assigned handle, and a custom handle.Android counterpart: code-payments/code-android-app#1643