-
Notifications
You must be signed in to change notification settings - Fork 991
[#21924] Fix onboarding display name and picture #22118
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
base: develop
Are you sure you want to change the base?
Conversation
(def ^:const temp-display-name | ||
"While creating a profile, we cannot use an empty string; this value works as a | ||
placeholder that will be updated later once the compressed key exists. See | ||
`status-im.contexts.profile.edit.name.events/get-default-display-name` for more details." | ||
"temporal username") | ||
|
||
(rf/reg-event-fx | ||
:onboarding/use-temporary-display-name | ||
(fn [{:keys [db]} [temporary-display-name?]] | ||
{:db (assoc db | ||
:onboarding/profile | ||
{:temporary-display-name? temporary-display-name? | ||
:display-name (if temporary-display-name? | ||
temp-display-name | ||
"")})})) | ||
|
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.
Removed this and related code because now the display-name
is allowed to be empty, in that case, the alias is shown. The new alias is the compressed key with ellipsis
(defn default-display-name? | ||
[display-name] | ||
(and (some? display-name) | ||
(or (= display-name "") | ||
(string/includes? display-name "…")))) |
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 this predicate to show the default profile picture when it returns true
Jenkins Builds
|
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.
Left minor comments in the related Go PR, but apart from that LGTM
|
||
(defn default-display-name? | ||
[display-name] | ||
(and (some? display-name) |
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.
Nitpick: The result of some?
is guaranteed to be a boolean, but in most cases it's not needed. Here could be just (and display-name ...)
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.
Yes, some?
is just not + nil
, IDK, just wanted to use it. I'll change it :)
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 stuff ✅
Thank you!
@ulisesmac thanks for the PR. Could you please rebase both status go and mobile PRs and update mobile PR so it points latest go commit? Once it is done, please move PR to E2E column in order QAs can pick it up. |
hi @ulisesmac just pinging you in case you missed the comment :) |
Sorry, I actually missed the first comment, but this PR is stuck waiting for the feature impl. on Desktop, context: https://discord.com/channels/1210237582470807632/1346475491414245417/1347188157246079078 I'll ping you once the PR is unlocked. Thank you! |
fixes #21924
fixes #21827
Related status-go PR:
Summary
This PR fixes:
The default display-name shown everywhere in the app to be the compressed key with an ellipsis:

Updates the avatar icon shown for the default display name:

Note: The new alias is only shown for new contacts/profiles when the display-name cannot be fetched, old ones will stilll use the 3-words name one
Demo:
Screencast.From.2025-02-14.12-01-15.mp4
Platforms
Steps to test
status: ready