This commit is contained in:
2026-09-29 13:25:23 +07:00
parent 4d116036b9
commit 26793657df
4 changed files with 66 additions and 76 deletions
+1 -1
View File
@@ -345,7 +345,7 @@ impl NewChat {
let profile = persons.read(cx).get(public_key, cx);
let public_key = *public_key;
Nav::new(SharedString::from(format!("contact-{}", start + offset)))
Nav::new(start + offset)
.label(profile.name())
.text_sm()
.when(!AppSettings::get_hide_avatar(cx), |this| {
+31 -37
View File
@@ -6,7 +6,7 @@ use chat::{ChatRegistry, Room, RoomKind};
use common::DebouncedDelay;
use gpui::prelude::FluentBuilder;
use gpui::{
AnyElement, App, AppContext, Context, ElementId, Entity, EventEmitter, FocusHandle, Focusable,
AnyElement, App, AppContext, Context, Entity, EventEmitter, FocusHandle, Focusable,
IntoElement, ParentElement, Render, SharedString, Styled, Subscription, Task, WeakEntity,
Window, div, uniform_list,
};
@@ -359,24 +359,21 @@ impl SearchPanel {
this.select(&pkey_clone, cx);
});
Nav::new(ElementId::NamedInteger(
"search-result".into(),
(range.start + ix) as u64,
))
.label(profile.name())
.text_sm()
.font_medium()
.when(!hide_avatar, |this| {
this.prefix(
Avatar::from_source(profile.avatar())
.seed(profile.avatar_seed())
.small()
.flex_shrink_0(),
)
})
.on_click(handler)
.selected(selected)
.into_any_element()
Nav::new(range.start + ix)
.label(profile.name())
.text_sm()
.font_medium()
.when(!hide_avatar, |this| {
this.prefix(
Avatar::from_source(profile.avatar())
.seed(profile.avatar_seed())
.small()
.flex_shrink_0(),
)
})
.on_click(handler)
.selected(selected)
.into_any_element()
})
.collect()
}
@@ -409,24 +406,21 @@ impl SearchPanel {
this.select(&pkey_clone, cx);
});
Nav::new(ElementId::NamedInteger(
"contact".into(),
(range.start + ix) as u64,
))
.label(profile.name().trim())
.text_sm()
.font_medium()
.when(!hide_avatar, |this| {
this.prefix(
Avatar::from_source(profile.avatar())
.seed(profile.avatar_seed())
.small()
.flex_shrink_0(),
)
})
.on_click(handler)
.selected(selected)
.into_any_element()
Nav::new(range.start + ix)
.label(profile.name().trim())
.text_sm()
.font_medium()
.when(!hide_avatar, |this| {
this.prefix(
Avatar::from_source(profile.avatar())
.seed(profile.avatar_seed())
.small()
.flex_shrink_0(),
)
})
.on_click(handler)
.selected(selected)
.into_any_element()
})
.collect()
}
+3 -3
View File
@@ -853,7 +853,7 @@ impl Sidebar {
let dock = self.dock.clone();
let room = room.clone();
Nav::new(SharedString::from(format!("room-{index}")))
Nav::new(index)
.label(name)
.text_sm()
.font_medium()
@@ -907,7 +907,7 @@ impl Sidebar {
let sidebar = cx.entity().downgrade();
let public_key = public_key.to_owned();
Nav::new(SharedString::from(format!("contact-{index}")))
Nav::new(index)
.label(person.name())
.text_sm()
.font_medium()
@@ -937,7 +937,7 @@ impl Sidebar {
let sidebar = cx.entity().downgrade();
let community = community.clone();
Nav::new(SharedString::from(format!("com-{index}")))
Nav::new(index)
.label(name)
.text_sm()
.when(!hide_avatar, |this| {