update gpui-native-kit and adopt file icon 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
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:
Generated
+14
-14
@@ -1579,7 +1579,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
|
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"windows-sys 0.61.2",
|
"windows-sys 0.52.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[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=dad833f998fecc0d828e716f3cbf0342d499db81#dad833f998fecc0d828e716f3cbf0342d499db81"
|
source = "git+https://git.reya.info/reya/gpui-native-kit?rev=c3e3c37731e389d858712369e47eec9c205cdfbe#c3e3c37731e389d858712369e47eec9c205cdfbe"
|
||||||
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=dad833f998fecc0d828e716f3cbf0342d499db81#dad833f998fecc0d828e716f3cbf0342d499db81"
|
source = "git+https://git.reya.info/reya/gpui-native-kit?rev=c3e3c37731e389d858712369e47eec9c205cdfbe#c3e3c37731e389d858712369e47eec9c205cdfbe"
|
||||||
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=dad833f998fecc0d828e716f3cbf0342d499db81#dad833f998fecc0d828e716f3cbf0342d499db81"
|
source = "git+https://git.reya.info/reya/gpui-native-kit?rev=c3e3c37731e389d858712369e47eec9c205cdfbe#c3e3c37731e389d858712369e47eec9c205cdfbe"
|
||||||
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=dad833f998fecc0d828e716f3cbf0342d499db81#dad833f998fecc0d828e716f3cbf0342d499db81"
|
source = "git+https://git.reya.info/reya/gpui-native-kit?rev=c3e3c37731e389d858712369e47eec9c205cdfbe#c3e3c37731e389d858712369e47eec9c205cdfbe"
|
||||||
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=dad833f998fecc0d828e716f3cbf0342d499db81#dad833f998fecc0d828e716f3cbf0342d499db81"
|
source = "git+https://git.reya.info/reya/gpui-native-kit?rev=c3e3c37731e389d858712369e47eec9c205cdfbe#c3e3c37731e389d858712369e47eec9c205cdfbe"
|
||||||
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=dad833f998fecc0d828e716f3cbf0342d499db81#dad833f998fecc0d828e716f3cbf0342d499db81"
|
source = "git+https://git.reya.info/reya/gpui-native-kit?rev=c3e3c37731e389d858712369e47eec9c205cdfbe#c3e3c37731e389d858712369e47eec9c205cdfbe"
|
||||||
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=dad833f998fecc0d828e716f3cbf0342d499db81#dad833f998fecc0d828e716f3cbf0342d499db81"
|
source = "git+https://git.reya.info/reya/gpui-native-kit?rev=c3e3c37731e389d858712369e47eec9c205cdfbe#c3e3c37731e389d858712369e47eec9c205cdfbe"
|
||||||
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=dad833f998fecc0d828e716f3cbf0342d499db81#dad833f998fecc0d828e716f3cbf0342d499db81"
|
source = "git+https://git.reya.info/reya/gpui-native-kit?rev=c3e3c37731e389d858712369e47eec9c205cdfbe#c3e3c37731e389d858712369e47eec9c205cdfbe"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"gpui",
|
"gpui",
|
||||||
"gpui-native-theme",
|
"gpui-native-theme",
|
||||||
@@ -5939,7 +5939,7 @@ dependencies = [
|
|||||||
"once_cell",
|
"once_cell",
|
||||||
"socket2",
|
"socket2",
|
||||||
"tracing",
|
"tracing",
|
||||||
"windows-sys 0.61.2",
|
"windows-sys 0.52.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -6437,7 +6437,7 @@ dependencies = [
|
|||||||
"errno",
|
"errno",
|
||||||
"libc",
|
"libc",
|
||||||
"linux-raw-sys",
|
"linux-raw-sys",
|
||||||
"windows-sys 0.61.2",
|
"windows-sys 0.52.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -6505,7 +6505,7 @@ dependencies = [
|
|||||||
"security-framework",
|
"security-framework",
|
||||||
"security-framework-sys",
|
"security-framework-sys",
|
||||||
"webpki-root-certs",
|
"webpki-root-certs",
|
||||||
"windows-sys 0.61.2",
|
"windows-sys 0.52.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -7381,7 +7381,7 @@ dependencies = [
|
|||||||
"getrandom 0.4.3",
|
"getrandom 0.4.3",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"rustix",
|
"rustix",
|
||||||
"windows-sys 0.61.2",
|
"windows-sys 0.52.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -8574,7 +8574,7 @@ version = "0.1.11"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
|
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows-sys 0.61.2",
|
"windows-sys 0.52.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|||||||
+1
-1
@@ -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 = "dad833f998fecc0d828e716f3cbf0342d499db81", features = ["layout", "editor"] }
|
gpui-native-kit = { git = "https://git.reya.info/reya/gpui-native-kit", rev = "c3e3c37731e389d858712369e47eec9c205cdfbe", features = ["layout", "editor"] }
|
||||||
|
|
||||||
settings = { path = "crates/settings" }
|
settings = { path = "crates/settings" }
|
||||||
signed_app = { path = "crates/signed_app" }
|
signed_app = { path = "crates/signed_app" }
|
||||||
|
|||||||
@@ -76,6 +76,22 @@ impl AppRoot {
|
|||||||
apply_appearance(&settings, cx);
|
apply_appearance(&settings, cx);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
subscriptions.push(cx.observe(&dock, |this, dock, cx| {
|
||||||
|
let Some(panel) = dock.read(cx).active_panel() else {
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
|
||||||
|
if !panel.starts_with("repo:") && !panel.starts_with("repo-local:") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.layout.update(cx, |layout, cx| {
|
||||||
|
if !layout.is_right_sidebar_visible() {
|
||||||
|
layout.set_right_sidebar_visible(true, cx);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}));
|
||||||
|
|
||||||
window.defer(cx, move |_window, cx| {
|
window.defer(cx, move |_window, cx| {
|
||||||
if backend.read(cx).passphrase_required() {
|
if backend.read(cx).passphrase_required() {
|
||||||
identity::helpers::open_passphrase(cx);
|
identity::helpers::open_passphrase(cx);
|
||||||
@@ -128,6 +144,7 @@ impl Render for AppRoot {
|
|||||||
.child(
|
.child(
|
||||||
Shell::new("signed-shell", self.layout.clone())
|
Shell::new("signed-shell", self.layout.clone())
|
||||||
.left_sidebar(self.sidebar.read(cx).build(cx))
|
.left_sidebar(self.sidebar.read(cx).build(cx))
|
||||||
|
.right_sidebar(div())
|
||||||
.center(
|
.center(
|
||||||
Dock::new("signed-dock", self.dock.clone())
|
Dock::new("signed-dock", self.dock.clone())
|
||||||
.window_controls(true)
|
.window_controls(true)
|
||||||
|
|||||||
@@ -127,11 +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).small().color(muted)),
|
.icon(Icon::named(IconRole::Grid).small().color(muted)),
|
||||||
SegmentedOption::new(RepoFilter::Popular, "Popular")
|
SegmentedOption::new(RepoFilter::Popular, "Popular")
|
||||||
.icon(Icon::named(CustomIconName::Trending).small().color(muted)),
|
.icon(Icon::named(CustomIconName::Trending).small().color(muted)),
|
||||||
SegmentedOption::new(RepoFilter::Recent, "Recent")
|
SegmentedOption::new(RepoFilter::Recent, "Recent")
|
||||||
.icon(Icon::named(CustomIconName::Recent).small().color(muted)),
|
.icon(Icon::named(IconRole::Clock).small().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| {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
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,
|
||||||
@@ -8,7 +7,7 @@ use gpui_native_kit::button::Button;
|
|||||||
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::field::Field;
|
use gpui_native_kit::field::Field;
|
||||||
use gpui_native_kit::icons::Icon;
|
use gpui_native_kit::icons::{Icon, IconRole};
|
||||||
use gpui_native_kit::input::{Input, InputState, InputStateEvent};
|
use gpui_native_kit::input::{Input, InputState, InputStateEvent};
|
||||||
use signed_state::Backend;
|
use signed_state::Backend;
|
||||||
|
|
||||||
@@ -116,7 +115,7 @@ impl Render for PassphraseDialog {
|
|||||||
|
|
||||||
let unlock: AnyElement = Button::new("unlock")
|
let unlock: AnyElement = Button::new("unlock")
|
||||||
.label("Unlock")
|
.label("Unlock")
|
||||||
.icon(Icon::named(CustomIconName::Unlock))
|
.icon(Icon::named(IconRole::Unlock))
|
||||||
.loading(busy)
|
.loading(busy)
|
||||||
.disabled(busy)
|
.disabled(busy)
|
||||||
.on_click(move |_, _, cx| {
|
.on_click(move |_, _, cx| {
|
||||||
|
|||||||
@@ -341,7 +341,7 @@ impl NewPullRequestView {
|
|||||||
.when_some(refresh_fork, |this, fork| {
|
.when_some(refresh_fork, |this, fork| {
|
||||||
this.child(
|
this.child(
|
||||||
Button::new("refresh-fork")
|
Button::new("refresh-fork")
|
||||||
.icon(Icon::named(CustomIconName::Refresh))
|
.icon(Icon::named(IconRole::Refresh))
|
||||||
.on_click(cx.listener(move |this, _, window, cx| {
|
.on_click(cx.listener(move |this, _, window, cx| {
|
||||||
this.choose_fork(fork.clone(), window, cx);
|
this.choose_fork(fork.clone(), window, cx);
|
||||||
})),
|
})),
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ impl DiffPane {
|
|||||||
if row.expandable {
|
if row.expandable {
|
||||||
item.icon(Icon::named(IconRole::Folder))
|
item.icon(Icon::named(IconRole::Folder))
|
||||||
} else {
|
} else {
|
||||||
item
|
item.icon(Icon::named(IconRole::File))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.collect()
|
.collect()
|
||||||
|
|||||||
@@ -272,7 +272,7 @@ impl RepoFilesView {
|
|||||||
if row.expandable {
|
if row.expandable {
|
||||||
item.icon(Icon::named(IconRole::Folder))
|
item.icon(Icon::named(IconRole::Folder))
|
||||||
} else {
|
} else {
|
||||||
item
|
item.icon(Icon::named(IconRole::File))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.collect()
|
.collect()
|
||||||
|
|||||||
@@ -1019,7 +1019,7 @@ impl RepoDetailView {
|
|||||||
.gap_1()
|
.gap_1()
|
||||||
.child(
|
.child(
|
||||||
Button::new("sync-banner")
|
Button::new("sync-banner")
|
||||||
.icon(Icon::named(CustomIconName::Refresh))
|
.icon(Icon::named(IconRole::Refresh))
|
||||||
.label("Sync now")
|
.label("Sync now")
|
||||||
.small()
|
.small()
|
||||||
.loading(pushing)
|
.loading(pushing)
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ use std::time::{SystemTime, UNIX_EPOCH};
|
|||||||
|
|
||||||
use gpui::{AnyElement, App, IntoElement, SharedString};
|
use gpui::{AnyElement, App, IntoElement, SharedString};
|
||||||
use gpui_native_kit::avatar::Avatar;
|
use gpui_native_kit::avatar::Avatar;
|
||||||
use gpui_native_kit::common::Sizable as _;
|
|
||||||
use metadata::ProfileDirectory;
|
use metadata::ProfileDirectory;
|
||||||
use signed_state::{Nip34Binding, ResolvedLocalRepo};
|
use signed_state::{Nip34Binding, ResolvedLocalRepo};
|
||||||
|
|
||||||
@@ -36,9 +35,7 @@ pub(super) fn local_avatar(
|
|||||||
cx: &App,
|
cx: &App,
|
||||||
) -> AnyElement {
|
) -> AnyElement {
|
||||||
let Some(owner) = entry.nip34.as_ref().and_then(|binding| binding.owner) else {
|
let Some(owner) = entry.nip34.as_ref().and_then(|binding| binding.owner) else {
|
||||||
return Avatar::new(entry.path.to_string_lossy())
|
return Avatar::new(entry.path.to_string_lossy()).into_any_element();
|
||||||
.small()
|
|
||||||
.into_any_element();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let profile = directory.read(cx).profile(&owner, cx);
|
let profile = directory.read(cx).profile(&owner, cx);
|
||||||
@@ -46,6 +43,5 @@ pub(super) fn local_avatar(
|
|||||||
Avatar::new(owner)
|
Avatar::new(owner)
|
||||||
.name(profile.name())
|
.name(profile.name())
|
||||||
.picture(profile.picture())
|
.picture(profile.picture())
|
||||||
.small()
|
|
||||||
.into_any_element()
|
.into_any_element()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ use gpui::{
|
|||||||
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};
|
||||||
use gpui_native_kit::button::{Button, ButtonVariant};
|
use gpui_native_kit::button::{Button, ButtonVariant};
|
||||||
use gpui_native_kit::common::{Sizable as _, h_flex, v_flex};
|
use gpui_native_kit::common::{h_flex, v_flex};
|
||||||
use gpui_native_kit::data::sidebar::{Sidebar, SidebarEntry};
|
use gpui_native_kit::data::sidebar::{Sidebar, SidebarEntry};
|
||||||
use gpui_native_kit::icons::{Icon, IconRole};
|
use gpui_native_kit::icons::{Icon, IconRole};
|
||||||
use gpui_native_kit::layout::dock::DockState;
|
use gpui_native_kit::layout::dock::DockState;
|
||||||
@@ -28,6 +28,7 @@ use signed_state::{
|
|||||||
use crate::explore::ExploreView;
|
use crate::explore::ExploreView;
|
||||||
use crate::inbox::InboxView;
|
use crate::inbox::InboxView;
|
||||||
use crate::repo::dialogs;
|
use crate::repo::dialogs;
|
||||||
|
use crate::shared::log_dropped;
|
||||||
use crate::{identity, settings};
|
use crate::{identity, settings};
|
||||||
|
|
||||||
mod helpers;
|
mod helpers;
|
||||||
@@ -232,55 +233,48 @@ impl SidebarView {
|
|||||||
.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")
|
SidebarEntry::row("inbox", "Inbox")
|
||||||
.prefix(Icon::named(CustomIconName::Inbox).small().color(muted)),
|
.prefix(Icon::named(CustomIconName::Inbox).color(muted)),
|
||||||
SidebarEntry::row("browse", "Browse")
|
SidebarEntry::row("browse", "Browse")
|
||||||
.prefix(Icon::named(CustomIconName::Globe).small().color(muted)),
|
.prefix(Icon::named(CustomIconName::Globe).color(muted)),
|
||||||
SidebarEntry::row("search", "Search")
|
SidebarEntry::row("search", "Search")
|
||||||
.prefix(Icon::named(IconRole::Search).small().color(muted)),
|
.prefix(Icon::named(IconRole::Search).color(muted)),
|
||||||
SidebarEntry::header("All Repositories"),
|
SidebarEntry::header("Repositories"),
|
||||||
];
|
];
|
||||||
|
|
||||||
for announcement in announcements.iter() {
|
for announcement in announcements.iter() {
|
||||||
|
let addr = announcement.addr();
|
||||||
let owner = directory.read(cx).profile(&announcement.owner, cx);
|
let owner = directory.read(cx).profile(&announcement.owner, cx);
|
||||||
|
|
||||||
|
let count = unpushed.get(&addr).copied().unwrap_or(0);
|
||||||
|
let unsynced = sync_directory.read(cx).unsynced(&addr, cx);
|
||||||
|
|
||||||
let name = announcement
|
let name = announcement
|
||||||
.name
|
.name
|
||||||
.as_deref()
|
.as_deref()
|
||||||
.map(SharedString::from)
|
.map(SharedString::from)
|
||||||
.unwrap_or_else(|| SharedString::from(announcement.id.clone()));
|
.unwrap_or_else(|| SharedString::from(announcement.id.clone()));
|
||||||
let addr = announcement.addr();
|
|
||||||
let mut row = SidebarEntry::row(
|
let mut row = SidebarEntry::row(format!("repo:{}", announcement.id), name)
|
||||||
SharedString::from(format!("repo:{}", announcement.id)),
|
|
||||||
name,
|
|
||||||
)
|
|
||||||
.prefix(
|
.prefix(
|
||||||
Avatar::new(announcement.owner)
|
Avatar::new(announcement.owner)
|
||||||
.name(owner.name())
|
.name(owner.name())
|
||||||
.picture(owner.picture())
|
.picture(owner.picture()),
|
||||||
.small(),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
let count = unpushed.get(&addr).copied().unwrap_or(0);
|
|
||||||
let unsynced = sync_directory.read(cx).unsynced(&addr, cx);
|
|
||||||
|
|
||||||
if count > 0 || unsynced > 0 {
|
if count > 0 || unsynced > 0 {
|
||||||
let mut badges = h_flex().gap_1();
|
let mut badges = h_flex().gap_1();
|
||||||
if count > 0 {
|
if count > 0 {
|
||||||
badges = badges.child(
|
badges = badges.child(
|
||||||
Badge::new(
|
Badge::new(format!("unpushed:{addr}"), count.to_string())
|
||||||
SharedString::from(format!("unpushed:{addr}")),
|
.variant(BadgeVariant::Warning),
|
||||||
count.to_string(),
|
|
||||||
)
|
|
||||||
.variant(BadgeVariant::Danger),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if unsynced > 0 {
|
if unsynced > 0 {
|
||||||
badges = badges.child(
|
badges = badges.child(
|
||||||
Badge::new(
|
Badge::new(format!("unsynced:{addr}"), unsynced.to_string())
|
||||||
SharedString::from(format!("unsynced:{addr}")),
|
|
||||||
unsynced.to_string(),
|
|
||||||
)
|
|
||||||
.variant(BadgeVariant::Accent),
|
.variant(BadgeVariant::Accent),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -301,29 +295,17 @@ impl SidebarView {
|
|||||||
Nip34Kind::Cloned => ("Cloned", "Cloned but not initialized"),
|
Nip34Kind::Cloned => ("Cloned", "Cloned but not initialized"),
|
||||||
Nip34Kind::ToolingOnly => ("Tooling", "Grasp tooling only"),
|
Nip34Kind::ToolingOnly => ("Tooling", "Grasp tooling only"),
|
||||||
};
|
};
|
||||||
Badge::new(
|
Badge::new(format!("lbadge:{}", entry.path.display()), label)
|
||||||
SharedString::from(format!("local-badge:{}", entry.path.display())),
|
|
||||||
label,
|
|
||||||
)
|
|
||||||
.tooltip(Tooltip::text(note))
|
.tooltip(Tooltip::text(note))
|
||||||
.into_any_element()
|
.into_any_element()
|
||||||
}
|
}
|
||||||
None => Badge::new(
|
None => Badge::new(format!("un-{}", entry.path.display()), "Unpublished")
|
||||||
SharedString::from(format!(
|
.variant(BadgeVariant::Outline)
|
||||||
"local-unpublished:{}",
|
|
||||||
entry.path.display()
|
|
||||||
)),
|
|
||||||
"Unpublished",
|
|
||||||
)
|
|
||||||
.variant(BadgeVariant::Warning)
|
|
||||||
.into_any_element(),
|
.into_any_element(),
|
||||||
};
|
};
|
||||||
|
|
||||||
entries.push(
|
entries.push(
|
||||||
SidebarEntry::row(
|
SidebarEntry::row(format!("lrepo:{}", entry.path.display()), entry.name())
|
||||||
SharedString::from(format!("local-repo:{}", entry.path.display())),
|
|
||||||
entry.name(),
|
|
||||||
)
|
|
||||||
.prefix(local_avatar(entry, &directory, cx))
|
.prefix(local_avatar(entry, &directory, cx))
|
||||||
.suffix(suffix),
|
.suffix(suffix),
|
||||||
);
|
);
|
||||||
@@ -417,6 +399,7 @@ impl SidebarView {
|
|||||||
let id = SharedString::from(format!("repo-local:{}", path.display()));
|
let id = SharedString::from(format!("repo-local:{}", path.display()));
|
||||||
let dock = self.dock.clone();
|
let dock = self.dock.clone();
|
||||||
let dock_for_build = dock.clone();
|
let dock_for_build = dock.clone();
|
||||||
|
|
||||||
crate::shared::panels::open(
|
crate::shared::panels::open(
|
||||||
&dock,
|
&dock,
|
||||||
id,
|
id,
|
||||||
@@ -438,9 +421,6 @@ impl SidebarView {
|
|||||||
|
|
||||||
fn render_footer(&self, _cx: &App) -> impl IntoElement {
|
fn render_footer(&self, _cx: &App) -> impl IntoElement {
|
||||||
let guide_weak = self.weak.clone();
|
let guide_weak = self.weak.clone();
|
||||||
let settings_click = |_: &gpui::ClickEvent, _: &mut Window, cx: &mut gpui::App| {
|
|
||||||
settings::open(cx);
|
|
||||||
};
|
|
||||||
|
|
||||||
v_flex()
|
v_flex()
|
||||||
.p_2()
|
.p_2()
|
||||||
@@ -448,19 +428,25 @@ impl SidebarView {
|
|||||||
.w_full()
|
.w_full()
|
||||||
.child(
|
.child(
|
||||||
Button::new("guide")
|
Button::new("guide")
|
||||||
|
.icon(IconRole::Info)
|
||||||
.label("Guide")
|
.label("Guide")
|
||||||
|
.side(gpui_native_kit::button::ButtonSide::Left)
|
||||||
.variant(ButtonVariant::Ghost)
|
.variant(ButtonVariant::Ghost)
|
||||||
.on_click(move |_, window, cx| {
|
.on_click(move |_, window, cx| {
|
||||||
crate::shared::log_dropped(guide_weak.update(cx, |this, cx| {
|
log_dropped(guide_weak.update(cx, |this, cx| {
|
||||||
this.open_explore(window, cx);
|
this.open_explore(window, cx);
|
||||||
}));
|
}));
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.child(
|
.child(
|
||||||
Button::new("settings")
|
Button::new("settings")
|
||||||
|
.icon(IconRole::Settings)
|
||||||
.label("Settings")
|
.label("Settings")
|
||||||
|
.side(gpui_native_kit::button::ButtonSide::Left)
|
||||||
.variant(ButtonVariant::Ghost)
|
.variant(ButtonVariant::Ghost)
|
||||||
.on_click(settings_click),
|
.on_click(|_, _, cx| {
|
||||||
|
settings::open(cx);
|
||||||
|
}),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ modifying the kit or reimplementing a parallel mechanism.
|
|||||||
plain text.
|
plain text.
|
||||||
6. **Hunk-only diffs.** Kit `DiffViewState` needs the full old and new texts;
|
6. **Hunk-only diffs.** Kit `DiffViewState` needs the full old and new texts;
|
||||||
`CommitDiff` carries hunks only. The custom hunk rows are retained.
|
`CommitDiff` carries hunks only. The custom hunk rows are retained.
|
||||||
7. **Tree data.** The kit tree is flat with caller-managed expansion, and has no
|
7. **Tree data.** The kit tree is flat with caller-managed expansion.
|
||||||
file glyph; folders use the folder role.
|
Folder rows use `IconRole::Folder` and file rows use `IconRole::File`.
|
||||||
8. **Dynamic dock panels.** `DockState` has no unregister or `open_view` API.
|
8. **Dynamic dock panels.** `DockState` has no unregister or `open_view` API.
|
||||||
Per-repository/per-entity panels register a builder keyed by a unique id and
|
Per-repository/per-entity panels register a builder keyed by a unique id and
|
||||||
stay in the builder map. No dock persistence, zoom, or bottom/right
|
stay in the builder map. No dock persistence, zoom, or bottom/right
|
||||||
@@ -34,6 +34,7 @@ modifying the kit or reimplementing a parallel mechanism.
|
|||||||
into labels.
|
into labels.
|
||||||
12. **Combobox trigger.** `Combobox` has no custom trigger renderer; branch/tag
|
12. **Combobox trigger.** `Combobox` has no custom trigger renderer; branch/tag
|
||||||
selectors lose the leading git icon and custom caret.
|
selectors lose the leading git icon and custom caret.
|
||||||
13. **Icons.** The built-in role set is limited. App-specific glyphs remain in
|
13. **Icons.** The kit provides common platform roles plus Settings, Help,
|
||||||
`assets::CustomIconName` through `IconNamed`; kit icons are unpainted
|
Refresh, File, Folder, and similar glyphs. App-specific git, issue, and
|
||||||
unless given a color.
|
pull-request glyphs remain in `assets::CustomIconName` through `IconNamed`;
|
||||||
|
kit icons are unpainted unless given a color.
|
||||||
|
|||||||
Reference in New Issue
Block a user