This commit is contained in:
2026-10-21 16:20:51 +07:00
parent d0ad1a6f57
commit d7160e196e
46 changed files with 2307 additions and 1534 deletions
+32 -39
View File
@@ -11,7 +11,6 @@ use gpui::{
list, px,
};
use gpui_kit::assets::IconName;
use gpui_kit::component::avatar::Avatar;
use gpui_kit::component::button::{Button, ButtonVariant, ButtonVariants};
use gpui_kit::component::dialog::DialogButtonProps;
use gpui_kit::component::dock::{Panel, PanelEvent};
@@ -26,7 +25,7 @@ use serde::Deserialize;
use settings::AppSettings;
use smallvec::{SmallVec, smallvec};
use state::{NostrRegistry, upload};
use ui::{TextStyle, Typeset as _, control_radius};
use ui::Avatar;
use util::{attachment_name, display_name, opens_run, pin_label, report};
mod details;
@@ -209,7 +208,7 @@ pub fn confirm_leave(group: WeakEntity<Group>, window: &mut Window, cx: &mut App
)
.child(
div()
.text_style(TextStyle::Callout)
.text_xs()
.child("You will stop receiving messages from this group."),
)
.on_ok(move |_event, _window, cx| {
@@ -245,7 +244,7 @@ pub fn confirm_delete(group: WeakEntity<Group>, window: &mut Window, cx: &mut Ap
)
.child(
div()
.text_style(TextStyle::Callout)
.text_xs()
.child("The relay will remove this group for everyone."),
)
.on_ok(move |_event, window, cx| {
@@ -714,10 +713,10 @@ impl GroupPanel {
h_flex()
.flex_shrink_0()
.w_full()
.gap(px(ui::SPACE))
.gap_2()
.px_3()
.py_2()
.text_style(TextStyle::Callout)
.text_xs()
.border_b_1()
.border_color(cx.theme().border)
.child(
@@ -752,10 +751,10 @@ impl GroupPanel {
h_flex()
.flex_shrink_0()
.w_full()
.gap(px(ui::SPACE))
.gap_2()
.px_3()
.py_2()
.text_style(TextStyle::Callout)
.text_xs()
.bg(cx.theme().secondary)
.child(
Icon::new(IconName::Info)
@@ -819,9 +818,9 @@ impl GroupPanel {
div()
.px_1p5()
.py_0p5()
.rounded(px(control_radius()))
.rounded(cx.theme().radius)
.bg(cx.theme().primary)
.text_style(TextStyle::Caption)
.text_xs()
.text_color(cx.theme().muted_foreground)
.child(pin_label(group, pin))
}))
@@ -838,16 +837,12 @@ impl GroupPanel {
(
display_name(group),
match picture {
Some(picture) => Avatar::new().src(picture).large().into_any_element(),
None => Avatar::new().large().into_any_element(),
},
Avatar::new(picture.map(Into::into))
.seed(group.key().cache_tag())
.large(),
)
}
None => (
SharedString::from("this group"),
Avatar::new().large().into_any_element(),
),
None => (SharedString::from("this group"), Avatar::new(None).large()),
};
WelcomeMessage::new("welcome")
@@ -904,10 +899,10 @@ impl GroupPanel {
.w_full()
.justify_center()
.items_center()
.gap(px(ui::SPACE))
.gap_2()
.px_3()
.py_2()
.text_style(TextStyle::Callout)
.text_xs()
.text_color(cx.theme().muted_foreground);
match notice {
@@ -1117,9 +1112,9 @@ impl GroupPanel {
.gap_1()
.px_2()
.py_1()
.rounded(px(control_radius()))
.rounded(cx.theme().radius)
.bg(cx.theme().secondary)
.text_style(TextStyle::Caption)
.text_xs()
.child(
div()
.flex_shrink_0()
@@ -1170,8 +1165,8 @@ impl GroupPanel {
.px_2()
.border_1()
.border_color(cx.theme().border)
.rounded(px(control_radius()))
.text_style(TextStyle::Caption)
.rounded(cx.theme().radius)
.text_xs()
.text_color(cx.theme().muted_foreground)
.child(Icon::new(IconName::Link).xsmall())
.child(
@@ -1233,26 +1228,24 @@ impl Panel for GroupPanel {
.upgrade()
.map(|group| {
let group = group.read(cx);
let picture = group
.metadata()
.and_then(|metadata| metadata.picture.clone());
h_flex()
.gap_1()
.text_style(TextStyle::Caption)
.child(match picture {
Some(picture) => Avatar::new().src(picture).xsmall().into_any_element(),
None => Avatar::new().xsmall().into_any_element(),
})
.text_xs()
.child(
Avatar::new(
group
.metadata()
.and_then(|metadata| metadata.picture.clone())
.map(Into::into),
)
.seed(group.key().cache_tag())
.xsmall(),
)
.child(display_name(group))
.into_any_element()
})
.unwrap_or_else(|| {
div()
.text_style(TextStyle::Caption)
.child("Unknown")
.into_any_element()
})
.unwrap_or_else(|| div().text_xs().child("Unknown").into_any_element())
}
fn toolbar_buttons(
@@ -1296,7 +1289,7 @@ impl Render for GroupPanel {
None => h_flex()
.size_full()
.justify_center()
.text_style(TextStyle::Callout)
.text_xs()
.text_color(cx.theme().muted_foreground)
.child("No messages yet")
.into_any_element(),