Skip to content

feat(you): show username card for auto-assigned handles - #935

Merged
bmc08gt merged 1 commit into
mainfrom
feat/username-card-assigned
Oct 1, 2026
Merged

bmc08gt merged 1 commit into
mainfrom
feat/username-card-assigned

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

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 YouScreen into usernameNeedsClaim(username:isAutoAssigned:) in UsernameGate.swift, which is true when there is no handle or when Profile.isUsernameAutoAssigned is set. Moving it out of the view makes it unit-testable.

No local profile patching is needed. Both ProfileNameScreen and UsernameEntryScreen call session.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 UsernameGateTests cases covering no handle, an auto-assigned handle, and a custom handle.

Android counterpart: code-payments/code-android-app#1643

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.
@bmc08gt bmc08gt self-assigned this Sep 30, 2026
@bmc08gt
bmc08gt merged commit 4247320 into main Oct 1, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant