refactor(client): adopt UserAvatar at inline-CircleAvatar sites#1113
Open
NC1107 wants to merge 1 commit into
Open
refactor(client): adopt UserAvatar at inline-CircleAvatar sites#1113NC1107 wants to merge 1 commit into
NC1107 wants to merge 1 commit into
Conversation
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.
Componentization sweep from the 2026-05-22 audit (#1099). Reviewed 11 inline
CircleAvatar/Container(shape: circle)sites flagged as candidates for the canonicalUserAvatarwidget. Only one of the 11 actually represented a real user — the rest are static decoration, the user's own profile-editor card (with bespoke camera-button + accent-border overlay), or group/channel avatars.Behind the scenes
widgets/chat_panel/empty_message_placeholder.dart:22— migrated toUserAvatar(openProfileOnTap: false, bgColor: context.accent). Threaded the peer'suserIdandavatarUrlthroughChatMessageList(already hadconv+myUserId+memberAvatarsin scope), so the empty 1:1 placeholder now shows the peer's real avatar when one is set instead of always falling back to an initial circle.Skipped (with reason)
Each of these was flagged by the audit but is not a user-avatar surface or would lose features if force-fit through
UserAvatar's API:screens/settings/accessibility_section.dart:78— static "Sam Patel" font-scale preview card. No real user.screens/settings/account_section.dart:452— the local user's own profile-card avatar. Has a hand-built stack: accent-coloured border ring, camera-button upload overlay, hard-codedEchoTheme.onlinedot, and aNetworkImagewith customAuthorizationheaders. Migrating would either widenUserAvatar's API significantly (a one-off use case) or drop the upload/auth-header features.screens/join/join_preview_scaffold.dart:286—Icons.link_off_roundederror icon, not a user.screens/join/join_preview_scaffold.dart:366, 373— group/server preview avatar (usesiconUrland group-name initials, not a user).screens/onboarding_wizard.dart:543— avatar picker during signup. Includes a camera/upload overlay, accent border, and the user has no profile to open yet.widgets/global_search_overlay.dart:630— group result tile (usesr.title, not a user).screens/group_info_screen/parts/header_section.dart:151, 159— group header avatar with upload affordance. Not a user.widgets/channel_column.dart:329— group column header (usesgroupAvatarColor(conversation.id)). Not a user.Per the task's guidance, I did not widen
UserAvatar's API to force-fit the "own-profile card with upload affordance" cases — they are deliberately bespoke. A future componentization pass could introduce a separateEditableOwnAvatarwidget shared betweenaccount_section,onboarding_wizard, andheader_section(group upload variant), but that is outside the scope of this PR.Refs #1099.
Test plan
flutter analyze --fatal-infos— clean.flutter test test/widgets/chat_panel_test.dart test/widgets/chat_panel/— 19/19 pass (includes the "empty placeholder renders with no messages" coverage).