Page MenuHomePhabricator

[native] introduce emoji avatar creation screen
ClosedPublic

Authored by ginsu on Apr 5 2023, 12:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, May 7, 6:41 AM
Unknown Object (File)
Mon, Apr 22, 11:48 PM
Unknown Object (File)
Apr 14 2024, 11:55 PM
Unknown Object (File)
Mar 28 2024, 6:00 AM
Unknown Object (File)
Mar 28 2024, 6:00 AM
Unknown Object (File)
Mar 28 2024, 6:00 AM
Unknown Object (File)
Mar 28 2024, 6:00 AM
Unknown Object (File)
Mar 28 2024, 6:00 AM
Subscribers

Details

Summary

Introduce emoji avatar creation screen. Subsequent diffs will integrate this into the profile navigator/navigating to this screen. This diff is purely just a UI/UX diff for the avatar creation screen, and the next diff will handle the behavior/UX when a user tries to save their new emoji avatar

Link to figma

Design:

Screenshot 2023-04-04 at 3.44.01 PM.png (1×556 px, 76 KB)

Depends on D7373

Test Plan

Please watch the demo video to see how the emoji avatar creation screen works.

UPDATE:
Got some feedback regarding the colors we were using, synced with Ted and now this is what the screen will look like visually:

Screenshot 2023-04-10 at 2.37.24 PM.png (1×1 px, 796 KB)

Screenshot 2023-04-10 at 2.37.11 PM.png (1×1 px, 787 KB)

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ginsu edited the test plan for this revision. (Show Details)
ginsu added reviewers: ashoat, atul.
ginsu edited the summary of this revision. (Show Details)
ginsu added inline comments.
native/profile/emoji-avatar-creation.react.js
180 ↗(On Diff #24686)

A subsequent diff will handle introducing these color values into our theme file

ginsu requested review of this revision.Apr 5 2023, 12:22 PM
native/profile/emoji-avatar-creation.react.js
180 ↗(On Diff #24686)

This would be good to handle in a preceding diff rather than a subsequent diff

It's unclear in the video what happens when you save.

Does the modal stay open while it saves? In that case, I wonder if the pending state variables should default to undefined (wondering how we differentiate pending state vs pending-save state). Also wondering how we'll disable buttons while the save is ongoing.

If the modal closes immediately, then I'm wondering about the pending save state in the ProfileScreen, eg. do we optimistically display the new avatar, or display some loading indicator, etc.

native/profile/emoji-avatar-creation.react.js
115 ↗(On Diff #24686)

Capitalization feels off but might just be me

Can this be shorter? Like "Save avatar"?

Removing diff from my reviewers queue as I address improving the behavior after a user saves

It's unclear in the video what happens when you save.

At the moment, we are pushing the new avatar emoji into the database. I thought about this some more and feel that a better user experience would be:

  1. The save button will just say "Save avatar"
  2. The save button will not go back (there is already a back button present and the button text has nothing about exiting or going back)
  3. We will introduce a loading status through createLoadingStatusSelector
  4. When the screen is loading, we'll disable buttons while the save is ongoing.
  5. If there is an error will show a pop up saying "Couldn't save avatar, please try again later"

Nice! Might be worth syncing with Ted... ideally this stuff is covered in designs and you don't have to "wing out", and I don't have to call out the UX issues.

Separately, can you clarify where the loading indicator will be displayed? We could potentially put it inside the button, but worth asking Ted about all of this.

Separately, can you clarify where the loading indicator will be displayed?

Just synced with Ted and he says he would like the loading indicator to be displayed on top of the avatar component (like what we will do with image avatars)

Screenshot 2023-04-06 at 4.20.56 PM.png (1×628 px, 139 KB)

Ted also suggested that we should automatically navigate the user back when the avatar is saved successfully. He said otherwise, the feedback we give back to users when the avatar is saved is not very clear. Alternatively, he said a toast component could work. However, I think building the toast will take some time and shouldn't be a priority rn

Screenshot 2023-04-06 at 4.27.26 PM.png (422×582 px, 47 KB)

However, I think building the toast will take some time and shouldn't be a priority rn

You can actually just call displayActionResultModal("string") to use our existing "toast" functionality. It doesn't look like that design but it's easy to use and better than nothing

You can actually just call displayActionResultModal("string") to use our existing "toast" functionality. It doesn't look like that design but it's easy to use and better than nothing

Awesome I'll give that a try

native/profile/emoji-avatar-creation.react.js
180 ↗(On Diff #24686)

Splitting this diff into two, this is part 1

Addressing all the feedback for the saving avatar UX made this diff very large. I will split this diff into two to make it easier to review. This diff will handle purely all the UI and frontend user interactions (visual layout, picking a new emoji, picking a new color, and resetting the avatar), and the next diff will handle all the behavior when a user hits save (displaying a loading state, saving the avatar, and showing an error or success depending on the results of the response)

ginsu edited the test plan for this revision. (Show Details)
ashoat requested changes to this revision.Apr 7 2023, 6:02 PM

Overall looks good, but we need to get better at maintaining a consistent design system

native/profile/emoji-avatar-creation.react.js
36–39 ↗(On Diff #24823)

Selecting a color based on dark / light mode is what the list of colors in colors.js is for. By separating out a color choice into this file, you have the effect of breaking the rule that "all colors in our themes are in colors.js", and you make it harder to maintain a consistent design system. Please try to find an existing color in colors.js that matches. If you can't find one, try to find a close one and ask Ted if it looks good. If not, ask him if it should be updated, and point him to what in the codebase it would affect. If you are both absolutely sure we need a new color, then add it to colors.js

This revision now requires changes to proceed.Apr 7 2023, 6:02 PM

addressed ashoat's comments

native/profile/emoji-avatar-creation.react.js
36–39 ↗(On Diff #24823)

Synced with Ted on this and updated the diff accordingly

Please make sure CI passes before landing

This revision is now accepted and ready to land.Apr 10 2023, 12:03 PM