From e6e5ccbf10c82678b14723807ba456b8ae70b5f5 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Thu, 20 Nov 2025 20:30:34 +0100 Subject: [PATCH] ui: Render fallback icon for avatars that failed to load (#43183) Before we were simply not rendering anything which could lead to some very surprising situations when joining channels ... Now it will look like so image Release Notes: - Improved rendering of avatars that failed to load by rendering a fallback icon --- crates/ui/src/components/avatar.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/ui/src/components/avatar.rs b/crates/ui/src/components/avatar.rs index 19f7c4660bc64e756950df6f5ab0e19192f4096b..551ab4e3edff90f3b987ddd5ef19cfdeae1fa214 100644 --- a/crates/ui/src/components/avatar.rs +++ b/crates/ui/src/components/avatar.rs @@ -91,7 +91,12 @@ impl RenderOnce for Avatar { self.image .size(image_size) .rounded_full() - .bg(cx.theme().colors().ghost_element_background), + .bg(cx.theme().colors().ghost_element_background) + .with_fallback(|| { + Icon::new(IconName::Person) + .color(Color::Muted) + .into_any_element() + }), ) .children(self.indicator.map(|indicator| div().child(indicator))) }