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
+19 -24
View File
@@ -1,4 +1,3 @@
use gpui_kit::component::{ActiveTheme, Disableable, Sizable, WindowExt, h_flex, v_flex};
use std::cell::Cell;
use std::collections::HashSet;
use std::path::PathBuf;
@@ -9,17 +8,17 @@ use std::sync::atomic::{AtomicBool, Ordering};
use anyhow::{Context as AnyhowContext, Error, anyhow};
use gpui::{
App, AppContext, Context, Entity, EventEmitter, Global, IntoElement, ParentElement,
SharedString, Styled, Subscription, Task, Window, div, px, relative,
SharedString, Styled, Subscription, Task, Window, div, relative,
};
use gpui_kit::component::avatar::Avatar;
use gpui_kit::component::button::Button;
use gpui_kit::component::notification::{Notification, NotificationType};
use gpui_kit::component::{ActiveTheme, Disableable, Sizable, WindowExt, h_flex, v_flex};
use nostr_sdk::prelude::*;
use person::Directory;
use settings::AppSettings;
use smallvec::{SmallVec, smallvec};
use state::{Announcement, CLIENT_NAME, NostrRegistry, UniversalSigner};
use ui::{TextStyle, Typeset as _, control_radius};
use ui::Avatar;
const IDENTIFIER: &str = "coop:device";
@@ -727,25 +726,25 @@ impl DeviceRegistry {
let profile = directory.read(cx).person(&requester, cx);
v_flex()
.gap(px(ui::SPACE))
.text_style(TextStyle::Callout)
.gap_2()
.text_xs()
.child(
div()
.text_style(TextStyle::Callout)
.text_xs()
.line_height(relative(1.25))
.child(SharedString::from(MSG)),
)
.child(
v_flex()
.gap(px(ui::SPACE))
.gap_2()
.child(
v_flex()
.gap_1()
.text_style(TextStyle::Callout)
.text_xs()
.child(
div()
.font_weight(gpui::FontWeight::SEMIBOLD)
.text_style(TextStyle::Caption)
.text_xs()
.text_color(cx.theme().muted_foreground)
.child(SharedString::from("From:")),
)
@@ -754,20 +753,16 @@ impl DeviceRegistry {
.h_8()
.w_full()
.px_2()
.rounded(px(control_radius()))
.rounded(cx.theme().radius)
.bg(cx.theme().muted)
.child(
h_flex()
.gap(px(ui::SPACE))
.child(match profile.avatar() {
Some(picture) => Avatar::new()
.src(picture)
.xsmall()
.into_any_element(),
None => Avatar::new()
.xsmall()
.into_any_element(),
})
.gap_2()
.child(
Avatar::new(profile.avatar())
.seed(profile.avatar_seed())
.xsmall(),
)
.child(profile.name()),
),
),
@@ -775,11 +770,11 @@ impl DeviceRegistry {
.child(
v_flex()
.gap_1()
.text_style(TextStyle::Callout)
.text_xs()
.child(
div()
.font_weight(gpui::FontWeight::SEMIBOLD)
.text_style(TextStyle::Caption)
.text_xs()
.text_color(cx.theme().muted_foreground)
.child(SharedString::from("Code:")),
)
@@ -788,7 +783,7 @@ impl DeviceRegistry {
.h_8()
.w_full()
.px_2()
.rounded(px(control_radius()))
.rounded(cx.theme().radius)
.bg(cx.theme().muted)
.child(code_label.clone()),
),