fix(chat): show a tip user's initials, not a silhouette, when they have no photo - #1337
Closed
bmc08gt wants to merge 1 commit into
Closed
fix(chat): show a tip user's initials, not a silhouette, when they have no photo#1337bmc08gt wants to merge 1 commit into
bmc08gt wants to merge 1 commit into
Conversation
…ve no photo The same person got two different avatars depending on the screen. The tips list and the blocklist call `ContactAvatar(image, displayName)`, which falls back to initials. The chat header, info card, profile sheet and activity feed call the `UserProfile` overload, which dropped the name on the floor and fell back to the person silhouette — so a tipper with no photo was "GH" in the tips list and an anonymous grey figure in the conversation they opened from it. Give that overload the same fallback, naming the person with `nameOrHandle` so a handle-only account gets the first letter of their handle rather than nothing. `InitialsText` already strips the `@`. A profile with neither a name nor a handle keeps the silhouette. The activity feed depends on that: its non-person rows pass `UserProfile.Empty` to get one. `ContactAvatarFallbackScreenshotTest` renders the three states side by side.
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 same person gets two different avatars depending on which screen you're on. A tipper with no profile photo is
GHin the tips list, and an anonymous grey silhouette in the conversation you open from it.Two overloads of
ContactAvatarback a server profile, and only one of them uses the name:ContactAvatar(image, displayName)— the tips list, the blocklist — falls back toInitialsText(displayName).ContactAvatar(userProfile)— the chat top bar, the info card, the profile sheet, the activity feed — dropped the name and fell back to the person silhouette.What changed
The
UserProfileoverload now falls back the same way, naming the person withnameOrHandleso a handle-only account gets the first letter of their handle rather than nothing.InitialsTextalready strips the@.A profile with neither a name nor a handle keeps the silhouette, which the activity feed depends on — its non-person rows pass
UserProfile.Emptyto get one.Tests
ContactAvatarFallbackScreenshotTestrenders the three states side by side (named, handle-only, anonymous).common-uipicks uplibs.bundles.unit.testingfor the Compose test rule; it already had Robolectric.The messenger's existing
ChatIdentityScreenshotTestcovers this end to end — its tip-user rows now render initials.