feat: add contact-based chat creation and re-add chat screening #54
@@ -84,11 +84,7 @@ impl RenderOnce for Nav {
|
||||
fn render(self, _window: &mut Window, cx: &mut App) -> impl IntoElement {
|
||||
let clickable = self.on_click.is_some();
|
||||
|
||||
v_flex()
|
||||
.id(format!("nav-{}", self.id))
|
||||
.w_full()
|
||||
.h_10()
|
||||
.child(
|
||||
v_flex().w_full().h_10().child(
|
||||
h_flex()
|
||||
.id(self.id)
|
||||
.h_9()
|
||||
|
||||
@@ -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| {
|
||||
|
||||
@@ -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,10 +359,7 @@ impl SearchPanel {
|
||||
this.select(&pkey_clone, cx);
|
||||
});
|
||||
|
||||
Nav::new(ElementId::NamedInteger(
|
||||
"search-result".into(),
|
||||
(range.start + ix) as u64,
|
||||
))
|
||||
Nav::new(range.start + ix)
|
||||
.label(profile.name())
|
||||
.text_sm()
|
||||
.font_medium()
|
||||
@@ -409,10 +406,7 @@ impl SearchPanel {
|
||||
this.select(&pkey_clone, cx);
|
||||
});
|
||||
|
||||
Nav::new(ElementId::NamedInteger(
|
||||
"contact".into(),
|
||||
(range.start + ix) as u64,
|
||||
))
|
||||
Nav::new(range.start + ix)
|
||||
.label(profile.name().trim())
|
||||
.text_sm()
|
||||
.font_medium()
|
||||
|
||||
@@ -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| {
|
||||
|
||||
Reference in New Issue
Block a user