This commit is contained in:
2026-11-11 18:46:45 +07:00
parent 2f9559228f
commit 9a7afbe3e2
26 changed files with 212 additions and 193 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ use nip29::{GroupReference, GroupsRegistry};
type SubmitFn = Rc<dyn Fn(&ClickEvent, &mut Window, &mut App) -> bool>;
pub fn open(window: &mut Window, cx: &mut App) {
let input = cx.new(|cx| InputState::new(window, cx).placeholder("naddr1…"));
let input = cx.new(|cx| InputState::new(window, cx).placeholder("naddr1"));
let join: SubmitFn = {
let input = input.clone();
+2 -2
View File
@@ -3,7 +3,7 @@ use gpui::prelude::FluentBuilder;
use gpui::{
AnyElement, App, AppContext, Context, Div, Entity, InteractiveElement as _, IntoElement,
ParentElement, Render, SharedString, StatefulInteractiveElement as _, StyleRefinement, Styled,
Subscription, Task, WeakEntity, Window, div, px,
Subscription, Task, WeakEntity, Window, div, px, rems,
};
use gpui_kit::base::StyledExt as _;
use gpui_kit::component::button::{Button, ButtonVariants};
@@ -491,7 +491,7 @@ impl Render for NewGroup {
.child(
v_flex()
.id("group-dialog-content")
.h(px(500.))
.h(rems(31.25))
.gap_3()
.when_some(self.error.clone(), |this, error| {
this.child(self.render_error(&error, web_url.as_deref(), cx))
+3 -3
View File
@@ -72,7 +72,7 @@ impl ProfileDialog {
let bio_input = cx.new(|cx| {
TextareaState::new(window, cx)
.auto_grow(3, 8)
.placeholder("A short introduce about you.")
.placeholder("A short introduction about you")
});
let directory = Directory::new(cx);
@@ -438,7 +438,7 @@ impl Render for ProfileDialog {
Button::new("update")
.icon(IconName::SquarePen)
.label("Update")
.primary()
.outline()
.on_click(cx.listener(move |this, _ev, window, cx| {
this.toggle_edit(window, cx);
})),
@@ -449,7 +449,7 @@ impl Render for ProfileDialog {
Button::new("message")
.icon(IconName::MessageSquare)
.label("Message")
.primary()
.outline()
.on_click(cx.listener(move |this, _ev, window, cx| {
this.message(window, cx);
})),
+5 -5
View File
@@ -352,7 +352,7 @@ impl GossipRelays {
let metadata = self.metadata;
if !value.starts_with("ws") {
self.set_error("Relay URl is invalid", window, cx);
self.set_error("Relay URL is invalid", window, cx);
return;
}
@@ -364,7 +364,7 @@ impl GossipRelays {
cx.notify();
}
} else {
self.set_error("Relay URl is invalid", window, cx);
self.set_error("Relay URL is invalid", window, cx);
}
}
@@ -496,7 +496,7 @@ impl InboxRelays {
let value = self.input.read(cx).value().to_string();
if !value.starts_with("ws") {
self.set_error("Relay URl is invalid", window, cx);
self.set_error("Relay URL is invalid", window, cx);
return;
}
@@ -508,7 +508,7 @@ impl InboxRelays {
cx.notify();
}
} else {
self.set_error("Relay URl is invalid", window, cx);
self.set_error("Relay URL is invalid", window, cx);
}
}
@@ -646,7 +646,7 @@ fn relay_row(
.px_2()
.justify_between()
.rounded(cx.theme().radius)
.bg(cx.theme().sidebar)
.bg(cx.theme().secondary)
.context_menu({
let on_remove = on_remove.clone();
+3 -3
View File
@@ -5,7 +5,7 @@ use common::TimestampExt;
use gpui::prelude::FluentBuilder;
use gpui::{
App, AppContext, Context, Div, Entity, IntoElement, ParentElement, Render, SharedString,
Styled, Subscription, Task, Window, div, px, relative, uniform_list,
Styled, Subscription, Task, Window, div, relative, rems, uniform_list,
};
use gpui_kit::assets::IconName;
use gpui_kit::base::StyledExt as _;
@@ -324,7 +324,7 @@ impl Screening {
items
})
.h(px(300.)),
.h(rems(18.75)),
),
)
});
@@ -571,7 +571,7 @@ fn status_badge(status: Option<bool>, cx: &App) -> Div {
if let Some(status) = status {
this.child(Icon::new(IconName::CircleCheck).small().text_color({
if status {
cx.theme().primary
cx.theme().success
} else {
cx.theme().muted_foreground
}
+13 -13
View File
@@ -93,7 +93,7 @@ impl Preferences {
});
#[cfg(not(target_arch = "wasm32"))]
let mint_input = cx.new(|cx| InputState::new(window, cx).placeholder("https://mint…"));
let mint_input = cx.new(|cx| InputState::new(window, cx).placeholder("https://mint"));
let subscriptions = vec![
Self::wire_number_input(&font_size_input, FONT_SIZE_RANGE, cx, |value, cx| {
@@ -446,7 +446,7 @@ impl Preferences {
impl Render for Preferences {
fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
const SCREENING: &str = "Show an screening dialog to verify the unknown sender.";
const SCREENING: &str = "Show a screening dialog to verify the unknown sender.";
const WOT: &str = "Treat people followed by your contacts as known senders.";
const AVATAR: &str = "Hide all avatar pictures to improve performance.";
const APPEARANCE: &str =
@@ -475,7 +475,7 @@ impl Render for Preferences {
let background_label = match &panel_background_path {
Some(path) => path.display().to_string(),
None => String::from("Default Background"),
None => String::from("Default background"),
};
v_flex()
@@ -497,7 +497,7 @@ impl Render for Preferences {
cx,
))
.child(settings_row(
"Web of Trust",
"Web of trust",
WOT,
Switch::new("wot-auto-trust")
.checked(wot_auto_trust)
@@ -536,33 +536,33 @@ impl Render for Preferences {
}),
cx,
))
.child(self.render_theme_choice("theme-light", "Light Theme", LIGHT_THEME, false, cx))
.child(self.render_theme_choice("theme-dark", "Dark Theme", DARK_THEME, true, cx))
.child(self.render_theme_choice("theme-light", "Light theme", LIGHT_THEME, false, cx))
.child(self.render_theme_choice("theme-dark", "Dark theme", DARK_THEME, true, cx))
.child(Separator::horizontal())
.child(
v_flex()
.w_full()
.gap_3()
.child(settings_row(
"Font Size",
"Font size",
FONT_SIZE,
NumberInput::new(&self.font_size_input).w_24(),
cx,
))
.child(settings_row(
"Corner Radius",
"Corner radius",
RADIUS,
NumberInput::new(&self.radius_input).w_24(),
cx,
))
.child(settings_row(
"Large Corner Radius",
"Large corner radius",
RADIUS_LG,
NumberInput::new(&self.radius_lg_input).w_24(),
cx,
))
.child(settings_row(
"Focus Ring",
"Focus ring",
FOCUS_RING,
Switch::new("focus-ring")
.checked(theme.focus_ring)
@@ -624,7 +624,7 @@ impl Render for Preferences {
)
.child(Separator::horizontal())
.child(settings_row(
"Decoupling Encryption Key",
"Decoupling encryption key",
NIP4E,
Switch::new("nip4e")
.checked(nip4e)
@@ -634,7 +634,7 @@ impl Render for Preferences {
cx,
))
.child(settings_row(
"Rotate Encryption Key",
"Rotate encryption key",
NIP4E_ROTATION,
Switch::new("nip4e_rotation")
.checked(nip4e_rotation_days.is_some())
@@ -654,7 +654,7 @@ impl Render for Preferences {
.child(self.render_dictation_shortcut(window, cx))
.child(Separator::horizontal())
.child(settings_block(
"Media Upload Service",
"Media upload service",
MEDIA,
h_flex()
.gap_1()
+1 -1
View File
@@ -678,7 +678,7 @@ impl TabGroupRenderer for CoopTabGroupSkin {
h_flex()
.id("tabs-inner")
.relative()
.gap(px(4.))
.gap_1()
.overflow_x_scroll()
.lock_scroll_axis()
.track_scroll(&self.scroll_handle)
+2 -2
View File
@@ -11,7 +11,7 @@ use chat::{ChatEvent, ChatRegistry};
use common::download_dir;
use gpui::{
Action, App, AppContext, Context, Entity, Focusable, InteractiveElement, IntoElement,
ParentElement, Pixels, Render, SharedString, Styled, Subscription, Task, Window, div, px,
ParentElement, Pixels, Render, SharedString, Styled, Subscription, Task, Window, div, px, rems,
};
use gpui_kit::component::button::{Button, ButtonVariant};
use gpui_kit::component::command::{
@@ -480,7 +480,7 @@ impl Workspace {
.bordered(false)
.rounded(cx.theme().radius_lg)
.placeholder("Search themes...")
.max_h(px(420.))
.max_h(rems(26.25))
.on_confirm(move |index, _, cx| {
if let Some(name) = Self::theme_name_at(index, cx) {
AppSettings::select_theme(&name, cx);
+4 -4
View File
@@ -296,7 +296,7 @@ impl BrowsePanel {
.max_w_64()
.px_1()
.rounded(cx.theme().radius)
.bg(cx.theme().sidebar)
.bg(cx.theme().secondary)
.child(Input::new(&self.input).appearance(false).flex_1())
.child(
Button::new("relay-browse")
@@ -376,7 +376,7 @@ impl BrowsePanel {
.cursor_pointer()
.border_1()
.border_color(transparent_black())
.bg(cx.theme().sidebar)
.bg(cx.theme().group_box)
.hover(|this| {
this.bg(cx.theme().secondary)
.border_color(cx.theme().border)
@@ -510,12 +510,12 @@ impl Render for BrowsePanel {
} else {
let text = if discover {
if self.discovering {
"Discovering groups…"
"Discovering groups"
} else {
"No groups found."
}
} else if self.loading {
"Loading groups…"
"Loading groups"
} else {
"No groups found."
};
+1 -1
View File
@@ -307,7 +307,7 @@ impl ContactListPanel {
.rounded(cx.theme().radius_lg)
.text_xs()
.text_align(TextAlign::Center)
.child(SharedString::from("Please add some relays."))
.child(SharedString::from("No contacts yet"))
}
}
+9 -9
View File
@@ -213,17 +213,17 @@ impl GreeterPanel {
} else {
requests
.iter()
.enumerate()
.map(|(index, (room, preview))| {
.map(|(room, preview)| {
let room = room.clone();
let dock = dock.clone();
let name = room.read(cx).display_name(cx);
let seed = room.read(cx).display_image_seed(cx);
let created_at = room.read(cx).created_at.to_ago();
let id = room.read(cx).id;
let preview = preview.clone();
h_flex()
.id(format!("request-{index}"))
.id(format!("request-{id}"))
.group("")
.w_full()
.h_9()
@@ -280,8 +280,8 @@ impl GreeterPanel {
),
)
.child(
Button::new(format!("response-{index}"))
.label("Response")
Button::new(format!("response-{id}"))
.label("Respond")
.xsmall()
.ghost()
.invisible()
@@ -332,17 +332,17 @@ impl GreeterPanel {
let rows: Vec<AnyElement> = self
.follow_ups
.iter()
.enumerate()
.map(|(index, (room, preview))| {
.map(|(room, preview)| {
let room = room.clone();
let dock = dock.clone();
let name = room.read(cx).display_name(cx);
let seed = room.read(cx).display_image_seed(cx);
let created_at = room.read(cx).created_at.to_ago();
let id = room.read(cx).id;
let preview = preview.clone();
h_flex()
.id(format!("follow-up-{index}"))
.id(format!("follow-up-{id}"))
.group("")
.w_full()
.h_9()
@@ -399,7 +399,7 @@ impl GreeterPanel {
),
)
.child(
Button::new(format!("reply-{index}"))
Button::new(format!("reply-{id}"))
.label("Reply")
.xsmall()
.ghost()
+1 -1
View File
@@ -284,7 +284,7 @@ fn open_logout_dialog(window: &mut Window, cx: &mut App) {
window.open_alert_dialog(cx, |alert, _, _| {
alert
.title("Log Out?")
.title("Log out")
.description(DESCRIPTION)
.button_props(
DialogButtonProps::default()
+2 -2
View File
@@ -51,7 +51,7 @@ pub(crate) fn open_room(
.button_props(
DialogButtonProps::default()
.cancel_text("Ignore")
.ok_text("Response"),
.ok_text("Respond"),
)
.on_cancel(move |_event, window, cx| {
window.dispatch_action(Box::new(ClosePanel), cx);
@@ -200,7 +200,7 @@ impl Sidebar {
h_flex()
.gap_1()
.when(spam, |this| {
this.child(Tag::danger().xsmall().child("SPAM"))
this.child(Tag::danger().xsmall().child("Spam"))
})
.when(!spam, |this| {
this.child(
+1 -1
View File
@@ -309,7 +309,7 @@ impl Sidebar {
public_key: *public_key,
}));
}
None => rows.push(SidebarRow::Empty("Searching...")),
None => rows.push(SidebarRow::Empty("Searching")),
}
}