update ui

This commit is contained in:
2026-07-30 10:47:54 +07:00
parent 480039c6c5
commit 5b60dc1453
7 changed files with 89 additions and 87 deletions

View File

@@ -1,9 +1,9 @@
use std::collections::HashMap;
use instant::Duration;
use anyhow::{Error, anyhow};
use common::config_dir;
use gpui::{App, AppContext, Context, Entity, EventEmitter, Global, Task, Window};
use instant::Duration;
use nostr_connect::prelude::*;
use nostr_gossip_memory::prelude::*;
#[cfg(not(target_arch = "wasm32"))]
@@ -130,8 +130,12 @@ impl NostrRegistry {
// Connect to bootstrap relays after the window is ready
cx.defer_in(window, |this, _window, cx| {
this.connect_bootstrap_relays(cx);
#[cfg(not(target_arch = "wasm32"))]
this.get_user_credential(cx);
if cfg!(target_arch = "wasm32") {
cx.emit(StateEvent::NoSigner);
} else {
this.get_user_credential(cx);
}
});
Self {
@@ -222,7 +226,6 @@ impl NostrRegistry {
}
/// Check the user's credential and set the signer if valid
#[cfg(not(target_arch = "wasm32"))]
fn get_user_credential(&mut self, cx: &mut Context<Self>) {
let user_keyring = cx.read_credentials(USER_KEYRING);
let master_keyring = self.get_master_key(cx);

View File

@@ -34,7 +34,7 @@ pub const CLIENT_SIDE_DECORATION_BORDER: Pixels = px(1.0);
pub const TITLEBAR_HEIGHT: Pixels = px(36.0);
/// Defines workspace tabbar height
pub const TABBAR_HEIGHT: Pixels = px(36.0);
pub const TABBAR_HEIGHT: Pixels = px(44.0);
/// Defines default sidebar width
pub const SIDEBAR_WIDTH: Pixels = px(240.);

View File

@@ -688,6 +688,7 @@ impl TabPanel {
let panel = panel.clone();
move |view, _ev, window, cx| {
view.remove_panel(&panel, window, cx);
view.set_active_ix(ix, window, cx);
}
})),
)

View File

@@ -234,7 +234,8 @@ impl Screening {
}
.to_tag();
let event = EventBuilder::report(vec![tag], "")
let event = EventBuilder::new(Kind::Reporting, "")
.tag(tag)
.finalize_async(&signer)
.await?;

View File

@@ -216,7 +216,7 @@ impl RelayListPanel {
self.set_updating(true, cx);
let task: Task<Result<(), Error>> = cx.background_spawn(async move {
let event = EventBuilder::relay_list(relays)
let event = nip65::RelayList::new(relays)
.finalize_async(&signer)
.await?;

View File

@@ -504,7 +504,7 @@ impl Render for Sidebar {
.size_full()
.gap_2()
.child(
h_flex().px_2().child(
h_flex().px_2().py_1().child(
Input::new(&self.find_input)
.small()
.text_xs()
@@ -530,7 +530,6 @@ impl Render for Sidebar {
Button::new("search-results")
.icon(IconName::Search)
.tooltip("All search results")
.small()
.ghost_alt()
.font_semibold()
.flex_1()
@@ -546,9 +545,8 @@ impl Render for Sidebar {
this.icon(IconName::Inbox)
}
})
.when(!show_find_panel, |this| this.label("Inbox"))
.when(!show_find_panel, |this| this.label("Inbox").small())
.tooltip("All ongoing conversations")
.small()
.ghost_alt()
.font_semibold()
.flex_1()
@@ -568,9 +566,8 @@ impl Render for Sidebar {
this.icon(IconName::Fistbump)
}
})
.when(!show_find_panel, |this| this.label("Requests"))
.when(!show_find_panel, |this| this.label("Requests").small())
.tooltip("Incoming new conversations")
.small()
.ghost_alt()
.font_semibold()
.flex_1()
@@ -657,7 +654,7 @@ impl Render for Sidebar {
.font_semibold()
.text_color(cx.theme().text_muted)
.child(Icon::new(IconName::ChevronDown).small())
.child(SharedString::from("Suggestions")),
.child("Contacts"),
)
.child(
uniform_list(
@@ -698,13 +695,12 @@ impl Render for Sidebar {
.left_0()
.h_9()
.w_full()
.px_2()
.p_4()
.child(
Button::new("create")
.label(button_label)
.primary()
.small()
.shadow_lg()
.shadow_md()
.on_click(cx.listener(move |this, _ev, window, cx| {
this.create_room(window, cx);
})),
@@ -727,9 +723,7 @@ impl Render for Sidebar {
.h_9()
.justify_center()
.bg(cx.theme().background.opacity(0.85))
.border_color(cx.theme().border_disabled)
.border_1()
.when(cx.theme().shadow, |this| this.shadow_xs())
.when(cx.theme().shadow, |this| this.shadow_md())
.rounded_full()
.text_xs()
.font_semibold()