update gpui-native-kit and adopt text roles
Rust / build (macos-latest, stable) (push) Waiting to run
Rust / build (ubuntu-latest, stable) (push) Waiting to run
Rust / build (windows-latest, stable) (push) Waiting to run
Rust / build (macos-latest, stable) (pull_request) Waiting to run
Rust / build (ubuntu-latest, stable) (pull_request) Waiting to run
Rust / build (windows-latest, stable) (pull_request) Waiting to run

This commit is contained in:
2026-11-13 03:53:42 +07:00
parent a27eca45c8
commit bc6e251b6d
35 changed files with 277 additions and 251 deletions
Generated
+9 -9
View File
@@ -2397,7 +2397,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7518b930f6aeb75e871d32ce873c2ae46e35cef19b5a0b039d4337f651d897cd" checksum = "7518b930f6aeb75e871d32ce873c2ae46e35cef19b5a0b039d4337f651d897cd"
dependencies = [ dependencies = [
"bstr", "bstr",
"hashbrown 0.17.1", "hashbrown 0.16.1",
] ]
[[package]] [[package]]
@@ -3059,7 +3059,7 @@ dependencies = [
[[package]] [[package]]
name = "gpui-native-core" name = "gpui-native-core"
version = "0.1.0" version = "0.1.0"
source = "git+https://git.reya.info/reya/gpui-native-kit?rev=6667c812597bd2adf415d29a4e50355bb3bf06ee#6667c812597bd2adf415d29a4e50355bb3bf06ee" source = "git+https://git.reya.info/reya/gpui-native-kit?rev=dad833f998fecc0d828e716f3cbf0342d499db81#dad833f998fecc0d828e716f3cbf0342d499db81"
dependencies = [ dependencies = [
"cpal", "cpal",
"flume 0.12.0", "flume 0.12.0",
@@ -3074,7 +3074,7 @@ dependencies = [
[[package]] [[package]]
name = "gpui-native-data" name = "gpui-native-data"
version = "0.1.0" version = "0.1.0"
source = "git+https://git.reya.info/reya/gpui-native-kit?rev=6667c812597bd2adf415d29a4e50355bb3bf06ee#6667c812597bd2adf415d29a4e50355bb3bf06ee" source = "git+https://git.reya.info/reya/gpui-native-kit?rev=dad833f998fecc0d828e716f3cbf0342d499db81#dad833f998fecc0d828e716f3cbf0342d499db81"
dependencies = [ dependencies = [
"gpui", "gpui",
"gpui-native-core", "gpui-native-core",
@@ -3086,7 +3086,7 @@ dependencies = [
[[package]] [[package]]
name = "gpui-native-editor" name = "gpui-native-editor"
version = "0.1.0" version = "0.1.0"
source = "git+https://git.reya.info/reya/gpui-native-kit?rev=6667c812597bd2adf415d29a4e50355bb3bf06ee#6667c812597bd2adf415d29a4e50355bb3bf06ee" source = "git+https://git.reya.info/reya/gpui-native-kit?rev=dad833f998fecc0d828e716f3cbf0342d499db81#dad833f998fecc0d828e716f3cbf0342d499db81"
dependencies = [ dependencies = [
"gpui", "gpui",
"gpui-native-core", "gpui-native-core",
@@ -3105,7 +3105,7 @@ dependencies = [
[[package]] [[package]]
name = "gpui-native-icons" name = "gpui-native-icons"
version = "0.1.0" version = "0.1.0"
source = "git+https://git.reya.info/reya/gpui-native-kit?rev=6667c812597bd2adf415d29a4e50355bb3bf06ee#6667c812597bd2adf415d29a4e50355bb3bf06ee" source = "git+https://git.reya.info/reya/gpui-native-kit?rev=dad833f998fecc0d828e716f3cbf0342d499db81#dad833f998fecc0d828e716f3cbf0342d499db81"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"gpui", "gpui",
@@ -3114,7 +3114,7 @@ dependencies = [
[[package]] [[package]]
name = "gpui-native-kit" name = "gpui-native-kit"
version = "0.1.0" version = "0.1.0"
source = "git+https://git.reya.info/reya/gpui-native-kit?rev=6667c812597bd2adf415d29a4e50355bb3bf06ee#6667c812597bd2adf415d29a4e50355bb3bf06ee" source = "git+https://git.reya.info/reya/gpui-native-kit?rev=dad833f998fecc0d828e716f3cbf0342d499db81#dad833f998fecc0d828e716f3cbf0342d499db81"
dependencies = [ dependencies = [
"gpui", "gpui",
"gpui-native-core", "gpui-native-core",
@@ -3128,7 +3128,7 @@ dependencies = [
[[package]] [[package]]
name = "gpui-native-layout" name = "gpui-native-layout"
version = "0.1.0" version = "0.1.0"
source = "git+https://git.reya.info/reya/gpui-native-kit?rev=6667c812597bd2adf415d29a4e50355bb3bf06ee#6667c812597bd2adf415d29a4e50355bb3bf06ee" source = "git+https://git.reya.info/reya/gpui-native-kit?rev=dad833f998fecc0d828e716f3cbf0342d499db81#dad833f998fecc0d828e716f3cbf0342d499db81"
dependencies = [ dependencies = [
"gpui", "gpui",
"gpui-native-core", "gpui-native-core",
@@ -3141,7 +3141,7 @@ dependencies = [
[[package]] [[package]]
name = "gpui-native-theme" name = "gpui-native-theme"
version = "0.1.0" version = "0.1.0"
source = "git+https://git.reya.info/reya/gpui-native-kit?rev=6667c812597bd2adf415d29a4e50355bb3bf06ee#6667c812597bd2adf415d29a4e50355bb3bf06ee" source = "git+https://git.reya.info/reya/gpui-native-kit?rev=dad833f998fecc0d828e716f3cbf0342d499db81#dad833f998fecc0d828e716f3cbf0342d499db81"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-channel", "async-channel",
@@ -3162,7 +3162,7 @@ dependencies = [
[[package]] [[package]]
name = "gpui-native-utils" name = "gpui-native-utils"
version = "0.1.0" version = "0.1.0"
source = "git+https://git.reya.info/reya/gpui-native-kit?rev=6667c812597bd2adf415d29a4e50355bb3bf06ee#6667c812597bd2adf415d29a4e50355bb3bf06ee" source = "git+https://git.reya.info/reya/gpui-native-kit?rev=dad833f998fecc0d828e716f3cbf0342d499db81#dad833f998fecc0d828e716f3cbf0342d499db81"
dependencies = [ dependencies = [
"gpui", "gpui",
"gpui-native-theme", "gpui-native-theme",
+1 -1
View File
@@ -13,7 +13,7 @@ gpui = { git = "https://github.com/zed-industries/zed", rev = "f8cfc7ed9e57503de
gpui_platform = { git = "https://github.com/zed-industries/zed", rev = "f8cfc7ed9e57503def9479138894f3139f5400cc", features = ["font-kit"] } gpui_platform = { git = "https://github.com/zed-industries/zed", rev = "f8cfc7ed9e57503def9479138894f3139f5400cc", features = ["font-kit"] }
reqwest_client = { git = "https://github.com/zed-industries/zed", rev = "f8cfc7ed9e57503def9479138894f3139f5400cc" } reqwest_client = { git = "https://github.com/zed-industries/zed", rev = "f8cfc7ed9e57503def9479138894f3139f5400cc" }
gpui-native-kit = { git = "https://git.reya.info/reya/gpui-native-kit", rev = "6667c812597bd2adf415d29a4e50355bb3bf06ee", features = ["layout", "editor"] } gpui-native-kit = { git = "https://git.reya.info/reya/gpui-native-kit", rev = "dad833f998fecc0d828e716f3cbf0342d499db81", features = ["layout", "editor"] }
settings = { path = "crates/settings" } settings = { path = "crates/settings" }
signed_app = { path = "crates/signed_app" } signed_app = { path = "crates/signed_app" }
+45 -5
View File
@@ -1,13 +1,16 @@
pub mod helpers; pub mod helpers;
mod placeholder; mod placeholder;
use gpui::prelude::FluentBuilder as _;
use gpui::{ use gpui::{
AppContext as _, Context, Entity, IntoElement, ParentElement as _, Render, Styled as _, AppContext as _, Context, Entity, InteractiveElement as _, IntoElement, ParentElement as _,
Subscription, Window, div, Render, Styled as _, Subscription, Window, div,
}; };
use gpui_native_kit::common::h_flex;
use gpui_native_kit::icons::IconRole; use gpui_native_kit::icons::IconRole;
use gpui_native_kit::layout::dock::{Dock, DockState}; use gpui_native_kit::layout::dock::{Dock, DockState};
use gpui_native_kit::layout::shell::{LayoutState, Shell, SidebarToggles}; use gpui_native_kit::layout::shell::{LayoutState, Shell, SidebarToggles};
use gpui_native_kit::layout::window_controls::{TRAFFIC_LIGHT_PAD, titlebar_strip};
use gpui_native_kit::theme::ActiveTheme as _; use gpui_native_kit::theme::ActiveTheme as _;
use gpui_native_kit::toast::Toast; use gpui_native_kit::toast::Toast;
use helpers::apply_appearance; use helpers::apply_appearance;
@@ -90,9 +93,35 @@ impl AppRoot {
} }
impl Render for AppRoot { impl Render for AppRoot {
fn render(&mut self, _window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement { fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
let theme = cx.theme(); let theme = *cx.theme();
let layout = self.layout.read(cx);
let left_visible = layout.is_left_sidebar_visible();
let sidebar_width = layout.left_sidebar_width();
let titlebar = if left_visible {
self.sidebar.read(cx).render_titlebar(cx)
} else {
None
};
let titlebar = titlebar.map(|row| {
let strip = h_flex()
.id("signed-sidebar-titlebar")
.size_full()
.when(cfg!(target_os = "macos"), |strip| {
strip.pl(TRAFFIC_LIGHT_PAD)
})
.when(cfg!(not(target_os = "macos")), |strip| strip.pl_2())
.pr_2();
titlebar_strip(strip, "signed-sidebar-titlebar-drag", window, cx)
.child(row)
.into_any_element()
});
div() div()
.relative()
.size_full() .size_full()
.font_family(".SystemUIFont") .font_family(".SystemUIFont")
.text_color(theme.colors.foreground) .text_color(theme.colors.foreground)
@@ -102,10 +131,21 @@ impl Render for AppRoot {
.center( .center(
Dock::new("signed-dock", self.dock.clone()) Dock::new("signed-dock", self.dock.clone())
.window_controls(true) .window_controls(true)
.traffic_light_pad(!self.layout.read(cx).is_left_sidebar_visible()) .traffic_light_pad(!left_visible)
.sidebar_toggles(self.layout.clone()), .sidebar_toggles(self.layout.clone()),
), ),
) )
.when_some(titlebar, |root, titlebar| {
root.child(
div()
.absolute()
.top_0()
.left_0()
.w(sidebar_width)
.h(theme.titlebar_height)
.child(titlebar),
)
})
.child(self.dialogs.clone()) .child(self.dialogs.clone())
} }
} }
+6 -7
View File
@@ -8,7 +8,7 @@ use gpui_native_kit::avatar::Avatar;
use gpui_native_kit::common::{Sizable as _, h_flex, v_flex}; use gpui_native_kit::common::{Sizable as _, h_flex, v_flex};
use gpui_native_kit::icons::Icon; use gpui_native_kit::icons::Icon;
use gpui_native_kit::layout::dock::DockState; use gpui_native_kit::layout::dock::DockState;
use gpui_native_kit::theme::ActiveTheme as _; use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
use metadata::ProfileDirectory; use metadata::ProfileDirectory;
use signed_core::Announcement; use signed_core::Announcement;
use signed_state::{RepoListStore, Timestamp}; use signed_state::{RepoListStore, Timestamp};
@@ -121,8 +121,7 @@ pub(super) fn render_card(
.child( .child(
div() div()
.min_w_0() .min_w_0()
.text_sm() .typeset(TextRole::Headline, cx)
.font_weight(gpui::FontWeight::SEMIBOLD)
.whitespace_nowrap() .whitespace_nowrap()
.text_ellipsis() .text_ellipsis()
.child(name), .child(name),
@@ -131,7 +130,7 @@ pub(super) fn render_card(
this.child( this.child(
h_flex() h_flex()
.gap_1() .gap_1()
.text_xs() .typeset(TextRole::Caption, cx)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.whitespace_nowrap() .whitespace_nowrap()
.child( .child(
@@ -147,7 +146,7 @@ pub(super) fn render_card(
div() div()
.h_16() .h_16()
.min_w_0() .min_w_0()
.text_xs() .typeset(TextRole::Caption, cx)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.line_clamp(2) .line_clamp(2)
.child(description), .child(description),
@@ -168,7 +167,7 @@ pub(super) fn render_card(
) )
.child( .child(
div() div()
.text_xs() .typeset(TextRole::Caption, cx)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.whitespace_nowrap() .whitespace_nowrap()
.child(owner_name), .child(owner_name),
@@ -178,7 +177,7 @@ pub(super) fn render_card(
h_flex() h_flex()
.flex_1() .flex_1()
.justify_end() .justify_end()
.text_xs() .typeset(TextRole::Caption, cx)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.whitespace_nowrap() .whitespace_nowrap()
.child(activity), .child(activity),
+10 -21
View File
@@ -14,7 +14,7 @@ use gpui_native_kit::input::{Input, InputState, InputStateEvent};
use gpui_native_kit::layout::dock::{DockState, Panel}; use gpui_native_kit::layout::dock::{DockState, Panel};
use gpui_native_kit::scrollbar::Scrollbar; use gpui_native_kit::scrollbar::Scrollbar;
use gpui_native_kit::segmented::{Segmented, SegmentedOption}; use gpui_native_kit::segmented::{Segmented, SegmentedOption};
use gpui_native_kit::theme::ActiveTheme as _; use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
use helpers::{RepoFilter, render_card}; use helpers::{RepoFilter, render_card};
use metadata::ProfileDirectory; use metadata::ProfileDirectory;
use nostr::prelude::PublicKey; use nostr::prelude::PublicKey;
@@ -107,15 +107,10 @@ impl ExploreView {
.child( .child(
v_flex() v_flex()
.gap_1() .gap_1()
.child(div().typeset(TextRole::Caption2, cx).child("Repositories"))
.child( .child(
div() div()
.font_weight(gpui::FontWeight::SEMIBOLD) .typeset(TextRole::Caption, cx)
.text_xs()
.child("Repositories"),
)
.child(
div()
.text_size(px(10.))
.text_color(muted) .text_color(muted)
.child(SharedString::from(format!("Total: {count}"))), .child(SharedString::from(format!("Total: {count}"))),
), ),
@@ -124,7 +119,7 @@ impl ExploreView {
div().w(px(180.)).child( div().w(px(180.)).child(
Input::new("explore-search", self.search.clone()) Input::new("explore-search", self.search.clone())
.placeholder("Search...") .placeholder("Search...")
.prefix(Icon::named(IconRole::Search).size(px(14.)).color(muted)), .prefix(Icon::named(IconRole::Search).small().color(muted)),
), ),
) )
.child(div().flex_1()) .child(div().flex_1())
@@ -132,17 +127,11 @@ impl ExploreView {
Segmented::new("explore-filter", self.filter) Segmented::new("explore-filter", self.filter)
.options(vec![ .options(vec![
SegmentedOption::new(RepoFilter::All, "All") SegmentedOption::new(RepoFilter::All, "All")
.icon(Icon::named(CustomIconName::Grid).size(px(14.)).color(muted)), .icon(Icon::named(CustomIconName::Grid).small().color(muted)),
SegmentedOption::new(RepoFilter::Popular, "Popular").icon( SegmentedOption::new(RepoFilter::Popular, "Popular")
Icon::named(CustomIconName::Trending) .icon(Icon::named(CustomIconName::Trending).small().color(muted)),
.size(px(14.)) SegmentedOption::new(RepoFilter::Recent, "Recent")
.color(muted), .icon(Icon::named(CustomIconName::Recent).small().color(muted)),
),
SegmentedOption::new(RepoFilter::Recent, "Recent").icon(
Icon::named(CustomIconName::Recent)
.size(px(14.))
.color(muted),
),
]) ])
.on_change(move |filter, _, cx| { .on_change(move |filter, _, cx| {
if let Err(error) = weak.update(cx, |this, cx| { if let Err(error) = weak.update(cx, |this, cx| {
@@ -165,7 +154,7 @@ impl Panel for ExploreView {
fn lead(&self, cx: &App) -> Option<AnyElement> { fn lead(&self, cx: &App) -> Option<AnyElement> {
Some( Some(
Icon::named(CustomIconName::Globe) Icon::named(CustomIconName::Globe)
.size(px(14.)) .small()
.color(cx.theme().colors.muted_foreground) .color(cx.theme().colors.muted_foreground)
.into_any_element(), .into_any_element(),
) )
+2 -2
View File
@@ -4,7 +4,7 @@ use gpui::{
use gpui_native_kit::button::{Button, ButtonVariant}; use gpui_native_kit::button::{Button, ButtonVariant};
use gpui_native_kit::common::v_flex; use gpui_native_kit::common::v_flex;
use gpui_native_kit::dialog::Dialog; use gpui_native_kit::dialog::Dialog;
use gpui_native_kit::theme::ActiveTheme as _; use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
use signed_state::Backend; use signed_state::Backend;
use crate::shared::dialogs::close_global; use crate::shared::dialogs::close_global;
@@ -25,7 +25,7 @@ impl Render for ExitDialog {
v_flex() v_flex()
.child( .child(
div() div()
.text_sm() .typeset(TextRole::Body, cx)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.child( .child(
"You will be signed out on this device and will need to sign in again on the next session.", "You will be signed out on this device and will need to sign in again on the next session.",
+2 -2
View File
@@ -8,7 +8,7 @@ use gpui_native_kit::common::v_flex;
use gpui_native_kit::dialog::Dialog; use gpui_native_kit::dialog::Dialog;
use gpui_native_kit::field::Field; use gpui_native_kit::field::Field;
use gpui_native_kit::input::{Input, InputState, InputStateEvent}; use gpui_native_kit::input::{Input, InputState, InputStateEvent};
use gpui_native_kit::theme::ActiveTheme as _; use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
use signed_state::Backend; use signed_state::Backend;
use crate::shared::dialogs::close_global; use crate::shared::dialogs::close_global;
@@ -157,7 +157,7 @@ impl Render for ImportDialog {
.gap_3() .gap_3()
.child( .child(
div() div()
.text_sm() .typeset(TextRole::Body, cx)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.child(description), .child(description),
) )
+2 -2
View File
@@ -8,7 +8,7 @@ use gpui_native_kit::common::v_flex;
use gpui_native_kit::dialog::Dialog; use gpui_native_kit::dialog::Dialog;
use gpui_native_kit::field::Field; use gpui_native_kit::field::Field;
use gpui_native_kit::input::{Input, InputState}; use gpui_native_kit::input::{Input, InputState};
use gpui_native_kit::theme::ActiveTheme as _; use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
use signed_state::Backend; use signed_state::Backend;
use crate::shared::dialogs::close_global; use crate::shared::dialogs::close_global;
@@ -99,7 +99,7 @@ impl Render for OnboardingDialog {
.gap_3() .gap_3()
.child( .child(
div() div()
.text_sm() .typeset(TextRole::Body, cx)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.child("Set up your Signed identity to get started."), .child("Set up your Signed identity to get started."),
) )
+7 -10
View File
@@ -2,7 +2,7 @@ use assets::CustomIconName;
use gpui::prelude::FluentBuilder as _; use gpui::prelude::FluentBuilder as _;
use gpui::{ use gpui::{
AnyElement, App, AppContext as _, Context, Entity, IntoElement, ParentElement as _, Render, AnyElement, App, AppContext as _, Context, Entity, IntoElement, ParentElement as _, Render,
Styled as _, Subscription, Window, div, Styled as _, Subscription, Window, px,
}; };
use gpui_native_kit::button::Button; use gpui_native_kit::button::Button;
use gpui_native_kit::common::v_flex; use gpui_native_kit::common::v_flex;
@@ -10,7 +10,6 @@ use gpui_native_kit::dialog::Dialog;
use gpui_native_kit::field::Field; use gpui_native_kit::field::Field;
use gpui_native_kit::icons::Icon; use gpui_native_kit::icons::Icon;
use gpui_native_kit::input::{Input, InputState, InputStateEvent}; use gpui_native_kit::input::{Input, InputState, InputStateEvent};
use gpui_native_kit::theme::ActiveTheme as _;
use signed_state::Backend; use signed_state::Backend;
use crate::shared::dialogs::close_global; use crate::shared::dialogs::close_global;
@@ -92,20 +91,18 @@ impl Render for PassphraseDialog {
Dialog::new("passphrase-dialog") Dialog::new("passphrase-dialog")
.open(true) .open(true)
.on_change(|_open, _, _| {}) .on_change(|_open, _, _| {})
.min_width(px(420.))
.title("Unlock your identity") .title("Unlock your identity")
.content(move |_window, cx| { .content(move |_window, cx| {
let progress = state.read(cx); let progress = state.read(cx);
v_flex() v_flex()
.gap_3() .gap_3()
.child( .child(
div() Field::new(
.text_sm() "passphrase-field",
.text_color(cx.theme().colors.muted_foreground) "Enter the passphrase used to encrypt this identity.",
.child("Enter the passphrase used to encrypt this identity."), )
) .child(Input::new("passphrase-input", pass_input.clone())),
.child(
Field::new("passphrase-field", "Passphrase")
.child(Input::new("passphrase-input", pass_input.clone())),
) )
.when_some(error_row(&progress.error, cx), |el, error| el.child(error)) .when_some(error_row(&progress.error, cx), |el, error| el.child(error))
.when_some(push_steps_row(&progress.push_steps, cx), |el, steps| { .when_some(push_steps_row(&progress.push_steps, cx), |el, steps| {
+8 -8
View File
@@ -8,12 +8,12 @@ use gpui_native_kit::avatar::Avatar;
use gpui_native_kit::badge::Badge; use gpui_native_kit::badge::Badge;
use gpui_native_kit::common::{Sizable as _, h_flex, v_flex}; use gpui_native_kit::common::{Sizable as _, h_flex, v_flex};
use gpui_native_kit::icons::Icon; use gpui_native_kit::icons::Icon;
use gpui_native_kit::theme::ActiveTheme as _; use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
use metadata::ProfileDirectory; use metadata::ProfileDirectory;
use nostr::prelude::{Event, Kind, PublicKey}; use nostr::prelude::{Event, Kind, PublicKey};
use utils::relative_time; use utils::relative_time;
pub fn repo_header(id: SharedString, name: SharedString, unread: usize) -> AnyElement { pub fn repo_header(id: SharedString, name: SharedString, unread: usize, cx: &App) -> AnyElement {
h_flex() h_flex()
.h_12() .h_12()
.w_full() .w_full()
@@ -21,7 +21,7 @@ pub fn repo_header(id: SharedString, name: SharedString, unread: usize) -> AnyEl
.child( .child(
div() div()
.min_w_0() .min_w_0()
.text_sm() .typeset(TextRole::Body, cx)
.whitespace_nowrap() .whitespace_nowrap()
.text_ellipsis() .text_ellipsis()
.child(name), .child(name),
@@ -37,7 +37,7 @@ pub fn empty_section_row(cx: &App) -> AnyElement {
.h_12() .h_12()
.w_full() .w_full()
.px_3() .px_3()
.text_xs() .typeset(TextRole::Caption, cx)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.bg(cx.theme().colors.secondary) .bg(cx.theme().colors.secondary)
.rounded(cx.theme().radius.control) .rounded(cx.theme().radius.control)
@@ -79,7 +79,7 @@ pub fn thread(
.child( .child(
h_flex() h_flex()
.gap_2() .gap_2()
.text_sm() .typeset(TextRole::Body, cx)
.child( .child(
h_flex() h_flex()
.size_6() .size_6()
@@ -88,7 +88,7 @@ pub fn thread(
.justify_center() .justify_center()
.child( .child(
Icon::named(CustomIconName::Inbox) Icon::named(CustomIconName::Inbox)
.size(px(14.)) .small()
.color(cx.theme().colors.muted_foreground), .color(cx.theme().colors.muted_foreground),
), ),
) )
@@ -135,7 +135,7 @@ fn sub_activity(
.flex_1() .flex_1()
.min_w_0() .min_w_0()
.gap_1() .gap_1()
.text_xs() .typeset(TextRole::Caption, cx)
.child( .child(
Avatar::new(event.pubkey) Avatar::new(event.pubkey)
.name(name.clone()) .name(name.clone())
@@ -185,7 +185,7 @@ pub fn empty_state(message: &'static str, cx: &App) -> AnyElement {
) )
.child( .child(
div() div()
.text_sm() .typeset(TextRole::Body, cx)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.child(SharedString::from(message)), .child(SharedString::from(message)),
) )
+3 -4
View File
@@ -13,7 +13,7 @@ use gpui_native_kit::common::{h_flex, v_flex};
use gpui_native_kit::icons::{Icon, IconRole}; use gpui_native_kit::icons::{Icon, IconRole};
use gpui_native_kit::layout::dock::{DockState, Panel}; use gpui_native_kit::layout::dock::{DockState, Panel};
use gpui_native_kit::scroll_area::ScrollArea; use gpui_native_kit::scroll_area::ScrollArea;
use gpui_native_kit::theme::ActiveTheme as _; use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
use metadata::ProfileDirectory; use metadata::ProfileDirectory;
use nostr::prelude::{Event, EventId, Kind, PublicKey, Timestamp}; use nostr::prelude::{Event, EventId, Kind, PublicKey, Timestamp};
use signed_core::{InboxItem, InboxReadState, RepoAddr}; use signed_core::{InboxItem, InboxReadState, RepoAddr};
@@ -351,7 +351,7 @@ impl InboxView {
.map(ToString::to_string) .map(ToString::to_string)
.unwrap_or_default() .unwrap_or_default()
)); ));
repo_header(id, name, section.unread) repo_header(id, name, section.unread, cx)
} }
InboxRow::Entry(section_ix, entry_ix) => { InboxRow::Entry(section_ix, entry_ix) => {
let Some(section) = self.sections.get(section_ix) else { let Some(section) = self.sections.get(section_ix) else {
@@ -425,8 +425,7 @@ impl Render for InboxView {
.gap_2() .gap_2()
.child( .child(
div() div()
.text_sm() .typeset(TextRole::Headline, cx)
.font_weight(gpui::FontWeight::SEMIBOLD)
.child(SharedString::from("Inbox")), .child(SharedString::from("Inbox")),
) )
.child(div().flex_1()) .child(div().flex_1())
+6 -4
View File
@@ -8,7 +8,7 @@ use gpui_native_kit::empty_state::EmptyState;
use gpui_native_kit::input::InputState; use gpui_native_kit::input::InputState;
use gpui_native_kit::layout::dock::Panel; use gpui_native_kit::layout::dock::Panel;
use gpui_native_kit::scroll_area::ScrollArea; use gpui_native_kit::scroll_area::ScrollArea;
use gpui_native_kit::theme::ActiveTheme as _; use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
use metadata::ProfileDirectory; use metadata::ProfileDirectory;
use nostr::prelude::{EventId, PublicKey}; use nostr::prelude::{EventId, PublicKey};
use signed_core::GitEvent; use signed_core::GitEvent;
@@ -157,7 +157,7 @@ impl Render for IssueDetailView {
div() div()
.flex_1() .flex_1()
.min_w_0() .min_w_0()
.font_weight(gpui::FontWeight::SEMIBOLD) .typeset(TextRole::Headline, cx)
.child(title), .child(title),
), ),
) )
@@ -170,7 +170,7 @@ impl Render for IssueDetailView {
.child( .child(
h_flex() h_flex()
.gap_2() .gap_2()
.text_sm() .typeset(TextRole::Body, cx)
.child( .child(
h_flex() h_flex()
.gap_1() .gap_1()
@@ -197,7 +197,9 @@ impl Render for IssueDetailView {
.child(SharedString::from(age)), .child(SharedString::from(age)),
), ),
) )
.child(div().text_sm().child(content)), .child(
div().typeset(TextRole::Body, cx).child(content),
),
) )
.child(comments_section( .child(comments_section(
&self.store, &self.store,
+12 -12
View File
@@ -9,7 +9,7 @@ use gpui_native_kit::button::Button;
use gpui_native_kit::common::{Sizable as _, h_flex, v_flex}; use gpui_native_kit::common::{Sizable as _, h_flex, v_flex};
use gpui_native_kit::icons::Icon; use gpui_native_kit::icons::Icon;
use gpui_native_kit::input::{Input, InputState}; use gpui_native_kit::input::{Input, InputState};
use gpui_native_kit::theme::ActiveTheme as _; use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
use gpui_native_kit::tooltip::Tooltip; use gpui_native_kit::tooltip::Tooltip;
use metadata::ProfileDirectory; use metadata::ProfileDirectory;
use nostr::prelude::{Event, EventId, PublicKey}; use nostr::prelude::{Event, EventId, PublicKey};
@@ -130,7 +130,12 @@ pub(crate) fn sidebar_section(
.picture(profile.picture()) .picture(profile.picture())
.small(), .small(),
) )
.child(div().text_sm().text_ellipsis().child(name)) .child(
div()
.typeset(TextRole::Body, cx)
.text_ellipsis()
.child(name),
)
.into_any_element() .into_any_element()
})), })),
) )
@@ -142,7 +147,7 @@ pub(crate) fn sidebar_section(
if labels.is_empty() { if labels.is_empty() {
this.child( this.child(
div() div()
.text_sm() .typeset(TextRole::Body, cx)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.child("None yet."), .child("None yet."),
) )
@@ -169,12 +174,7 @@ pub(crate) fn comments_section(
v_flex() v_flex()
.gap_4() .gap_4()
.child( .child(div().typeset(TextRole::Caption2, cx).child(title))
div()
.text_xs()
.font_weight(gpui::FontWeight::SEMIBOLD)
.child(title),
)
.children(comments.iter().map(|comment| { .children(comments.iter().map(|comment| {
let profile = directory.read(cx).profile(&comment.pubkey, cx); let profile = directory.read(cx).profile(&comment.pubkey, cx);
let author = profile.name(); let author = profile.name();
@@ -190,7 +190,7 @@ pub(crate) fn comments_section(
.child( .child(
h_flex() h_flex()
.gap_2() .gap_2()
.text_sm() .typeset(TextRole::Body, cx)
.child( .child(
h_flex() h_flex()
.gap_1() .gap_1()
@@ -213,7 +213,7 @@ pub(crate) fn comments_section(
.child(SharedString::from(age)), .child(SharedString::from(age)),
), ),
) )
.child(div().text_sm().child(content)) .child(div().typeset(TextRole::Body, cx).child(content))
})) }))
.into_any_element() .into_any_element()
} }
@@ -242,7 +242,7 @@ pub(crate) fn comment_form(
.child( .child(
h_flex() h_flex()
.gap_1() .gap_1()
.text_xs() .typeset(TextRole::Caption, cx)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.child( .child(
Icon::named(CustomIconName::Markdown) Icon::named(CustomIconName::Markdown)
+3 -3
View File
@@ -13,7 +13,7 @@ use gpui_native_kit::icons::Icon;
use gpui_native_kit::layout::dock::{DockState, Panel}; use gpui_native_kit::layout::dock::{DockState, Panel};
use gpui_native_kit::scrollbar::Scrollbar; use gpui_native_kit::scrollbar::Scrollbar;
use gpui_native_kit::segmented::{Segmented, SegmentedOption}; use gpui_native_kit::segmented::{Segmented, SegmentedOption};
use gpui_native_kit::theme::ActiveTheme as _; use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
use metadata::ProfileDirectory; use metadata::ProfileDirectory;
use nostr::prelude::PublicKey; use nostr::prelude::PublicKey;
use signed_core::GitEvent; use signed_core::GitEvent;
@@ -248,7 +248,7 @@ impl Render for IssuesView {
.gap_1() .gap_1()
.child( .child(
div() div()
.text_sm() .typeset(TextRole::Body, cx)
.text_ellipsis() .text_ellipsis()
.whitespace_nowrap() .whitespace_nowrap()
.child(title), .child(title),
@@ -256,7 +256,7 @@ impl Render for IssuesView {
.child( .child(
h_flex() h_flex()
.gap_2() .gap_2()
.text_xs() .typeset(TextRole::Caption, cx)
.child( .child(
h_flex() h_flex()
.gap_1() .gap_1()
+2 -2
View File
@@ -7,7 +7,7 @@ use gpui_native_kit::common::v_flex;
use gpui_native_kit::dialog::Dialog; use gpui_native_kit::dialog::Dialog;
use gpui_native_kit::field::Field; use gpui_native_kit::field::Field;
use gpui_native_kit::input::{Input, InputState}; use gpui_native_kit::input::{Input, InputState};
use gpui_native_kit::theme::ActiveTheme as _; use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
use signed_state::RepoStore; use signed_state::RepoStore;
use crate::shared::dialogs::{close_global, open_global}; use crate::shared::dialogs::{close_global, open_global};
@@ -63,7 +63,7 @@ impl Render for NewIssueDialog {
.gap_3() .gap_3()
.child( .child(
div() div()
.text_sm() .typeset(TextRole::Body, cx)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.child("Report a bug, ask a question, or propose a change."), .child("Report a bug, ask a question, or propose a change."),
) )
@@ -18,7 +18,7 @@ use gpui_native_kit::layout::dock::{DockState, Panel};
use gpui_native_kit::scroll_area::ScrollArea; use gpui_native_kit::scroll_area::ScrollArea;
use gpui_native_kit::scrollbar::Scrollbar; use gpui_native_kit::scrollbar::Scrollbar;
use gpui_native_kit::spinner::Spinner; use gpui_native_kit::spinner::Spinner;
use gpui_native_kit::theme::ActiveTheme as _; use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
use metadata::ProfileDirectory; use metadata::ProfileDirectory;
use nostr::prelude::{EventId, Kind, PublicKey, Url}; use nostr::prelude::{EventId, Kind, PublicKey, Url};
use signed_core::{GitEvent, PullRequest, RepoAddr}; use signed_core::{GitEvent, PullRequest, RepoAddr};
@@ -388,7 +388,7 @@ impl PullRequestDetailView {
.child( .child(
h_flex() h_flex()
.gap_2() .gap_2()
.text_sm() .typeset(TextRole::Body, cx)
.child( .child(
h_flex() h_flex()
.gap_1() .gap_1()
@@ -408,7 +408,11 @@ impl PullRequestDetailView {
), ),
) )
.when(!self.description.is_empty(), |this| { .when(!self.description.is_empty(), |this| {
this.child(div().text_sm().child(self.description.clone())) this.child(
div()
.typeset(TextRole::Body, cx)
.child(self.description.clone()),
)
}), }),
) )
.child(comments_section(&self.store, root_id, &self.directory, cx)) .child(comments_section(&self.store, root_id, &self.directory, cx))
@@ -534,7 +538,7 @@ impl PullRequestDetailView {
div() div()
.flex_1() .flex_1()
.min_w_0() .min_w_0()
.font_weight(gpui::FontWeight::SEMIBOLD) .typeset(TextRole::Headline, cx)
.text_ellipsis() .text_ellipsis()
.child(title), .child(title),
), ),
@@ -575,7 +579,7 @@ impl PullRequestDetailView {
h_flex() h_flex()
.gap_1() .gap_1()
.font_family(cx.theme().mono_font) .font_family(cx.theme().mono_font)
.text_xs() .typeset(TextRole::Caption, cx)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.child(id.clone()) .child(id.clone())
.child(ClipboardButton::new("pr-commit", &id)), .child(ClipboardButton::new("pr-commit", &id)),
@@ -7,7 +7,7 @@ use gpui_native_kit::common::v_flex;
use gpui_native_kit::dialog::Dialog; use gpui_native_kit::dialog::Dialog;
use gpui_native_kit::field::Field; use gpui_native_kit::field::Field;
use gpui_native_kit::input::{Input, InputState}; use gpui_native_kit::input::{Input, InputState};
use gpui_native_kit::theme::ActiveTheme as _; use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
use nostr::prelude::Event; use nostr::prelude::Event;
use signed_state::RepoStore; use signed_state::RepoStore;
@@ -56,7 +56,7 @@ impl Render for UpdatePrDialog {
.gap_3() .gap_3()
.child( .child(
div() div()
.text_sm() .typeset(TextRole::Body, cx)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.child("Publish a new revision with the output of `git format-patch`."), .child("Publish a new revision with the output of `git format-patch`."),
) )
+3 -3
View File
@@ -14,7 +14,7 @@ use gpui_native_kit::layout::dock::{DockState, Panel};
use gpui_native_kit::menu::MenuItem; use gpui_native_kit::menu::MenuItem;
use gpui_native_kit::scrollbar::Scrollbar; use gpui_native_kit::scrollbar::Scrollbar;
use gpui_native_kit::segmented::{Segmented, SegmentedOption}; use gpui_native_kit::segmented::{Segmented, SegmentedOption};
use gpui_native_kit::theme::ActiveTheme as _; use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
use metadata::ProfileDirectory; use metadata::ProfileDirectory;
use nostr::prelude::{Kind, PublicKey}; use nostr::prelude::{Kind, PublicKey};
use signed_core::GitEvent; use signed_core::GitEvent;
@@ -389,7 +389,7 @@ impl Render for PullRequestsView {
.gap_1() .gap_1()
.child( .child(
div() div()
.text_sm() .typeset(TextRole::Body, cx)
.text_ellipsis() .text_ellipsis()
.whitespace_nowrap() .whitespace_nowrap()
.child(title), .child(title),
@@ -397,7 +397,7 @@ impl Render for PullRequestsView {
.child( .child(
h_flex() h_flex()
.gap_2() .gap_2()
.text_xs() .typeset(TextRole::Caption, cx)
.child( .child(
h_flex() h_flex()
.gap_1() .gap_1()
+7 -8
View File
@@ -17,7 +17,7 @@ use gpui_native_kit::layout::dock::{DockState, Panel};
use gpui_native_kit::menu::Menu; use gpui_native_kit::menu::Menu;
use gpui_native_kit::scrollbar::Scrollbar; use gpui_native_kit::scrollbar::Scrollbar;
use gpui_native_kit::spinner::Spinner; use gpui_native_kit::spinner::Spinner;
use gpui_native_kit::theme::ActiveTheme as _; use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
use metadata::ProfileDirectory; use metadata::ProfileDirectory;
use signed_state::{CheckoutsStore, RepoStore}; use signed_state::{CheckoutsStore, RepoStore};
@@ -301,17 +301,17 @@ impl NewPullRequestView {
.child( .child(
v_flex() v_flex()
.gap_1() .gap_1()
.child(label("Merge Into")) .child(label("Merge Into", cx))
.child(div().w(px(160.)).child(self.base_select.clone())), .child(div().w(px(160.)).child(self.base_select.clone())),
) )
.child( .child(
v_flex() v_flex()
.gap_1() .gap_1()
.child(label("Pull From")) .child(label("Pull From", cx))
.child(div().w(px(160.)).child(self.compare_select.clone())), .child(div().w(px(160.)).child(self.compare_select.clone())),
) )
.child( .child(
v_flex().gap_1().child(label("Source")).child( v_flex().gap_1().child(label("Source", cx)).child(
Menu::new("pr-source") Menu::new("pr-source")
.open(self.source_open) .open(self.source_open)
.on_change(move |open, _, cx| { .on_change(move |open, _, cx| {
@@ -502,7 +502,7 @@ impl Render for NewPullRequestView {
.when_some(self.error.clone(), |this, error| { .when_some(self.error.clone(), |this, error| {
this.child( this.child(
div() div()
.text_xs() .typeset(TextRole::Caption, cx)
.text_color(cx.theme().ramps.destructive.base) .text_color(cx.theme().ramps.destructive.base)
.child(error), .child(error),
) )
@@ -520,10 +520,9 @@ impl Render for NewPullRequestView {
} }
} }
fn label(text: &'static str) -> AnyElement { fn label(text: &'static str, cx: &App) -> AnyElement {
div() div()
.text_xs() .typeset(TextRole::Caption2, cx)
.font_weight(gpui::FontWeight::SEMIBOLD)
.child(text) .child(text)
.into_any_element() .into_any_element()
} }
@@ -9,7 +9,7 @@ use gpui_native_kit::common::{h_flex, v_flex};
use gpui_native_kit::icons::Icon; use gpui_native_kit::icons::Icon;
use gpui_native_kit::input::{Input, InputState}; use gpui_native_kit::input::{Input, InputState};
use gpui_native_kit::layout::dock::{DockState, Panel}; use gpui_native_kit::layout::dock::{DockState, Panel};
use gpui_native_kit::theme::ActiveTheme as _; use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
use metadata::ProfileDirectory; use metadata::ProfileDirectory;
use signed_state::RepoStore; use signed_state::RepoStore;
@@ -163,7 +163,7 @@ impl Render for SendPatchView {
) )
.child( .child(
div() div()
.text_xs() .typeset(TextRole::Caption, cx)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.child( .child(
"You can paste a git diff or a git format-patch patch series here.", "You can paste a git diff or a git format-patch patch series here.",
@@ -177,7 +177,7 @@ impl Render for SendPatchView {
.when_some(self.error.clone(), |this, error| { .when_some(self.error.clone(), |this, error| {
this.child( this.child(
div() div()
.text_xs() .typeset(TextRole::Caption, cx)
.text_color(cx.theme().ramps.destructive.base) .text_color(cx.theme().ramps.destructive.base)
.child(error), .child(error),
) )
+12 -10
View File
@@ -16,7 +16,7 @@ use gpui_native_kit::layout::dock::Panel;
use gpui_native_kit::layout::resizable::{Resizable, ResizableState}; use gpui_native_kit::layout::resizable::{Resizable, ResizableState};
use gpui_native_kit::scrollbar::Scrollbar; use gpui_native_kit::scrollbar::Scrollbar;
use gpui_native_kit::spinner::Spinner; use gpui_native_kit::spinner::Spinner;
use gpui_native_kit::theme::ActiveTheme as _; use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
use metadata::ProfileDirectory; use metadata::ProfileDirectory;
use signed_git::{CommitDiff, DiffStatus, FileCommit, FileDiff, Repo}; use signed_git::{CommitDiff, DiffStatus, FileCommit, FileDiff, Repo};
use signed_state::RepoStore; use signed_state::RepoStore;
@@ -285,8 +285,7 @@ impl DiffPane {
.gap_2() .gap_2()
.child( .child(
div() div()
.text_xs() .typeset(TextRole::Caption2, cx)
.font_weight(gpui::FontWeight::SEMIBOLD)
.text_color(status_color) .text_color(status_color)
.child(status_label), .child(status_label),
) )
@@ -294,8 +293,7 @@ impl DiffPane {
div() div()
.flex_1() .flex_1()
.min_w_0() .min_w_0()
.text_xs() .typeset(TextRole::Caption2, cx)
.font_weight(gpui::FontWeight::SEMIBOLD)
.text_ellipsis() .text_ellipsis()
.whitespace_nowrap() .whitespace_nowrap()
.child(title), .child(title),
@@ -304,7 +302,7 @@ impl DiffPane {
this.child( this.child(
h_flex() h_flex()
.gap_2() .gap_2()
.text_xs() .typeset(TextRole::Caption, cx)
.child( .child(
div() div()
.text_color(cx.theme().ramps.success.base) .text_color(cx.theme().ramps.success.base)
@@ -467,7 +465,7 @@ impl CommitDiffView {
v_flex() v_flex()
.child( .child(
div() div()
.font_weight(gpui::FontWeight::SEMIBOLD) .typeset(TextRole::Headline, cx)
.text_ellipsis() .text_ellipsis()
.whitespace_nowrap() .whitespace_nowrap()
.child(commit.summary.clone()), .child(commit.summary.clone()),
@@ -475,7 +473,7 @@ impl CommitDiffView {
.child( .child(
h_flex() h_flex()
.gap_2() .gap_2()
.text_sm() .typeset(TextRole::Body, cx)
.child(SharedString::from(format!("{} committed", commit.author))) .child(SharedString::from(format!("{} committed", commit.author)))
.child( .child(
h_flex() h_flex()
@@ -492,12 +490,16 @@ impl CommitDiffView {
), ),
) )
.when_some(commit.description.as_ref(), |this, description| { .when_some(commit.description.as_ref(), |this, description| {
this.child(div().text_sm().child(SharedString::from(description))) this.child(
div()
.typeset(TextRole::Body, cx)
.child(SharedString::from(description)),
)
}) })
.child( .child(
h_flex() h_flex()
.gap_2() .gap_2()
.text_xs() .typeset(TextRole::Caption, cx)
.child(Badge::new("commit-files", format!("{files} files changed"))) .child(Badge::new("commit-files", format!("{files} files changed")))
.when(insertions > 0, |this| { .when(insertions > 0, |this| {
this.child( this.child(
+11 -10
View File
@@ -6,7 +6,7 @@ use gpui_native_kit::avatar::Avatar;
use gpui_native_kit::clipboard::ClipboardButton; use gpui_native_kit::clipboard::ClipboardButton;
use gpui_native_kit::common::{Sizable as _, h_flex, v_flex}; use gpui_native_kit::common::{Sizable as _, h_flex, v_flex};
use gpui_native_kit::dialog::Dialog; use gpui_native_kit::dialog::Dialog;
use gpui_native_kit::theme::ActiveTheme as _; use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
use metadata::ProfileDirectory; use metadata::ProfileDirectory;
use nostr::prelude::PublicKey; use nostr::prelude::PublicKey;
use signed_core::Announcement; use signed_core::Announcement;
@@ -66,6 +66,7 @@ fn announcement_rows(
.as_deref() .as_deref()
.map(SharedString::from) .map(SharedString::from)
.unwrap_or_else(|| SharedString::from("-")), .unwrap_or_else(|| SharedString::from("-")),
cx,
), ),
cx, cx,
)); ));
@@ -77,6 +78,7 @@ fn announcement_rows(
.as_deref() .as_deref()
.map(SharedString::from) .map(SharedString::from)
.unwrap_or_else(|| SharedString::from("-")), .unwrap_or_else(|| SharedString::from("-")),
cx,
), ),
cx, cx,
)); ));
@@ -102,13 +104,13 @@ fn announcement_rows(
} }
if let Some(upstream) = &announcement.upstream { if let Some(upstream) = &announcement.upstream {
rows.push(row("Upstream", text(upstream.display()), cx)); rows.push(row("Upstream", text(upstream.display(), cx), cx));
} }
if !announcement.hashtags.is_empty() { if !announcement.hashtags.is_empty() {
rows.push(row( rows.push(row(
"Hashtags", "Hashtags",
text(SharedString::from(announcement.hashtags.join(", "))), text(SharedString::from(announcement.hashtags.join(", ")), cx),
cx, cx,
)); ));
} }
@@ -154,8 +156,7 @@ fn row(label: &'static str, value: AnyElement, cx: &App) -> AnyElement {
.min_w_0() .min_w_0()
.child( .child(
div() div()
.text_xs() .typeset(TextRole::Caption2, cx)
.font_weight(gpui::FontWeight::SEMIBOLD)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.child(label), .child(label),
) )
@@ -163,12 +164,12 @@ fn row(label: &'static str, value: AnyElement, cx: &App) -> AnyElement {
.into_any_element() .into_any_element()
} }
fn text<T>(value: T) -> AnyElement fn text<T>(value: T, cx: &App) -> AnyElement
where where
T: Into<SharedString>, T: Into<SharedString>,
{ {
div() div()
.text_sm() .typeset(TextRole::Body, cx)
.w_full() .w_full()
.min_w_0() .min_w_0()
.child(value.into()) .child(value.into())
@@ -183,7 +184,7 @@ fn copy_value(id: &'static str, value: String, cx: &App) -> AnyElement {
.child( .child(
div() div()
.font_family(cx.theme().mono_font) .font_family(cx.theme().mono_font)
.text_xs() .typeset(TextRole::Caption, cx)
.min_w_0() .min_w_0()
.child(SharedString::from(value.clone())), .child(SharedString::from(value.clone())),
) )
@@ -220,7 +221,7 @@ fn maintainers(
.overflow_hidden() .overflow_hidden()
.whitespace_nowrap() .whitespace_nowrap()
.text_ellipsis() .text_ellipsis()
.text_sm() .typeset(TextRole::Body, cx)
.child(name), .child(name),
) )
.into_any_element() .into_any_element()
@@ -247,7 +248,7 @@ fn list(id: &'static str, items: impl IntoIterator<Item = String>, cx: &App) ->
.min_w_0() .min_w_0()
.whitespace_nowrap() .whitespace_nowrap()
.text_ellipsis() .text_ellipsis()
.text_sm() .typeset(TextRole::Body, cx)
.child(SharedString::from(middle_truncate(&item, 28, 16))), .child(SharedString::from(middle_truncate(&item, 28, 16))),
) )
.child(ClipboardButton::new( .child(ClipboardButton::new(
+2 -2
View File
@@ -12,7 +12,7 @@ use gpui_native_kit::field::Field;
use gpui_native_kit::icons::{Icon, IconRole}; use gpui_native_kit::icons::{Icon, IconRole};
use gpui_native_kit::input::{Input, InputState}; use gpui_native_kit::input::{Input, InputState};
use gpui_native_kit::layout::dock::DockState; use gpui_native_kit::layout::dock::DockState;
use gpui_native_kit::theme::ActiveTheme as _; use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
use gpui_native_kit::tooltip::Tooltip; use gpui_native_kit::tooltip::Tooltip;
use settings::SettingsStore; use settings::SettingsStore;
use signed_state::{Backend, CheckoutsStore}; use signed_state::{Backend, CheckoutsStore};
@@ -166,7 +166,7 @@ impl Render for CreateRepoDialog {
.gap_3() .gap_3()
.child( .child(
div() div()
.text_sm() .typeset(TextRole::Body, cx)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.child("Publish a new repository to your grasp servers."), .child("Publish a new repository to your grasp servers."),
) )
@@ -8,7 +8,7 @@ use gpui_native_kit::common::{h_flex, v_flex};
use gpui_native_kit::icons::{Icon, IconRole}; use gpui_native_kit::icons::{Icon, IconRole};
use gpui_native_kit::input::{Input, InputState}; use gpui_native_kit::input::{Input, InputState};
use gpui_native_kit::switch::Switch; use gpui_native_kit::switch::Switch;
use gpui_native_kit::theme::ActiveTheme as _; use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
use gpui_native_kit::tooltip::Tooltip; use gpui_native_kit::tooltip::Tooltip;
use nostr::prelude::RelayUrl; use nostr::prelude::RelayUrl;
use settings::{DEFAULT_GRASP_SERVERS, GraspServersSettings}; use settings::{DEFAULT_GRASP_SERVERS, GraspServersSettings};
@@ -72,7 +72,7 @@ pub fn grasp_servers_field(
h_flex() h_flex()
.justify_between() .justify_between()
.items_center() .items_center()
.child(div().text_sm().child("Grasp servers")) .child(div().typeset(TextRole::Body, cx).child("Grasp servers"))
.child( .child(
Switch::new("grasp-servers-toggle") Switch::new("grasp-servers-toggle")
.checked(servers_enabled) .checked(servers_enabled)
@@ -88,7 +88,7 @@ pub fn grasp_servers_field(
section section
.child( .child(
div() div()
.text_xs() .typeset(TextRole::Caption, cx)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.child("Where the repository is hosted"), .child("Where the repository is hosted"),
) )
@@ -122,7 +122,7 @@ pub fn grasp_servers_field(
.when(loading_servers, |section| { .when(loading_servers, |section| {
section.child( section.child(
div() div()
.text_xs() .typeset(TextRole::Caption, cx)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.child("Loading your grasp servers..."), .child("Loading your grasp servers..."),
) )
@@ -130,7 +130,7 @@ pub fn grasp_servers_field(
.when_some(error, |section, error| { .when_some(error, |section, error| {
section.child( section.child(
div() div()
.text_xs() .typeset(TextRole::Caption, cx)
.text_color(cx.theme().ramps.destructive.base) .text_color(cx.theme().ramps.destructive.base)
.child(error), .child(error),
) )
@@ -156,7 +156,7 @@ fn render_server_row(
.px_2() .px_2()
.bg(cx.theme().colors.muted) .bg(cx.theme().colors.muted)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.text_sm() .typeset(TextRole::Body, cx)
.rounded(cx.theme().radius.control) .rounded(cx.theme().radius.control)
.child(server_host(relay)), .child(server_host(relay)),
) )
+3 -3
View File
@@ -12,7 +12,7 @@ use gpui_native_kit::field::Field;
use gpui_native_kit::icons::{Icon, IconRole}; use gpui_native_kit::icons::{Icon, IconRole};
use gpui_native_kit::input::{Input, InputState}; use gpui_native_kit::input::{Input, InputState};
use gpui_native_kit::select::{Select, SelectOption}; use gpui_native_kit::select::{Select, SelectOption};
use gpui_native_kit::theme::ActiveTheme as _; use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
use settings::SettingsStore; use settings::SettingsStore;
use signed_core::RepoAddr; use signed_core::RepoAddr;
use signed_git::Repo; use signed_git::Repo;
@@ -181,7 +181,7 @@ impl Render for InitRepoDialog {
.gap_3() .gap_3()
.child( .child(
div() div()
.text_sm() .typeset(TextRole::Body, cx)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.child("Publish this local repository to Nostr."), .child("Publish this local repository to Nostr."),
) )
@@ -204,7 +204,7 @@ impl Render for InitRepoDialog {
.w_full() .w_full()
.px_2() .px_2()
.bg(cx.theme().colors.muted) .bg(cx.theme().colors.muted)
.text_sm() .typeset(TextRole::Body, cx)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.rounded(cx.theme().radius.control) .rounded(cx.theme().radius.control)
.child(folder.clone()), .child(folder.clone()),
+4 -4
View File
@@ -5,7 +5,7 @@ use gpui::{
use gpui_native_kit::button::{Button, ButtonVariant}; use gpui_native_kit::button::{Button, ButtonVariant};
use gpui_native_kit::common::v_flex; use gpui_native_kit::common::v_flex;
use gpui_native_kit::dialog::Dialog; use gpui_native_kit::dialog::Dialog;
use gpui_native_kit::theme::ActiveTheme as _; use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
use signed_state::RepoStore; use signed_state::RepoStore;
use crate::shared::dialogs::{close_global, open_global}; use crate::shared::dialogs::{close_global, open_global};
@@ -40,7 +40,7 @@ impl Render for ResetRemoteDialog {
.gap_2() .gap_2()
.child( .child(
div() div()
.text_sm() .typeset(TextRole::Body, cx)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.child( .child(
"Grasp servers are overwritten to match the local mirror. Refs that do not exist locally are deleted from the servers. This cannot be undone.", "Grasp servers are overwritten to match the local mirror. Refs that do not exist locally are deleted from the servers. This cannot be undone.",
@@ -48,7 +48,7 @@ impl Render for ResetRemoteDialog {
) )
.child(if deleted.is_empty() { .child(if deleted.is_empty() {
div() div()
.text_sm() .typeset(TextRole::Body, cx)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.child("No server refs will be deleted.") .child("No server refs will be deleted.")
.into_any_element() .into_any_element()
@@ -57,7 +57,7 @@ impl Render for ResetRemoteDialog {
.gap_1() .gap_1()
.children(deleted.iter().map(|name| { .children(deleted.iter().map(|name| {
div() div()
.text_sm() .typeset(TextRole::Body, cx)
.font_family(cx.theme().mono_font) .font_family(cx.theme().mono_font)
.child(name.clone()) .child(name.clone())
})) }))
+4 -5
View File
@@ -12,7 +12,7 @@ use gpui_native_kit::data::tree::{Tree, TreeItem};
use gpui_native_kit::editor::code::CodeViewState; use gpui_native_kit::editor::code::CodeViewState;
use gpui_native_kit::editor::markdown::MarkdownViewState; use gpui_native_kit::editor::markdown::MarkdownViewState;
use gpui_native_kit::icons::{Icon, IconRole}; use gpui_native_kit::icons::{Icon, IconRole};
use gpui_native_kit::theme::ActiveTheme as _; use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
use signed_git::{FileCommit, Repo, WorktreeSnapshot}; use signed_git::{FileCommit, Repo, WorktreeSnapshot};
use super::helpers::{code_language, is_markdown_path, preview_spinner, source_hash}; use super::helpers::{code_language, is_markdown_path, preview_spinner, source_hash};
@@ -355,8 +355,7 @@ impl RepoFilesView {
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.child( .child(
div() div()
.text_xs() .typeset(TextRole::Caption2, cx)
.font_weight(gpui::FontWeight::SEMIBOLD)
.text_ellipsis() .text_ellipsis()
.whitespace_nowrap() .whitespace_nowrap()
.child(pane_title), .child(pane_title),
@@ -368,14 +367,14 @@ impl RepoFilesView {
.gap_1() .gap_1()
.child( .child(
div() div()
.text_xs() .typeset(TextRole::Caption, cx)
.font_family(cx.theme().mono_font) .font_family(cx.theme().mono_font)
.child(commit.id.clone()), .child(commit.id.clone()),
) )
.child( .child(
div() div()
.max_w(px(250.)) .max_w(px(250.))
.text_xs() .typeset(TextRole::Caption, cx)
.text_ellipsis() .text_ellipsis()
.whitespace_nowrap() .whitespace_nowrap()
.child(commit.summary.clone()), .child(commit.summary.clone()),
+17 -11
View File
@@ -15,7 +15,7 @@ use gpui_native_kit::dropdown_menu::DropdownMenu;
use gpui_native_kit::icons::{Icon, IconRole}; use gpui_native_kit::icons::{Icon, IconRole};
use gpui_native_kit::menu::MenuItem; use gpui_native_kit::menu::MenuItem;
use gpui_native_kit::popover::Popover; use gpui_native_kit::popover::Popover;
use gpui_native_kit::theme::ActiveTheme as _; use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
use gpui_native_kit::tooltip::Tooltip; use gpui_native_kit::tooltip::Tooltip;
use signed_state::{Backend, Nip34Kind}; use signed_state::{Backend, Nip34Kind};
@@ -211,14 +211,14 @@ impl RepoDetailView {
.child( .child(
h_flex() h_flex()
.gap_2() .gap_2()
.font_weight(gpui::FontWeight::SEMIBOLD) .typeset(TextRole::Headline, cx)
.child(avatar) .child(avatar)
.child(name), .child(name),
) )
.child( .child(
div() div()
.min_w_0() .min_w_0()
.text_sm() .typeset(TextRole::Body, cx)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.line_clamp(2) .line_clamp(2)
.child(description), .child(description),
@@ -231,9 +231,8 @@ impl RepoDetailView {
.gap_1() .gap_1()
.child( .child(
div() div()
.text_xs() .typeset(TextRole::Caption2, cx)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.font_weight(gpui::FontWeight::SEMIBOLD)
.child("Maintainers:"), .child("Maintainers:"),
) )
.child(self.render_maintainers(cx)), .child(self.render_maintainers(cx)),
@@ -458,18 +457,20 @@ impl RepoDetailView {
"Clone with ngit", "Clone with ngit",
"copy-ngit", "copy-ngit",
&ngit_for_popover, &ngit_for_popover,
cx,
)) ))
.child(clone_group( .child(clone_group(
"Clone with nak", "Clone with nak",
"copy-nak", "copy-nak",
&nak_for_popover, &nak_for_popover,
cx,
)) ))
.child( .child(
v_flex() v_flex()
.gap_1() .gap_1()
.child( .child(
div() div()
.text_xs() .typeset(TextRole::Caption, cx)
.text_color( .text_color(
cx.theme().colors.muted_foreground, cx.theme().colors.muted_foreground,
) )
@@ -478,7 +479,7 @@ impl RepoDetailView {
.when(git_for_popover.is_empty(), |this| { .when(git_for_popover.is_empty(), |this| {
this.child( this.child(
div() div()
.text_xs() .typeset(TextRole::Caption, cx)
.child("No git clone urls."), .child("No git clone urls."),
) )
}) })
@@ -572,14 +573,14 @@ impl RepoDetailView {
.child( .child(
h_flex() h_flex()
.gap_2() .gap_2()
.font_weight(gpui::FontWeight::SEMIBOLD) .typeset(TextRole::Headline, cx)
.child(avatar) .child(avatar)
.child(name), .child(name),
) )
.child( .child(
div() div()
.min_w_0() .min_w_0()
.text_sm() .typeset(TextRole::Body, cx)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.child(path), .child(path),
), ),
@@ -651,12 +652,17 @@ impl RepoDetailView {
.picture(owner.picture()) .picture(owner.picture())
.small(), .small(),
) )
.child(div().text_xs().whitespace_nowrap().child(owner_name)), .child(
div()
.typeset(TextRole::Caption, cx)
.whitespace_nowrap()
.child(owner_name),
),
) )
.when(!rest.is_empty(), |this| { .when(!rest.is_empty(), |this| {
this.child( this.child(
div() div()
.text_xs() .typeset(TextRole::Caption, cx)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.child(SharedString::from(format!("+{}", rest.len()))), .child(SharedString::from(format!("+{}", rest.len()))),
) )
+21 -13
View File
@@ -14,7 +14,7 @@ use gpui_native_kit::combobox::ComboboxState;
use gpui_native_kit::common::{Sizable as _, h_flex, v_flex}; use gpui_native_kit::common::{Sizable as _, h_flex, v_flex};
use gpui_native_kit::icons::Icon; use gpui_native_kit::icons::Icon;
use gpui_native_kit::menu::MenuItem; use gpui_native_kit::menu::MenuItem;
use gpui_native_kit::theme::ActiveTheme as _; use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
use metadata::ProfileDirectory; use metadata::ProfileDirectory;
use nostr::nips::nip19::Nip19Coordinate; use nostr::nips::nip19::Nip19Coordinate;
use nostr::prelude::{RelayUrl, ToBech32}; use nostr::prelude::{RelayUrl, ToBech32};
@@ -117,10 +117,19 @@ impl ShareTargets {
} }
} }
pub(super) fn clone_group(label: &str, id: &'static str, command: &SharedString) -> AnyElement { pub(super) fn clone_group(
label: &str,
id: &'static str,
command: &SharedString,
cx: &App,
) -> AnyElement {
v_flex() v_flex()
.gap_1() .gap_1()
.child(div().text_xs().child(SharedString::from(label))) .child(
div()
.typeset(TextRole::Caption, cx)
.child(SharedString::from(label)),
)
.child(ClipboardButton::new(id, command.clone())) .child(ClipboardButton::new(id, command.clone()))
.into_any_element() .into_any_element()
} }
@@ -170,9 +179,9 @@ pub(super) fn fork_row(
let row = h_flex() let row = h_flex()
.gap_1() .gap_1()
.min_w_0() .min_w_0()
.text_sm() .typeset(TextRole::Body, cx)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.child(Icon::named(CustomIconName::GitBranch).size(px(14.))) .child(Icon::named(CustomIconName::GitBranch).small())
.child(div().whitespace_nowrap().text_ellipsis().child(label)); .child(div().whitespace_nowrap().text_ellipsis().child(label));
Some(if clickable { Some(if clickable {
@@ -253,7 +262,7 @@ pub(super) fn bound_repo_label(
h_flex() h_flex()
.flex_shrink_0() .flex_shrink_0()
.gap_2() .gap_2()
.text_sm() .typeset(TextRole::Body, cx)
.child("Initialized by") .child("Initialized by")
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.when_some(profile, |this, profile| { .when_some(profile, |this, profile| {
@@ -274,8 +283,7 @@ pub(super) fn bound_repo_label(
.when_some(binding.identifier.as_deref(), |this, ident| { .when_some(binding.identifier.as_deref(), |this, ident| {
this.child( this.child(
div() div()
.text_xs() .typeset(TextRole::Caption2, cx)
.font_weight(gpui::FontWeight::SEMIBOLD)
.child(SharedString::from(format!("/{ident}"))), .child(SharedString::from(format!("/{ident}"))),
) )
}) })
@@ -361,7 +369,7 @@ pub(super) fn render_diff_row(hunks: &[DiffHunk], row: DiffRow, cx: &App) -> Any
.w_full() .w_full()
.h(px(DIFF_ROW_HEIGHT)) .h(px(DIFF_ROW_HEIGHT))
.font_family(cx.theme().mono_font) .font_family(cx.theme().mono_font)
.text_xs() .typeset(TextRole::Caption, cx)
.bg(cx.theme().colors.muted) .bg(cx.theme().colors.muted)
.border_y_1() .border_y_1()
.border_color(cx.theme().colors.border) .border_color(cx.theme().colors.border)
@@ -387,7 +395,7 @@ fn render_diff_line(line: &DiffLine, cx: &App) -> AnyElement {
.w_full() .w_full()
.h(px(DIFF_ROW_HEIGHT)) .h(px(DIFF_ROW_HEIGHT))
.font_family(cx.theme().mono_font) .font_family(cx.theme().mono_font)
.text_xs() .typeset(TextRole::Caption, cx)
.when_some(bg, |this, bg| this.bg(bg)) .when_some(bg, |this, bg| this.bg(bg))
.child( .child(
div() div()
@@ -447,7 +455,7 @@ pub(crate) fn commit_row(
.child( .child(
div() div()
.font_family(cx.theme().mono_font) .font_family(cx.theme().mono_font)
.text_xs() .typeset(TextRole::Caption, cx)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.child(commit.id.clone()), .child(commit.id.clone()),
) )
@@ -455,7 +463,7 @@ pub(crate) fn commit_row(
div() div()
.flex_1() .flex_1()
.min_w_0() .min_w_0()
.text_sm() .typeset(TextRole::Body, cx)
.text_ellipsis() .text_ellipsis()
.whitespace_nowrap() .whitespace_nowrap()
.child(commit.summary.clone()), .child(commit.summary.clone()),
@@ -464,7 +472,7 @@ pub(crate) fn commit_row(
.child( .child(
h_flex() h_flex()
.gap_2() .gap_2()
.text_xs() .typeset(TextRole::Caption, cx)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.child(commit.author.clone()) .child(commit.author.clone())
.child(relative_time_secs(commit.time)), .child(relative_time_secs(commit.time)),
+2 -2
View File
@@ -10,7 +10,7 @@ use gpui_native_kit::common::v_flex;
use gpui_native_kit::layout::dock::DockState; use gpui_native_kit::layout::dock::DockState;
use gpui_native_kit::scrollbar::Scrollbar; use gpui_native_kit::scrollbar::Scrollbar;
use gpui_native_kit::spinner::Spinner; use gpui_native_kit::spinner::Spinner;
use gpui_native_kit::theme::ActiveTheme as _; use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
use signed_git::{CommitList, Repo}; use signed_git::{CommitList, Repo};
use signed_state::RepoStore; use signed_state::RepoStore;
@@ -190,7 +190,7 @@ impl Render for RepoHistoryView {
div() div()
.py_2() .py_2()
.w_full() .w_full()
.text_xs() .typeset(TextRole::Caption, cx)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.child(format!("Showing {shown} of {total} commits")), .child(format!("Showing {shown} of {total} commits")),
) )
+14 -14
View File
@@ -7,7 +7,7 @@ use gpui::prelude::FluentBuilder as _;
use gpui::{ use gpui::{
AnyElement, App, AppContext as _, Context, Entity, InteractiveElement as _, IntoElement, AnyElement, App, AppContext as _, Context, Entity, InteractiveElement as _, IntoElement,
ParentElement as _, PathPromptOptions, Render, SharedString, Styled as _, Subscription, Task, ParentElement as _, PathPromptOptions, Render, SharedString, Styled as _, Subscription, Task,
WeakEntity, Window, div, px, WeakEntity, Window, div,
}; };
use gpui_native_kit::alert::{Alert, AlertSeverity}; use gpui_native_kit::alert::{Alert, AlertSeverity};
use gpui_native_kit::badge::Badge; use gpui_native_kit::badge::Badge;
@@ -16,7 +16,7 @@ use gpui_native_kit::common::{Sizable as _, h_flex, v_flex};
use gpui_native_kit::icons::{Icon, IconRole}; use gpui_native_kit::icons::{Icon, IconRole};
use gpui_native_kit::layout::dock::{DockState, Panel}; use gpui_native_kit::layout::dock::{DockState, Panel};
use gpui_native_kit::spinner::Spinner; use gpui_native_kit::spinner::Spinner;
use gpui_native_kit::theme::ActiveTheme as _; use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
use metadata::ProfileDirectory; use metadata::ProfileDirectory;
use nostr::prelude::{PublicKey, Url}; use nostr::prelude::{PublicKey, Url};
use signed_core::{Announcement, RepoAddr}; use signed_core::{Announcement, RepoAddr};
@@ -854,7 +854,7 @@ impl RepoDetailView {
.child( .child(
h_flex() h_flex()
.gap_2() .gap_2()
.text_sm() .typeset(TextRole::Body, cx)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.child(Badge::new("ready-branch", status.branch.clone())) .child(Badge::new("ready-branch", status.branch.clone()))
.child(commits) .child(commits)
@@ -939,7 +939,7 @@ impl RepoDetailView {
.child( .child(
h_flex() h_flex()
.gap_2() .gap_2()
.text_sm() .typeset(TextRole::Body, cx)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.child(Badge::new("push-branch", status.branch.clone())) .child(Badge::new("push-branch", status.branch.clone()))
.child(commits) .child(commits)
@@ -1008,7 +1008,7 @@ impl RepoDetailView {
.child( .child(
h_flex() h_flex()
.gap_2() .gap_2()
.text_sm() .typeset(TextRole::Body, cx)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.child(Badge::new("sync-branch", branch)) .child(Badge::new("sync-branch", branch))
.child(commits) .child(commits)
@@ -1059,22 +1059,22 @@ impl RepoDetailView {
match status { match status {
PushStepStatus::Running(_) => h_flex() PushStepStatus::Running(_) => h_flex()
.gap_2() .gap_2()
.text_sm() .typeset(TextRole::Body, cx)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.child(Spinner::new("push-step")) .child(Spinner::new("push-step"))
.child(label) .child(label)
.into_any_element(), .into_any_element(),
PushStepStatus::Done(_) => h_flex() PushStepStatus::Done(_) => h_flex()
.gap_2() .gap_2()
.text_sm() .typeset(TextRole::Body, cx)
.child(Icon::named(IconRole::Check).size(px(14.))) .child(Icon::named(IconRole::Check).small())
.child(label) .child(label)
.into_any_element(), .into_any_element(),
PushStepStatus::Failed(_, reason) => h_flex() PushStepStatus::Failed(_, reason) => h_flex()
.gap_2() .gap_2()
.text_sm() .typeset(TextRole::Body, cx)
.text_color(cx.theme().ramps.destructive.base) .text_color(cx.theme().ramps.destructive.base)
.child(Icon::named(IconRole::Close).size(px(14.))) .child(Icon::named(IconRole::Close).small())
.child(SharedString::from(format!( .child(SharedString::from(format!(
"{}: {reason}", "{}: {reason}",
status.step().label() status.step().label()
@@ -1090,7 +1090,7 @@ impl RepoDetailView {
.gap_1() .gap_1()
.w_full() .w_full()
.bg(cx.theme().colors.muted) .bg(cx.theme().colors.muted)
.child(div().text_sm().child("Pushing")) .child(div().typeset(TextRole::Body, cx).child("Pushing"))
.children(steps) .children(steps)
.into_any_element(), .into_any_element(),
) )
@@ -1115,12 +1115,12 @@ impl RepoDetailView {
.min_w_0() .min_w_0()
.flex_1() .flex_1()
.items_start() .items_start()
.child(Icon::named(IconRole::Warning).size(px(14.))) .child(Icon::named(IconRole::Warning).small())
.child( .child(
div() div()
.flex_1() .flex_1()
.min_w_0() .min_w_0()
.text_sm() .typeset(TextRole::Body, cx)
.text_color(cx.theme().ramps.warning.base) .text_color(cx.theme().ramps.warning.base)
.child(SharedString::from(warning)), .child(SharedString::from(warning)),
), ),
@@ -1174,7 +1174,7 @@ impl RepoDetailView {
.child(Spinner::new("repo-loading")) .child(Spinner::new("repo-loading"))
.child( .child(
div() div()
.text_sm() .typeset(TextRole::Body, cx)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.child(label), .child(label),
) )
+7 -17
View File
@@ -9,7 +9,7 @@ use gpui_native_kit::common::{h_flex, v_flex};
use gpui_native_kit::icons::{Icon, IconRole}; use gpui_native_kit::icons::{Icon, IconRole};
use gpui_native_kit::input::{Input, InputState}; use gpui_native_kit::input::{Input, InputState};
use gpui_native_kit::select::{Select, SelectOption}; use gpui_native_kit::select::{Select, SelectOption};
use gpui_native_kit::theme::ActiveTheme as _; use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
use gpui_native_kit::tooltip::Tooltip; use gpui_native_kit::tooltip::Tooltip;
use settings::{AppearanceMode, EventFetchingStrategy, SettingsStore}; use settings::{AppearanceMode, EventFetchingStrategy, SettingsStore};
@@ -31,15 +31,10 @@ pub fn setting_row(
.flex_1() .flex_1()
.min_w_0() .min_w_0()
.gap_1() .gap_1()
.child(div().typeset(TextRole::Headline, cx).child(title.into()))
.child( .child(
div() div()
.text_sm() .typeset(TextRole::Caption, cx)
.font_weight(gpui::FontWeight::SEMIBOLD)
.child(title.into()),
)
.child(
div()
.text_xs()
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.child(description.into()), .child(description.into()),
), ),
@@ -61,15 +56,10 @@ pub fn setting_block(
.child( .child(
v_flex() v_flex()
.gap_1() .gap_1()
.child(div().typeset(TextRole::Headline, cx).child(title.into()))
.child( .child(
div() div()
.text_sm() .typeset(TextRole::Caption, cx)
.font_weight(gpui::FontWeight::SEMIBOLD)
.child(title.into()),
)
.child(
div()
.text_xs()
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.child(description.into()), .child(description.into()),
), ),
@@ -137,7 +127,7 @@ pub fn grasp_servers_editor(input: &Entity<InputState>, cx: &App) -> AnyElement
.px_2() .px_2()
.bg(cx.theme().colors.muted) .bg(cx.theme().colors.muted)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.text_sm() .typeset(TextRole::Body, cx)
.rounded(cx.theme().radius.control) .rounded(cx.theme().radius.control)
.child(display_server(server)), .child(display_server(server)),
) )
@@ -237,7 +227,7 @@ pub fn scan_paths_editor(cx: &App) -> AnyElement {
.px_2() .px_2()
.bg(cx.theme().colors.muted) .bg(cx.theme().colors.muted)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.text_sm() .typeset(TextRole::Body, cx)
.rounded(cx.theme().radius.control) .rounded(cx.theme().radius.control)
.child(path.display().to_string()), .child(path.display().to_string()),
) )
+8 -8
View File
@@ -1,11 +1,11 @@
use gpui::{ use gpui::{
AnyElement, App, Context, IntoElement as _, ParentElement as _, SharedString, Styled as _, AnyElement, App, Context, IntoElement as _, ParentElement as _, SharedString, Styled as _,
Subscription, div, px, Subscription, div,
}; };
use gpui_native_kit::common::{h_flex, v_flex}; use gpui_native_kit::common::{h_flex, v_flex};
use gpui_native_kit::icons::{Icon, IconRole}; use gpui_native_kit::icons::{Icon, IconRole};
use gpui_native_kit::spinner::Spinner; use gpui_native_kit::spinner::Spinner;
use gpui_native_kit::theme::ActiveTheme as _; use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
use signed_core::RepoAddr; use signed_core::RepoAddr;
use signed_state::{Backend, BackendEvent, PushStepStatus}; use signed_state::{Backend, BackendEvent, PushStepStatus};
@@ -69,7 +69,7 @@ impl DialogProgress {
pub fn error_row(error: &Option<SharedString>, cx: &App) -> Option<AnyElement> { pub fn error_row(error: &Option<SharedString>, cx: &App) -> Option<AnyElement> {
error.as_ref().map(|message| { error.as_ref().map(|message| {
div() div()
.text_sm() .typeset(TextRole::Body, cx)
.text_color(cx.theme().ramps.destructive.base) .text_color(cx.theme().ramps.destructive.base)
.child(message.clone()) .child(message.clone())
.into_any_element() .into_any_element()
@@ -90,29 +90,29 @@ pub fn push_steps_row(steps: &[PushStepStatus], cx: &App) -> Option<AnyElement>
match status { match status {
PushStepStatus::Running(_) => h_flex() PushStepStatus::Running(_) => h_flex()
.gap_2() .gap_2()
.text_sm() .typeset(TextRole::Body, cx)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.child(Spinner::new("push-step")) .child(Spinner::new("push-step"))
.child(label) .child(label)
.into_any_element(), .into_any_element(),
PushStepStatus::Done(_) => h_flex() PushStepStatus::Done(_) => h_flex()
.gap_2() .gap_2()
.text_sm() .typeset(TextRole::Body, cx)
.text_color(cx.theme().colors.foreground) .text_color(cx.theme().colors.foreground)
.child( .child(
Icon::named(IconRole::Check) Icon::named(IconRole::Check)
.size(px(14.)) .small()
.color(cx.theme().colors.foreground), .color(cx.theme().colors.foreground),
) )
.child(label) .child(label)
.into_any_element(), .into_any_element(),
PushStepStatus::Failed(_, reason) => h_flex() PushStepStatus::Failed(_, reason) => h_flex()
.gap_2() .gap_2()
.text_sm() .typeset(TextRole::Body, cx)
.text_color(cx.theme().ramps.destructive.base) .text_color(cx.theme().ramps.destructive.base)
.child( .child(
Icon::named(IconRole::Close) Icon::named(IconRole::Close)
.size(px(14.)) .small()
.color(cx.theme().ramps.destructive.base), .color(cx.theme().ramps.destructive.base),
) )
.child(SharedString::from(format!( .child(SharedString::from(format!(
+2 -3
View File
@@ -7,7 +7,7 @@ use gpui_native_kit::badge::{Badge, BadgeVariant};
use gpui_native_kit::common::Sizable as _; use gpui_native_kit::common::Sizable as _;
use gpui_native_kit::empty_state::EmptyState; use gpui_native_kit::empty_state::EmptyState;
use gpui_native_kit::icons::Icon; use gpui_native_kit::icons::Icon;
use gpui_native_kit::theme::ActiveTheme as _; use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
use gpui_native_kit::tooltip::Tooltip; use gpui_native_kit::tooltip::Tooltip;
use metadata::ProfileDirectory; use metadata::ProfileDirectory;
use signed_core::RepoStatus; use signed_core::RepoStatus;
@@ -90,8 +90,7 @@ pub fn repo_tab_avatar(
/// A one-line muted label used by section headers. /// A one-line muted label used by section headers.
pub fn section_label(text: impl Into<SharedString>, cx: &App) -> AnyElement { pub fn section_label(text: impl Into<SharedString>, cx: &App) -> AnyElement {
div() div()
.text_xs() .typeset(TextRole::Caption2, cx)
.font_weight(gpui::FontWeight::SEMIBOLD)
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.child(text.into()) .child(text.into())
.into_any_element() .into_any_element()
+22 -30
View File
@@ -3,9 +3,8 @@ use std::sync::Arc;
use assets::CustomIconName; use assets::CustomIconName;
use gpui::{ use gpui::{
AnyElement, App, AppContext as _, Context, FontWeight, IntoElement, ObjectFit, AnyElement, App, AppContext as _, Context, IntoElement, ObjectFit, ParentElement as _,
ParentElement as _, SharedString, Styled as _, StyledImage as _, Subscription, WeakEntity, SharedString, Styled as _, StyledImage as _, Subscription, WeakEntity, Window, div, img, px,
Window, div, img, px,
}; };
use gpui_native_kit::avatar::Avatar; use gpui_native_kit::avatar::Avatar;
use gpui_native_kit::badge::{Badge, BadgeVariant}; use gpui_native_kit::badge::{Badge, BadgeVariant};
@@ -27,10 +26,9 @@ use signed_state::{
}; };
use crate::explore::ExploreView; use crate::explore::ExploreView;
use crate::identity;
use crate::inbox::InboxView; use crate::inbox::InboxView;
use crate::repo::dialogs; use crate::repo::dialogs;
use crate::settings; use crate::{identity, settings};
mod helpers; mod helpers;
@@ -218,14 +216,9 @@ impl SidebarView {
pub fn build(&self, cx: &App) -> Sidebar { pub fn build(&self, cx: &App) -> Sidebar {
let backend = Backend::global(cx); let backend = Backend::global(cx);
let profile = backend if backend.read(cx).current_user().is_none() {
.read(cx)
.current_user()
.map(|public_key| self.directory.read(cx).profile(&public_key, cx));
let Some(profile) = profile else {
return Sidebar::new("signed-sidebar").content(self.render_sign_in(cx)); return Sidebar::new("signed-sidebar").content(self.render_sign_in(cx));
}; }
let weak = self.weak.clone(); let weak = self.weak.clone();
let announcements = self.announcements.clone(); let announcements = self.announcements.clone();
@@ -236,23 +229,16 @@ impl SidebarView {
Sidebar::new("signed-sidebar") Sidebar::new("signed-sidebar")
.transparent(true) .transparent(true)
.header(self.render_user(&profile, self.scanning, cx))
.footer(self.render_footer(cx)) .footer(self.render_footer(cx))
.entries(move |_, cx| { .entries(move |_, cx| {
let muted = cx.theme().colors.muted_foreground; let muted = cx.theme().colors.muted_foreground;
let mut entries = vec![ let mut entries = vec![
SidebarEntry::row("inbox", "Inbox").prefix( SidebarEntry::row("inbox", "Inbox")
Icon::named(CustomIconName::Inbox) .prefix(Icon::named(CustomIconName::Inbox).small().color(muted)),
.size(px(14.)) SidebarEntry::row("browse", "Browse")
.color(muted), .prefix(Icon::named(CustomIconName::Globe).small().color(muted)),
),
SidebarEntry::row("browse", "Browse").prefix(
Icon::named(CustomIconName::Globe)
.size(px(14.))
.color(muted),
),
SidebarEntry::row("search", "Search") SidebarEntry::row("search", "Search")
.prefix(Icon::named(IconRole::Search).size(px(14.)).color(muted)), .prefix(Icon::named(IconRole::Search).small().color(muted)),
SidebarEntry::header("All Repositories"), SidebarEntry::header("All Repositories"),
]; ];
@@ -513,6 +499,18 @@ impl SidebarView {
} }
} }
pub fn render_titlebar(&self, cx: &App) -> Option<AnyElement> {
let profile = Backend::global(cx)
.read(cx)
.current_user()
.map(|public_key| self.directory.read(cx).profile(&public_key, cx))?;
Some(
self.render_user(&profile, self.scanning, cx)
.into_any_element(),
)
}
fn render_user(&self, profile: &Profile, scanning: bool, cx: &App) -> impl IntoElement { fn render_user(&self, profile: &Profile, scanning: bool, cx: &App) -> impl IntoElement {
let name = profile.name(); let name = profile.name();
let picture = profile.picture(); let picture = profile.picture();
@@ -547,12 +545,6 @@ impl SidebarView {
.name(name.clone()) .name(name.clone())
.picture(picture.clone()), .picture(picture.clone()),
) )
.child(
div()
.text_xs()
.font_weight(FontWeight::SEMIBOLD)
.child(name.clone()),
)
.child( .child(
Icon::named(IconRole::ChevronDown) Icon::named(IconRole::ChevronDown)
.size(px(12.)) .size(px(12.))