feat(members): set a member's emoji, and show it beside their name - #69
Merged
Conversation
The phone could read a member's emoji but never write one, and only showed it as a stand-in avatar. So it was invisible to anyone who had also set an avatar picture, and unreachable entirely unless they had gone to web to set it. Adds an Emoji field to the member editor, next to Display Name, and threads it through MemberCreate and MemberUpdate, which did not carry the field at all even though the server has accepted it on both for a long time. Input is capped at the server's 8, counted in code points rather than chars: a single emoji is often several UTF-16 units and a family sequence is seven, so counting chars would reject ordinary input. Clearing sends an empty string rather than null. The member PATCH is omit-means-unchanged and Moshi drops nulls, so a null would silently leave the old emoji in place and the field could be set but never unset. The scratchpad note already does the same thing for the same reason. Display now matches web and the watch: the emoji sits in front of the name in the members list, the profile title, the fronting cards on Home, the switch sheet, the quick-switch chips, history rows, and the member rows inside a group. Sorting, searching and content descriptions keep the plain name, since a prefix there would file the roster under one character, break name search, and make a screen reader read an emoji before every name.
7 tasks
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 phone could read a member's emoji but never write one, and only ever showed it as a stand-in avatar.
Two consequences: anyone who set both an emoji and an avatar picture never saw the emoji at all, since the picture replaced the only place it appeared. And there was no way to set one on Android in the first place -
MemberCreateandMemberUpdatedidn't carry the field, despite the server accepting it on both for a long time.Setting it
An Emoji field in the member editor, next to Display Name, mirroring web's small emoji input.
Capped at the server's limit of 8, counted in code points rather than chars. A single emoji is often several UTF-16 units and a family sequence is seven, so a
String.lengthcap would reject perfectly ordinary input while claiming a limit of 8.Clearing sends an empty string, not null. The member PATCH is omit-means-unchanged and Moshi drops nulls, so a null would silently leave the old emoji in place - the field would be settable but never unsettable. That's the same trap as #68 in this batch, and the scratchpad note field already solves it the same way.
Showing it
Now matches web and the watch: the emoji sits in front of the name in the members list, the profile title, the fronting cards on Home, the switch sheet, the quick-switch chips, history rows, and the member rows inside a group.
displayNameWithEmojiis deliberately display-only. Sorting, searching and content descriptions keepdisplayNameOrName, because a prefix there would file the whole roster under one character, stop a name query matching, and make a screen reader announce an emoji before every name. Of the 62 places a member's name is rendered, nine are actual name displays; a diff check confirms no sort or search site changed.Testing
:app:assemblePlayRelease,:app:assembleOpenRelease,:app:testPlayReleaseUnitTestgreen. Unit tests cover the emoji reaching the wire on create and update, the empty-string clear, the display property with and without an emoji, and that the plain name and initials stay emoji-free.Device checklist: