From 249e44d5233ccb59555d10378e6a2aa4271c953a Mon Sep 17 00:00:00 2001 From: Ren Amamiya Date: Tue, 10 Mar 2026 15:04:09 +0700 Subject: [PATCH] . --- crates/coop/src/workspace.rs | 11 ++--------- crates/device/src/lib.rs | 9 +++++++-- crates/relay_auth/src/lib.rs | 12 ++++++++---- crates/ui/src/notification.rs | 14 ++++++++------ 4 files changed, 25 insertions(+), 21 deletions(-) diff --git a/crates/coop/src/workspace.rs b/crates/coop/src/workspace.rs index c663669..e830e45 100644 --- a/crates/coop/src/workspace.rs +++ b/crates/coop/src/workspace.rs @@ -113,7 +113,7 @@ impl Workspace { let note = Notification::new() .id::() .message("Connecting to the bootstrap relay...") - .title("Relays") + .with_kind(NotificationKind::Info) .icon(IconName::Relay); window.push_notification(note, cx); @@ -122,7 +122,6 @@ impl Workspace { let note = Notification::new() .id::() .message("Connected to the bootstrap relay") - .title("Relays") .with_kind(NotificationKind::Success) .icon(IconName::Relay); @@ -555,13 +554,7 @@ impl Workspace { .id::() .icon(IconName::Relay) .title("Gossip Relays are required") - .content(move |_this, _window, cx| { - v_flex() - .text_sm() - .text_color(cx.theme().text_muted) - .child(SharedString::from(BODY)) - .into_any_element() - }) + .message(BODY) .action(move |_this, _window, _cx| { let entity = entity.clone(); let public_key = public_key.to_owned(); diff --git a/crates/device/src/lib.rs b/crates/device/src/lib.rs index f98f92f..22b41ca 100644 --- a/crates/device/src/lib.rs +++ b/crates/device/src/lib.rs @@ -6,7 +6,7 @@ use std::time::Duration; use anyhow::{Context as AnyhowContext, Error, anyhow}; use gpui::{ App, AppContext, Context, Entity, EventEmitter, Global, IntoElement, ParentElement, - SharedString, Styled, Task, Window, div, + SharedString, Styled, Task, Window, div, relative, }; use nostr_sdk::prelude::*; use person::PersonRegistry; @@ -641,7 +641,12 @@ impl DeviceRegistry { v_flex() .gap_2() .text_sm() - .child(SharedString::from(MSG)) + .child( + div() + .text_sm() + .line_height(relative(1.25)) + .child(SharedString::from(MSG)), + ) .child( v_flex() .gap_2() diff --git a/crates/relay_auth/src/lib.rs b/crates/relay_auth/src/lib.rs index a6249ef..b14e8e5 100644 --- a/crates/relay_auth/src/lib.rs +++ b/crates/relay_auth/src/lib.rs @@ -8,7 +8,7 @@ use std::sync::Arc; use anyhow::{Context as AnyhowContext, Error, anyhow}; use gpui::{ App, AppContext, Context, Entity, Global, IntoElement, ParentElement, SharedString, Styled, - Task, Window, + Task, Window, div, relative, }; use nostr_sdk::prelude::*; use settings::{AppSettings, AuthMode}; @@ -284,7 +284,7 @@ impl RelayAuth { window.push_notification( Notification::success(format!( - "{} has been authenticated", + "Relay {} has been authenticated", url.domain().unwrap_or_default() )), cx, @@ -332,8 +332,12 @@ impl RelayAuth { .content(move |_this, _window, cx| { v_flex() .gap_2() - .text_sm() - .child(SharedString::from(AUTH_MESSAGE)) + .child( + div() + .text_sm() + .line_height(relative(1.25)) + .child(SharedString::from(AUTH_MESSAGE)), + ) .child( v_flex() .py_1() diff --git a/crates/ui/src/notification.rs b/crates/ui/src/notification.rs index 0dfcb89..eb6b155 100644 --- a/crates/ui/src/notification.rs +++ b/crates/ui/src/notification.rs @@ -8,7 +8,7 @@ use gpui::{ Animation, AnimationExt, AnyElement, App, AppContext, ClickEvent, Context, DismissEvent, ElementId, Entity, EventEmitter, InteractiveElement as _, IntoElement, ParentElement as _, Render, SharedString, StatefulInteractiveElement, StyleRefinement, Styled, Subscription, - Window, div, px, + Window, div, px, relative, }; use theme::{ActiveTheme, Anchor}; @@ -332,7 +332,7 @@ impl Render for Notification { .items_start() .refine_style(&self.style) .when_some(icon, |this, icon| { - this.child(div().flex_shrink_0().pt(px(3.)).child(icon)) + this.child(div().flex_shrink_0().child(icon)) }) .child( v_flex() @@ -342,7 +342,7 @@ impl Render for Notification { this.child(div().text_sm().font_semibold().child(title)) }) .when_some(self.message.clone(), |this, message| { - this.child(div().text_sm().child(message)) + this.child(div().text_sm().line_height(relative(1.25)).child(message)) }) .when_some(content, |this, content| this.child(content)) .when_some(action, |this, action| { @@ -352,8 +352,8 @@ impl Render for Notification { .child( div() .absolute() - .top_2p5() - .right_2p5() + .top_2() + .right_2() .invisible() .group_hover("", |this| this.visible()) .child( @@ -361,7 +361,9 @@ impl Render for Notification { .icon(IconName::Close) .ghost() .xsmall() - .on_click(cx.listener(|this, _, window, cx| this.dismiss(window, cx))), + .on_click(cx.listener(move |this, _ev, window, cx| { + this.dismiss(window, cx); + })), ), ) .when_some(self.on_click.clone(), |this, on_click| {