update
Rust / build (ubuntu-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) (push) 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 (macos-latest, stable) (pull_request) Waiting to run
Rust / build (ubuntu-latest, stable) (pull_request) Waiting to run
Rust / build (windows-latest, stable) (push) Waiting to run
Rust / build (windows-latest, stable) (pull_request) Waiting to run
Rust / build (macos-latest, stable) (push) Waiting to run
This commit is contained in:
@@ -1,54 +0,0 @@
|
||||
use std::collections::HashSet;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use signed_state::{CheckoutStatus, CheckoutSyncStatus};
|
||||
|
||||
#[derive(Default)]
|
||||
pub(super) struct Banners {
|
||||
dismissed: HashSet<(PathBuf, String)>,
|
||||
sync_dismissed: HashSet<PathBuf>,
|
||||
ready_requested: bool,
|
||||
ready_head: Option<String>,
|
||||
ready_statuses: Vec<CheckoutStatus>,
|
||||
push_statuses: Vec<CheckoutStatus>,
|
||||
}
|
||||
|
||||
impl Banners {
|
||||
pub(super) fn dismissal(&self, status: &CheckoutStatus) -> bool {
|
||||
self.dismissed
|
||||
.contains(&(status.path.clone(), status.branch.clone()))
|
||||
}
|
||||
|
||||
pub(super) fn dismiss(&mut self, status: &CheckoutStatus) {
|
||||
self.dismissed
|
||||
.insert((status.path.clone(), status.branch.clone()));
|
||||
}
|
||||
|
||||
pub(super) fn sync_dismissal(&self, checkout: &CheckoutSyncStatus) -> bool {
|
||||
self.sync_dismissed.contains(&checkout.path)
|
||||
}
|
||||
|
||||
pub(super) fn sync_dismiss(&mut self, checkout: &CheckoutSyncStatus) {
|
||||
self.sync_dismissed.insert(checkout.path.clone());
|
||||
}
|
||||
|
||||
pub(super) fn ready_requested_at(&self) -> (bool, &Option<String>) {
|
||||
(self.ready_requested, &self.ready_head)
|
||||
}
|
||||
|
||||
pub(super) fn mark_ready_requested(&mut self, head: Option<String>) {
|
||||
self.ready_requested = true;
|
||||
self.ready_head = head;
|
||||
}
|
||||
|
||||
pub(super) fn set_statuses(
|
||||
&mut self,
|
||||
ready: Vec<CheckoutStatus>,
|
||||
push: Vec<CheckoutStatus>,
|
||||
) -> bool {
|
||||
let changed = ready != self.ready_statuses || push != self.push_statuses;
|
||||
self.ready_statuses = ready;
|
||||
self.push_statuses = push;
|
||||
changed
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,9 @@ use std::collections::HashSet;
|
||||
use assets::CustomIconName;
|
||||
use gpui::prelude::FluentBuilder as _;
|
||||
use gpui::{
|
||||
AnyElement, AppContext as _, ClipboardItem, Context, IntoElement, ParentElement as _,
|
||||
SharedString, Styled as _, Window, div, px,
|
||||
AnyElement, App, AppContext as _, Context, InteractiveElement as _, IntoElement,
|
||||
ParentElement as _, SharedString, StatefulInteractiveElement as _, Styled as _, Window, div,
|
||||
px,
|
||||
};
|
||||
use gpui_native_kit::avatar::Avatar;
|
||||
use gpui_native_kit::button::{Button, ButtonVariant};
|
||||
@@ -16,14 +17,44 @@ use gpui_native_kit::menu::MenuItem;
|
||||
use gpui_native_kit::popover::Popover;
|
||||
use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use gpui_native_kit::tooltip::Tooltip;
|
||||
use signed_state::{Backend, Nip34Kind};
|
||||
use signed_state::{Backend, CheckoutStatus, CheckoutSyncStatus, CheckoutsStore, Nip34Kind};
|
||||
use utils::relative_time_secs;
|
||||
|
||||
use super::helpers::{
|
||||
ShareTargets, bound_repo_label, clone_group, fork_row, nostr_clone_url, repo_display_name,
|
||||
};
|
||||
use super::helpers::{bound_repo_label, clone_group, fork_row, nostr_clone_url, repo_display_name};
|
||||
use super::{RepoDetailView, actions, dialogs};
|
||||
use crate::pull_requests::NewPullRequestView;
|
||||
|
||||
/// Push and sync bookkeeping for the repository header.
|
||||
#[derive(Default)]
|
||||
pub(super) struct Banners {
|
||||
ready_requested: bool,
|
||||
ready_head: Option<String>,
|
||||
ready_statuses: Vec<CheckoutStatus>,
|
||||
push_statuses: Vec<CheckoutStatus>,
|
||||
}
|
||||
|
||||
impl Banners {
|
||||
pub(super) fn ready_requested_at(&self) -> (bool, &Option<String>) {
|
||||
(self.ready_requested, &self.ready_head)
|
||||
}
|
||||
|
||||
pub(super) fn mark_ready_requested(&mut self, head: Option<String>) {
|
||||
self.ready_requested = true;
|
||||
self.ready_head = head;
|
||||
}
|
||||
|
||||
pub(super) fn set_statuses(
|
||||
&mut self,
|
||||
ready: Vec<CheckoutStatus>,
|
||||
push: Vec<CheckoutStatus>,
|
||||
) -> bool {
|
||||
let changed = ready != self.ready_statuses || push != self.push_statuses;
|
||||
self.ready_statuses = ready;
|
||||
self.push_statuses = push;
|
||||
changed
|
||||
}
|
||||
}
|
||||
|
||||
impl RepoDetailView {
|
||||
pub(super) fn open_upstream(&mut self, window: &mut Window, cx: &mut Context<Self>) {
|
||||
let Some(addr) = self
|
||||
@@ -75,11 +106,12 @@ impl RepoDetailView {
|
||||
);
|
||||
}
|
||||
|
||||
pub(super) fn render_header(&mut self, cx: &mut Context<Self>) -> AnyElement {
|
||||
pub(super) fn render_about(&mut self, cx: &mut Context<Self>) -> AnyElement {
|
||||
if self.store.read(cx).addr().is_none() {
|
||||
return self.render_local_header(cx);
|
||||
}
|
||||
|
||||
let backend = Backend::global(cx);
|
||||
let store = self.store.read(cx);
|
||||
let pushing = store.pushing;
|
||||
let cloning = store.cloning;
|
||||
@@ -97,7 +129,6 @@ impl RepoDetailView {
|
||||
.clone()
|
||||
.filter(|nip05| !nip05.trim().is_empty());
|
||||
|
||||
let share = ShareTargets::from_announcement(&announcement);
|
||||
let nostr_url = nostr_clone_url(&announcement, nip05.as_deref());
|
||||
let ngit_command = SharedString::from(format!("git clone {nostr_url}"));
|
||||
let nak_command = SharedString::from(format!("nak git clone {nostr_url}"));
|
||||
@@ -107,10 +138,7 @@ impl RepoDetailView {
|
||||
let description = announcement.description();
|
||||
let avatar = Avatar::new(format!("{}:{}", announcement.owner, announcement.id));
|
||||
|
||||
let share_naddr = share.naddr.clone();
|
||||
let share_for_menu = share.clone();
|
||||
let announcement_for_menu = announcement.clone();
|
||||
let weak_share = cx.entity().downgrade();
|
||||
let weak_menu_open = cx.entity().downgrade();
|
||||
let weak_menu_items = cx.entity().downgrade();
|
||||
let weak_clone = cx.entity().downgrade();
|
||||
@@ -119,256 +147,206 @@ impl RepoDetailView {
|
||||
let nak_for_popover = nak_command.clone();
|
||||
let git_for_popover = git_commands.clone();
|
||||
|
||||
v_flex()
|
||||
.flex_none()
|
||||
.p_4()
|
||||
h_flex()
|
||||
.p_2()
|
||||
.w_full()
|
||||
.border_b_1()
|
||||
.border_color(cx.theme().colors.border)
|
||||
.gap_6()
|
||||
.items_start()
|
||||
.justify_between()
|
||||
.child(
|
||||
h_flex()
|
||||
.w_full()
|
||||
.gap_6()
|
||||
.items_start()
|
||||
.justify_between()
|
||||
.child(
|
||||
v_flex()
|
||||
.flex_1()
|
||||
.min_w_0()
|
||||
.gap_2()
|
||||
.child(
|
||||
h_flex()
|
||||
.gap_2()
|
||||
.typeset(TextRole::Headline, cx)
|
||||
.child(avatar)
|
||||
.child(name),
|
||||
)
|
||||
.child(
|
||||
div()
|
||||
.min_w_0()
|
||||
.typeset(TextRole::Body, cx)
|
||||
.text_color(cx.theme().colors.muted_foreground)
|
||||
.line_clamp(3)
|
||||
.child(description),
|
||||
)
|
||||
.when_some(fork_row(&announcement, cx), |this, row| this.child(row))
|
||||
.child(h_flex().mt_4().gap_2().child(self.render_maintainers(cx))),
|
||||
)
|
||||
v_flex()
|
||||
.flex_1()
|
||||
.min_w_0()
|
||||
.gap_2()
|
||||
.child(
|
||||
h_flex()
|
||||
.flex_none()
|
||||
.gap_2()
|
||||
.justify_end()
|
||||
.child(
|
||||
DropdownMenu::new("share")
|
||||
.icon(Icon::named(IconRole::Copy))
|
||||
.variant(ButtonVariant::Secondary)
|
||||
.open(self.share_open)
|
||||
.on_click(move |_, _, cx| {
|
||||
cx.write_to_clipboard(ClipboardItem::new_string(
|
||||
share_naddr.clone(),
|
||||
));
|
||||
})
|
||||
.on_open_change(move |open, _, cx| {
|
||||
if let Err(error) = weak_share.update(cx, |this, cx| {
|
||||
this.share_open = open;
|
||||
cx.notify();
|
||||
}) {
|
||||
log::warn!("failed to update share menu: {error}");
|
||||
}
|
||||
})
|
||||
.items(move |_, _| share_for_menu.menu()),
|
||||
)
|
||||
.child(
|
||||
DropdownMenu::new("repo-menu")
|
||||
.icon(Icon::named(CustomIconName::EllipsisVertical))
|
||||
.variant(ButtonVariant::Secondary)
|
||||
.loading(pushing)
|
||||
.disabled(pushing)
|
||||
.open(self.repo_menu_open)
|
||||
.on_open_change(move |open, _, cx| {
|
||||
if let Err(error) = weak_menu_open.update(cx, |this, cx| {
|
||||
this.repo_menu_open = open;
|
||||
cx.notify();
|
||||
}) {
|
||||
log::warn!("failed to update repo menu: {error}");
|
||||
}
|
||||
})
|
||||
.items(move |_, cx| {
|
||||
let owner = Backend::global(cx).read(cx).current_user()
|
||||
== Some(announcement_for_menu.owner);
|
||||
.typeset(TextRole::Headline, cx)
|
||||
.child(avatar)
|
||||
.child(name),
|
||||
)
|
||||
.child(
|
||||
div()
|
||||
.min_w_0()
|
||||
.typeset(TextRole::Body, cx)
|
||||
.text_color(cx.theme().colors.muted_foreground)
|
||||
.line_clamp(3)
|
||||
.child(description),
|
||||
)
|
||||
.when_some(fork_row(&announcement, cx), |this, row| this.child(row)),
|
||||
)
|
||||
.child(
|
||||
h_flex()
|
||||
.flex_none()
|
||||
.gap_2()
|
||||
.justify_end()
|
||||
.child(
|
||||
DropdownMenu::new("repo-menu")
|
||||
.variant(ButtonVariant::Secondary)
|
||||
.loading(pushing)
|
||||
.disabled(pushing)
|
||||
.open(self.repo_menu_open)
|
||||
.on_open_change(move |open, _, cx| {
|
||||
if let Err(error) = weak_menu_open.update(cx, |this, cx| {
|
||||
this.repo_menu_open = open;
|
||||
cx.notify();
|
||||
}) {
|
||||
log::warn!("failed to update repo menu: {error}");
|
||||
}
|
||||
})
|
||||
.items(move |_, cx| {
|
||||
let owner = backend.read(cx).current_user()
|
||||
== Some(announcement_for_menu.owner);
|
||||
|
||||
let mut items = vec![MenuItem::new("About").handler({
|
||||
let mut items = vec![MenuItem::new("About").handler({
|
||||
let weak = weak_menu_items.clone();
|
||||
let announcement = announcement_for_menu.clone();
|
||||
move |_, cx| {
|
||||
if let Err(error) = weak.update(cx, |this, cx| {
|
||||
dialogs::about::open(
|
||||
announcement.clone(),
|
||||
this.directory.clone(),
|
||||
cx,
|
||||
);
|
||||
}) {
|
||||
log::warn!("failed to open about: {error}");
|
||||
}
|
||||
}
|
||||
})];
|
||||
|
||||
if owner {
|
||||
items.push(MenuItem::new("Republish").handler({
|
||||
let weak = weak_menu_items.clone();
|
||||
move |window, cx| {
|
||||
if let Err(error) = weak.update(cx, |this, cx| {
|
||||
this.push_repository(window, cx);
|
||||
}) {
|
||||
log::warn!("failed to republish: {error}");
|
||||
}
|
||||
}
|
||||
}));
|
||||
items.push(MenuItem::new("Reset remote to local").handler({
|
||||
let weak = weak_menu_items.clone();
|
||||
move |window, cx| {
|
||||
if let Err(error) = weak.update(cx, |this, cx| {
|
||||
this.reset_remote(window, cx);
|
||||
}) {
|
||||
log::warn!("failed to reset remote: {error}");
|
||||
}
|
||||
}
|
||||
}));
|
||||
items.push(MenuItem::separator());
|
||||
items.push(MenuItem::new("Delete").destructive(true).handler(
|
||||
{
|
||||
let weak = weak_menu_items.clone();
|
||||
let announcement = announcement_for_menu.clone();
|
||||
move |_, cx| {
|
||||
move |window, cx| {
|
||||
if let Err(error) = weak.update(cx, |this, cx| {
|
||||
dialogs::about::open(
|
||||
announcement.clone(),
|
||||
this.directory.clone(),
|
||||
cx,
|
||||
);
|
||||
this.delete_repository(window, cx);
|
||||
}) {
|
||||
log::warn!("failed to open about: {error}");
|
||||
log::warn!("failed to delete: {error}");
|
||||
}
|
||||
}
|
||||
})];
|
||||
},
|
||||
));
|
||||
}
|
||||
|
||||
if owner {
|
||||
items.push(MenuItem::new("Republish").handler({
|
||||
let weak = weak_menu_items.clone();
|
||||
move |window, cx| {
|
||||
if let Err(error) =
|
||||
weak.update(cx, |this, cx| {
|
||||
this.push_repository(window, cx);
|
||||
})
|
||||
{
|
||||
log::warn!("failed to republish: {error}");
|
||||
}
|
||||
}
|
||||
}));
|
||||
items.push(
|
||||
MenuItem::new("Reset remote to local").handler({
|
||||
let weak = weak_menu_items.clone();
|
||||
move |window, cx| {
|
||||
items
|
||||
}),
|
||||
)
|
||||
.when_some(self.render_sync_button(cx), |this, button| {
|
||||
this.child(button)
|
||||
})
|
||||
.child(
|
||||
Popover::new("clone")
|
||||
.open(self.clone_open)
|
||||
.on_change(move |open, _, cx| {
|
||||
if let Err(error) = weak_clone.update(cx, |this, cx| {
|
||||
this.clone_open = open;
|
||||
cx.notify();
|
||||
}) {
|
||||
log::warn!("failed to update clone popover: {error}");
|
||||
}
|
||||
})
|
||||
.trigger(move |_, _| {
|
||||
Button::new("clone")
|
||||
.label("Clone")
|
||||
.icon(Icon::named(CustomIconName::GitClone))
|
||||
.tooltip(Tooltip::text("Clone repository"))
|
||||
.loading(cloning)
|
||||
.disabled(cloning)
|
||||
.into_any_element()
|
||||
})
|
||||
.content(move |_, cx| {
|
||||
v_flex()
|
||||
.w(px(440.))
|
||||
.p_3()
|
||||
.gap_4()
|
||||
.child(clone_group(
|
||||
"Clone with ngit",
|
||||
"copy-ngit",
|
||||
&ngit_for_popover,
|
||||
cx,
|
||||
))
|
||||
.child(clone_group(
|
||||
"Clone with nak",
|
||||
"copy-nak",
|
||||
&nak_for_popover,
|
||||
cx,
|
||||
))
|
||||
.child(
|
||||
v_flex()
|
||||
.gap_1()
|
||||
.child(
|
||||
div()
|
||||
.typeset(TextRole::Caption, cx)
|
||||
.text_color(cx.theme().colors.muted_foreground)
|
||||
.child("Grasp Servers"),
|
||||
)
|
||||
.when(git_for_popover.is_empty(), |this| {
|
||||
this.child(
|
||||
div()
|
||||
.typeset(TextRole::Caption, cx)
|
||||
.child("No git clone urls."),
|
||||
)
|
||||
})
|
||||
.children(git_for_popover.iter().enumerate().map(
|
||||
|(ix, command)| {
|
||||
ClipboardButton::new(
|
||||
SharedString::from(format!(
|
||||
"copy-git-{ix}"
|
||||
)),
|
||||
command.clone(),
|
||||
)
|
||||
},
|
||||
)),
|
||||
)
|
||||
.child(
|
||||
h_flex().justify_end().child(
|
||||
Button::new("download")
|
||||
.icon(Icon::named(CustomIconName::GitClone))
|
||||
.label("Download")
|
||||
.on_click({
|
||||
let weak = weak_download.clone();
|
||||
move |_, window, cx| {
|
||||
if let Err(error) =
|
||||
weak.update(cx, |this, cx| {
|
||||
this.reset_remote(window, cx);
|
||||
this.clone_to_folder(window, cx);
|
||||
})
|
||||
{
|
||||
log::warn!(
|
||||
"failed to reset remote: {error}"
|
||||
);
|
||||
log::warn!("failed to clone: {error}");
|
||||
}
|
||||
}
|
||||
}),
|
||||
);
|
||||
items.push(MenuItem::separator());
|
||||
items.push(
|
||||
MenuItem::new("Delete").destructive(true).handler(
|
||||
{
|
||||
let weak = weak_menu_items.clone();
|
||||
move |window, cx| {
|
||||
if let Err(error) =
|
||||
weak.update(cx, |this, cx| {
|
||||
this.delete_repository(
|
||||
window, cx,
|
||||
);
|
||||
})
|
||||
{
|
||||
log::warn!(
|
||||
"failed to delete: {error}"
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
items
|
||||
}),
|
||||
)
|
||||
.child(
|
||||
Popover::new("clone")
|
||||
.open(self.clone_open)
|
||||
.on_change(move |open, _, cx| {
|
||||
if let Err(error) = weak_clone.update(cx, |this, cx| {
|
||||
this.clone_open = open;
|
||||
cx.notify();
|
||||
}) {
|
||||
log::warn!("failed to update clone popover: {error}");
|
||||
}
|
||||
})
|
||||
.trigger(move |_, _| {
|
||||
Button::new("clone")
|
||||
.icon(Icon::named(CustomIconName::GitClone))
|
||||
.tooltip(Tooltip::text("Clone"))
|
||||
.loading(cloning)
|
||||
.disabled(cloning)
|
||||
.into_any_element()
|
||||
})
|
||||
.content(move |_, cx| {
|
||||
v_flex()
|
||||
.w(px(440.))
|
||||
.p_3()
|
||||
.gap_4()
|
||||
.child(clone_group(
|
||||
"Clone with ngit",
|
||||
"copy-ngit",
|
||||
&ngit_for_popover,
|
||||
cx,
|
||||
))
|
||||
.child(clone_group(
|
||||
"Clone with nak",
|
||||
"copy-nak",
|
||||
&nak_for_popover,
|
||||
cx,
|
||||
))
|
||||
.child(
|
||||
v_flex()
|
||||
.gap_1()
|
||||
.child(
|
||||
div()
|
||||
.typeset(TextRole::Caption, cx)
|
||||
.text_color(
|
||||
cx.theme().colors.muted_foreground,
|
||||
)
|
||||
.child("Grasp Servers"),
|
||||
)
|
||||
.when(git_for_popover.is_empty(), |this| {
|
||||
this.child(
|
||||
div()
|
||||
.typeset(TextRole::Caption, cx)
|
||||
.child("No git clone urls."),
|
||||
)
|
||||
})
|
||||
.children(
|
||||
git_for_popover.iter().enumerate().map(
|
||||
|(ix, command)| {
|
||||
ClipboardButton::new(
|
||||
SharedString::from(format!(
|
||||
"copy-git-{ix}"
|
||||
)),
|
||||
command.clone(),
|
||||
)
|
||||
},
|
||||
),
|
||||
),
|
||||
)
|
||||
.child(
|
||||
h_flex().justify_end().child(
|
||||
Button::new("download")
|
||||
.icon(Icon::named(CustomIconName::GitClone))
|
||||
.label("Download")
|
||||
.on_click({
|
||||
let weak = weak_download.clone();
|
||||
move |_, window, cx| {
|
||||
if let Err(error) =
|
||||
weak.update(cx, |this, cx| {
|
||||
this.clone_to_folder(
|
||||
window, cx,
|
||||
);
|
||||
})
|
||||
{
|
||||
log::warn!(
|
||||
"failed to clone: {error}"
|
||||
);
|
||||
}
|
||||
}
|
||||
}),
|
||||
),
|
||||
)
|
||||
.into_any_element()
|
||||
}),
|
||||
),
|
||||
),
|
||||
)
|
||||
.into_any_element()
|
||||
}),
|
||||
),
|
||||
)
|
||||
.into_any_element()
|
||||
}
|
||||
|
||||
fn render_local_header(&self, cx: &mut Context<Self>) -> AnyElement {
|
||||
let name = repo_display_name(self.store.read(cx));
|
||||
let path = self
|
||||
.store
|
||||
.read(cx)
|
||||
@@ -376,6 +354,8 @@ impl RepoDetailView {
|
||||
.as_ref()
|
||||
.map(|path| path.display().to_string())
|
||||
.unwrap_or_default();
|
||||
|
||||
let name = repo_display_name(self.store.read(cx));
|
||||
let avatar = Avatar::new(path.clone());
|
||||
|
||||
let bound = self.store.read(cx).nip34.clone();
|
||||
@@ -433,6 +413,174 @@ impl RepoDetailView {
|
||||
.into_any_element()
|
||||
}
|
||||
|
||||
/// A checkout with commits the repository owner has not pushed yet.
|
||||
pub(super) fn push_suggestion(&self, cx: &App) -> Option<CheckoutStatus> {
|
||||
let store = self.store.read(cx);
|
||||
let addr = store.addr()?;
|
||||
let user = Backend::global(cx).read(cx).current_user()?;
|
||||
|
||||
if !store.is_author(&user) {
|
||||
return None;
|
||||
}
|
||||
|
||||
CheckoutsStore::global(cx)
|
||||
.read(cx)
|
||||
.push_statuses_of(addr)
|
||||
.into_iter()
|
||||
.next()
|
||||
}
|
||||
|
||||
/// A checkout whose branches are ahead of their nostr state.
|
||||
pub(super) fn sync_suggestion(&self, cx: &App) -> Option<CheckoutSyncStatus> {
|
||||
let store = self.store.read(cx);
|
||||
let addr = store.addr()?;
|
||||
let user = Backend::global(cx).read(cx).current_user()?;
|
||||
|
||||
if !store.is_author(&user) {
|
||||
return None;
|
||||
}
|
||||
|
||||
self.sync_directory
|
||||
.read(cx)
|
||||
.statuses_of(addr, cx)
|
||||
.into_iter()
|
||||
.find(|checkout| checkout.status.ahead_total > 0)
|
||||
}
|
||||
|
||||
/// Pushes the sync/push suggestion.
|
||||
fn render_sync_button(&self, cx: &mut Context<Self>) -> Option<AnyElement> {
|
||||
let pushing = self.store.read(cx).pushing;
|
||||
|
||||
let (icon, label, tooltip, path) = if let Some(status) = self.push_suggestion(cx) {
|
||||
let commits = if status.ahead == 1 {
|
||||
"1 commit".to_owned()
|
||||
} else {
|
||||
format!("{} commits", status.ahead)
|
||||
};
|
||||
let path = status.path.clone();
|
||||
(
|
||||
Icon::named(CustomIconName::ArrowUp),
|
||||
SharedString::from(format!("{commits} ready to push")),
|
||||
format!("Push {}", status.branch),
|
||||
path,
|
||||
)
|
||||
} else {
|
||||
let checkout = self.sync_suggestion(cx)?;
|
||||
let (branch, ahead) = checkout
|
||||
.status
|
||||
.refs
|
||||
.iter()
|
||||
.filter_map(|(name, sync)| match sync {
|
||||
signed_git::RefSync::LocalAhead { ahead } => Some((name, *ahead)),
|
||||
signed_git::RefSync::Diverged { ahead, .. } => Some((name, *ahead)),
|
||||
_ => None,
|
||||
})
|
||||
.max_by_key(|(_, ahead)| *ahead)?;
|
||||
let commits = if ahead == 1 {
|
||||
"1 commit".to_owned()
|
||||
} else {
|
||||
format!("{ahead} commits")
|
||||
};
|
||||
let path = checkout.path.clone();
|
||||
(
|
||||
Icon::named(IconRole::Refresh),
|
||||
SharedString::from(format!("{commits} ahead of Nostr")),
|
||||
format!("Sync {branch}"),
|
||||
path,
|
||||
)
|
||||
};
|
||||
|
||||
Some(
|
||||
Button::new("sync-button")
|
||||
.icon(icon)
|
||||
.label(label)
|
||||
.tooltip(Tooltip::text(tooltip))
|
||||
.variant(ButtonVariant::Secondary)
|
||||
.loading(pushing)
|
||||
.disabled(pushing)
|
||||
.on_click(cx.listener(move |this, _, window, cx| {
|
||||
this.push_unpushed_checkout(path.clone(), window, cx);
|
||||
}))
|
||||
.into_any_element(),
|
||||
)
|
||||
}
|
||||
|
||||
pub(super) fn render_metadata(&self, cx: &mut Context<Self>) -> AnyElement {
|
||||
h_flex()
|
||||
.px_2()
|
||||
.h_12()
|
||||
.w_full()
|
||||
.gap_4()
|
||||
.items_center()
|
||||
.justify_between()
|
||||
.child(self.render_maintainers(cx))
|
||||
.child(self.render_ref_controls(cx))
|
||||
.into_any_element()
|
||||
}
|
||||
|
||||
fn render_ref_controls(&self, cx: &mut Context<Self>) -> AnyElement {
|
||||
h_flex()
|
||||
.justify_end()
|
||||
.flex_none()
|
||||
.gap_2()
|
||||
.when_some(self.render_last_commit(cx), |this, commit| {
|
||||
this.child(commit)
|
||||
})
|
||||
.child(self.refs.branch_select.clone())
|
||||
.child(self.refs.tag_select.clone())
|
||||
.into_any_element()
|
||||
}
|
||||
|
||||
fn render_last_commit(&self, cx: &mut Context<Self>) -> Option<AnyElement> {
|
||||
let commit = self.head_commit.as_ref()?;
|
||||
let short = commit.id.get(..8).unwrap_or(&commit.id).to_owned();
|
||||
let history = self.history.clone();
|
||||
let commit_id = commit.id.clone();
|
||||
|
||||
Some(
|
||||
h_flex()
|
||||
.id("last-commit")
|
||||
.h_8()
|
||||
.px_2()
|
||||
.gap_2()
|
||||
.min_w_0()
|
||||
.rounded(cx.theme().radius.control)
|
||||
.hover(|this| this.bg(cx.theme().colors.muted_hover))
|
||||
.tooltip(Tooltip::text("View latest commit"))
|
||||
.on_click(move |_, window, cx| {
|
||||
history.update(cx, |history, cx| {
|
||||
history.open_commit_diff(&commit_id, window, cx);
|
||||
});
|
||||
})
|
||||
.child(
|
||||
Icon::named(CustomIconName::GitCommit)
|
||||
.color(cx.theme().colors.muted_foreground),
|
||||
)
|
||||
.child(
|
||||
div()
|
||||
.font_family(cx.theme().mono_font)
|
||||
.typeset(TextRole::Callout, cx)
|
||||
.text_color(cx.theme().colors.muted_foreground)
|
||||
.child(SharedString::from(short)),
|
||||
)
|
||||
.child(
|
||||
div()
|
||||
.max_w(px(220.))
|
||||
.typeset(TextRole::Callout, cx)
|
||||
.text_ellipsis()
|
||||
.whitespace_nowrap()
|
||||
.child(commit.summary.clone()),
|
||||
)
|
||||
.child(
|
||||
div()
|
||||
.typeset(TextRole::Callout, cx)
|
||||
.text_color(cx.theme().colors.muted_foreground)
|
||||
.child(relative_time_secs(commit.time)),
|
||||
)
|
||||
.into_any_element(),
|
||||
)
|
||||
}
|
||||
|
||||
fn render_maintainers(&self, cx: &mut Context<Self>) -> AnyElement {
|
||||
let Some(announcement) = self.announcement(cx) else {
|
||||
return div().into_any_element();
|
||||
@@ -451,35 +599,31 @@ impl RepoDetailView {
|
||||
let owner_name = owner.name();
|
||||
|
||||
h_flex()
|
||||
.w_full()
|
||||
.gap_3()
|
||||
.min_w_0()
|
||||
.gap_2()
|
||||
.child(
|
||||
h_flex()
|
||||
.gap_2()
|
||||
.gap_1()
|
||||
.child(
|
||||
h_flex()
|
||||
.gap_1()
|
||||
.child(
|
||||
Avatar::new(announcement.owner)
|
||||
.name(owner_name.clone())
|
||||
.picture(owner.picture()),
|
||||
)
|
||||
.child(
|
||||
div()
|
||||
.typeset(TextRole::Caption, cx)
|
||||
.whitespace_nowrap()
|
||||
.child(owner_name),
|
||||
),
|
||||
Avatar::new(announcement.owner)
|
||||
.name(owner_name.clone())
|
||||
.picture(owner.picture()),
|
||||
)
|
||||
.when(!rest.is_empty(), |this| {
|
||||
this.child(
|
||||
div()
|
||||
.typeset(TextRole::Caption, cx)
|
||||
.text_color(cx.theme().colors.muted_foreground)
|
||||
.child(SharedString::from(format!("+{}", rest.len()))),
|
||||
)
|
||||
}),
|
||||
.child(
|
||||
div()
|
||||
.typeset(TextRole::Caption, cx)
|
||||
.whitespace_nowrap()
|
||||
.child(owner_name),
|
||||
),
|
||||
)
|
||||
.when(!rest.is_empty(), |this| {
|
||||
this.child(
|
||||
div()
|
||||
.typeset(TextRole::Caption, cx)
|
||||
.text_color(cx.theme().colors.muted_foreground)
|
||||
.child(SharedString::from(format!("+{}", rest.len()))),
|
||||
)
|
||||
})
|
||||
.into_any_element()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,11 +10,9 @@ use gpui::{
|
||||
WeakEntity, Window, div,
|
||||
};
|
||||
use gpui_native_kit::alert::{Alert, AlertSeverity};
|
||||
use gpui_native_kit::badge::Badge;
|
||||
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::icons::{Icon, IconRole};
|
||||
use gpui_native_kit::icons::Icon;
|
||||
use gpui_native_kit::layout::panel::Panel;
|
||||
use gpui_native_kit::spinner::Spinner;
|
||||
use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
@@ -23,12 +21,10 @@ use nostr::prelude::{PublicKey, Url};
|
||||
use signed_core::{Announcement, RepoAddr};
|
||||
use signed_git::{FileCommit, GitCache, Repo};
|
||||
use signed_state::{
|
||||
Backend, CheckoutStatus, CheckoutSyncStatus, CheckoutsStore, LocalReposStore, Mirrors,
|
||||
Nip34Binding, PushStepStatus, RepoStore, SyncStatusDirectory,
|
||||
Backend, CheckoutsStore, LocalReposStore, Mirrors, Nip34Binding, RepoStore, SyncStatusDirectory,
|
||||
};
|
||||
|
||||
pub mod actions;
|
||||
pub mod banners;
|
||||
pub mod commit_diff;
|
||||
pub mod dialogs;
|
||||
pub mod files;
|
||||
@@ -37,8 +33,8 @@ pub mod helpers;
|
||||
pub mod history;
|
||||
pub mod refs;
|
||||
|
||||
use banners::Banners;
|
||||
use files::RepoFilesView;
|
||||
use header::Banners;
|
||||
use helpers::{RepoData, load_repo_data};
|
||||
use history::RepoHistoryView;
|
||||
use refs::RefSwitcher;
|
||||
@@ -183,8 +179,8 @@ impl RepoDetailView {
|
||||
error: None,
|
||||
head_commit: None,
|
||||
refs,
|
||||
tasks: Vec::new(),
|
||||
banners: Banners::default(),
|
||||
tasks: Vec::new(),
|
||||
directory: ProfileDirectory::new(cx),
|
||||
sync_directory: SyncStatusDirectory::new(cx),
|
||||
share_open: false,
|
||||
@@ -406,6 +402,7 @@ impl RepoDetailView {
|
||||
}
|
||||
|
||||
let pushing = store.read_with(cx, |this, _| this.pushing)?;
|
||||
|
||||
if pushing {
|
||||
return Ok(());
|
||||
}
|
||||
@@ -830,356 +827,6 @@ impl RepoDetailView {
|
||||
self.tasks.push(task);
|
||||
}
|
||||
|
||||
/// Open the upstream repository, the `u` tag of this fork's announcement.
|
||||
fn ready_suggestion(&self, cx: &App) -> Option<CheckoutStatus> {
|
||||
let store = self.store.read(cx);
|
||||
let addr = store.addr()?;
|
||||
let user = Backend::global(cx).read(cx).current_user()?;
|
||||
|
||||
if store.is_author(&user) {
|
||||
return None;
|
||||
}
|
||||
|
||||
let statuses = CheckoutsStore::global(cx).read(cx).ready_statuses_of(addr);
|
||||
'status: for status in statuses {
|
||||
if self.banners.dismissal(&status) {
|
||||
continue;
|
||||
}
|
||||
for pr in &store.pull_requests {
|
||||
if CheckoutsStore::pr_proposes_checkout(
|
||||
pr,
|
||||
store.status_of(pr) == signed_core::RepoStatus::Open,
|
||||
user,
|
||||
&status,
|
||||
) {
|
||||
continue 'status;
|
||||
}
|
||||
}
|
||||
return Some(status);
|
||||
}
|
||||
None
|
||||
}
|
||||
|
||||
fn render_ready_banner(&self, cx: &Context<Self>) -> Option<AnyElement> {
|
||||
let status = self.ready_suggestion(cx)?;
|
||||
let commits = if status.ahead == 1 {
|
||||
SharedString::from("1 commit")
|
||||
} else {
|
||||
SharedString::from(format!("{} commits", status.ahead))
|
||||
};
|
||||
|
||||
Some(
|
||||
h_flex()
|
||||
.p_4()
|
||||
.w_full()
|
||||
.justify_between()
|
||||
.bg(cx.theme().colors.muted)
|
||||
.child(
|
||||
h_flex()
|
||||
.gap_2()
|
||||
.typeset(TextRole::Body, cx)
|
||||
.text_color(cx.theme().colors.muted_foreground)
|
||||
.child(Badge::new("ready-branch", status.branch.clone()))
|
||||
.child(commits)
|
||||
.child("ahead of")
|
||||
.child(Badge::new("ready-base", status.base.clone())),
|
||||
)
|
||||
.child(
|
||||
h_flex()
|
||||
.gap_1()
|
||||
.child(
|
||||
Button::new("create-pr-from-banner")
|
||||
.label("Create pull request")
|
||||
.small()
|
||||
.on_click(cx.listener(|this, _, window, cx| {
|
||||
this.open_new_pull_request(window, cx);
|
||||
})),
|
||||
)
|
||||
.child(
|
||||
Button::new("dismiss-ready-banner")
|
||||
.icon(Icon::named(IconRole::Close))
|
||||
.variant(ButtonVariant::Ghost)
|
||||
.small()
|
||||
.on_click(cx.listener(move |this, _, _, cx| {
|
||||
this.banners.dismiss(&status);
|
||||
cx.notify();
|
||||
})),
|
||||
),
|
||||
)
|
||||
.into_any_element(),
|
||||
)
|
||||
}
|
||||
|
||||
fn push_suggestion(&self, cx: &App) -> Option<CheckoutStatus> {
|
||||
let store = self.store.read(cx);
|
||||
let addr = store.addr()?;
|
||||
let user = Backend::global(cx).read(cx).current_user()?;
|
||||
|
||||
if !store.is_author(&user) {
|
||||
return None;
|
||||
}
|
||||
|
||||
let statuses = CheckoutsStore::global(cx).read(cx).push_statuses_of(addr);
|
||||
|
||||
statuses
|
||||
.into_iter()
|
||||
.find(|status| !self.banners.dismissal(status))
|
||||
}
|
||||
|
||||
fn sync_suggestion(&self, cx: &App) -> Option<CheckoutSyncStatus> {
|
||||
let store = self.store.read(cx);
|
||||
let addr = store.addr()?;
|
||||
let user = Backend::global(cx).read(cx).current_user()?;
|
||||
|
||||
if !store.is_author(&user) {
|
||||
return None;
|
||||
}
|
||||
|
||||
let statuses = self.sync_directory.read(cx).statuses_of(addr, cx);
|
||||
|
||||
statuses.into_iter().find(|checkout| {
|
||||
checkout.status.ahead_total > 0 && !self.banners.sync_dismissal(checkout)
|
||||
})
|
||||
}
|
||||
|
||||
fn render_push_banner(&self, cx: &Context<Self>) -> Option<AnyElement> {
|
||||
let status = self.push_suggestion(cx)?;
|
||||
let path = status.path.clone();
|
||||
let pushing = self.store.read(cx).pushing;
|
||||
let commits = if status.ahead == 1 {
|
||||
SharedString::from("1 commit")
|
||||
} else {
|
||||
SharedString::from(format!("{} commits", status.ahead))
|
||||
};
|
||||
|
||||
Some(
|
||||
h_flex()
|
||||
.p_4()
|
||||
.gap_2()
|
||||
.w_full()
|
||||
.justify_between()
|
||||
.bg(cx.theme().colors.muted)
|
||||
.child(
|
||||
h_flex()
|
||||
.gap_2()
|
||||
.typeset(TextRole::Body, cx)
|
||||
.text_color(cx.theme().colors.muted_foreground)
|
||||
.child(Badge::new("push-branch", status.branch.clone()))
|
||||
.child(commits)
|
||||
.child("ready to push"),
|
||||
)
|
||||
.child(
|
||||
h_flex()
|
||||
.gap_1()
|
||||
.child(
|
||||
Button::new("push-checkout-banner")
|
||||
.icon(Icon::named(CustomIconName::ArrowUp))
|
||||
.label("Push")
|
||||
.small()
|
||||
.loading(pushing)
|
||||
.disabled(pushing)
|
||||
.on_click(cx.listener(move |this, _, window, cx| {
|
||||
this.push_unpushed_checkout(path.clone(), window, cx);
|
||||
})),
|
||||
)
|
||||
.child(
|
||||
Button::new("dismiss-push-banner")
|
||||
.icon(Icon::named(IconRole::Close))
|
||||
.variant(ButtonVariant::Ghost)
|
||||
.small()
|
||||
.disabled(pushing)
|
||||
.on_click(cx.listener(move |this, _, _, cx| {
|
||||
this.banners.dismiss(&status);
|
||||
cx.notify();
|
||||
})),
|
||||
),
|
||||
)
|
||||
.into_any_element(),
|
||||
)
|
||||
}
|
||||
|
||||
fn render_sync_banner(&self, cx: &Context<Self>) -> Option<AnyElement> {
|
||||
let checkout = self.sync_suggestion(cx)?;
|
||||
let path = checkout.path.clone();
|
||||
let pushing = self.store.read(cx).pushing;
|
||||
|
||||
let (branch, ahead) = checkout
|
||||
.status
|
||||
.refs
|
||||
.iter()
|
||||
.filter_map(|(name, sync)| match sync {
|
||||
signed_git::RefSync::LocalAhead { ahead } => Some((name, *ahead)),
|
||||
signed_git::RefSync::Diverged { ahead, .. } => Some((name, *ahead)),
|
||||
_ => None,
|
||||
})
|
||||
.max_by_key(|(_, ahead)| *ahead)?;
|
||||
|
||||
let branch = SharedString::from(branch.clone());
|
||||
let commits = if ahead == 1 {
|
||||
SharedString::from("1 commit")
|
||||
} else {
|
||||
SharedString::from(format!("{} commits", ahead))
|
||||
};
|
||||
|
||||
Some(
|
||||
h_flex()
|
||||
.p_4()
|
||||
.gap_2()
|
||||
.w_full()
|
||||
.justify_between()
|
||||
.bg(cx.theme().colors.muted)
|
||||
.child(
|
||||
h_flex()
|
||||
.gap_2()
|
||||
.typeset(TextRole::Body, cx)
|
||||
.text_color(cx.theme().colors.muted_foreground)
|
||||
.child(Badge::new("sync-branch", branch))
|
||||
.child(commits)
|
||||
.child("ahead of Nostr"),
|
||||
)
|
||||
.child(
|
||||
h_flex()
|
||||
.gap_1()
|
||||
.child(
|
||||
Button::new("sync-banner")
|
||||
.icon(Icon::named(IconRole::Refresh))
|
||||
.label("Sync now")
|
||||
.small()
|
||||
.loading(pushing)
|
||||
.disabled(pushing)
|
||||
.on_click(cx.listener(move |this, _, window, cx| {
|
||||
this.push_unpushed_checkout(path.clone(), window, cx);
|
||||
})),
|
||||
)
|
||||
.child(
|
||||
Button::new("dismiss-sync-banner")
|
||||
.icon(Icon::named(IconRole::Close))
|
||||
.variant(ButtonVariant::Ghost)
|
||||
.small()
|
||||
.disabled(pushing)
|
||||
.on_click(cx.listener(move |this, _, _, cx| {
|
||||
this.banners.sync_dismiss(&checkout);
|
||||
cx.notify();
|
||||
})),
|
||||
),
|
||||
)
|
||||
.into_any_element(),
|
||||
)
|
||||
}
|
||||
|
||||
fn render_push_progress_banner(&self, cx: &Context<Self>) -> Option<AnyElement> {
|
||||
let store = self.store.read(cx);
|
||||
if !store.pushing || store.push_steps.is_empty() {
|
||||
return None;
|
||||
}
|
||||
|
||||
let steps = store
|
||||
.push_steps
|
||||
.iter()
|
||||
.map(|status| {
|
||||
let label = SharedString::from(status.step().label());
|
||||
|
||||
match status {
|
||||
PushStepStatus::Running(_) => h_flex()
|
||||
.gap_2()
|
||||
.typeset(TextRole::Body, cx)
|
||||
.text_color(cx.theme().colors.muted_foreground)
|
||||
.child(Spinner::new("push-step"))
|
||||
.child(label)
|
||||
.into_any_element(),
|
||||
PushStepStatus::Done(_) => h_flex()
|
||||
.gap_2()
|
||||
.typeset(TextRole::Body, cx)
|
||||
.child(Icon::named(IconRole::Check).small())
|
||||
.child(label)
|
||||
.into_any_element(),
|
||||
PushStepStatus::Failed(_, reason) => h_flex()
|
||||
.gap_2()
|
||||
.typeset(TextRole::Body, cx)
|
||||
.text_color(cx.theme().ramps.destructive.base)
|
||||
.child(Icon::named(IconRole::Close).small())
|
||||
.child(SharedString::from(format!(
|
||||
"{}: {reason}",
|
||||
status.step().label()
|
||||
)))
|
||||
.into_any_element(),
|
||||
}
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
Some(
|
||||
v_flex()
|
||||
.p_4()
|
||||
.gap_1()
|
||||
.w_full()
|
||||
.bg(cx.theme().colors.muted)
|
||||
.child(div().typeset(TextRole::Body, cx).child("Pushing"))
|
||||
.children(steps)
|
||||
.into_any_element(),
|
||||
)
|
||||
}
|
||||
|
||||
fn render_push_warning_banner(&self, cx: &Context<Self>) -> Option<AnyElement> {
|
||||
let store = self.store.read(cx);
|
||||
let warning = store.last_push_warning.clone()?;
|
||||
let pushing = store.pushing;
|
||||
|
||||
Some(
|
||||
h_flex()
|
||||
.p_4()
|
||||
.gap_2()
|
||||
.w_full()
|
||||
.items_start()
|
||||
.justify_between()
|
||||
.bg(cx.theme().colors.muted)
|
||||
.child(
|
||||
h_flex()
|
||||
.gap_2()
|
||||
.min_w_0()
|
||||
.flex_1()
|
||||
.items_start()
|
||||
.child(Icon::named(IconRole::Warning).small())
|
||||
.child(
|
||||
div()
|
||||
.flex_1()
|
||||
.min_w_0()
|
||||
.typeset(TextRole::Body, cx)
|
||||
.text_color(cx.theme().ramps.warning.base)
|
||||
.child(SharedString::from(warning)),
|
||||
),
|
||||
)
|
||||
.child(
|
||||
h_flex()
|
||||
.gap_1()
|
||||
.child(
|
||||
Button::new("republish-after-partial-push")
|
||||
.icon(Icon::named(CustomIconName::Init))
|
||||
.label("Republish")
|
||||
.small()
|
||||
.loading(pushing)
|
||||
.disabled(pushing)
|
||||
.on_click(cx.listener(|this, _, window, cx| {
|
||||
this.push_repository(window, cx);
|
||||
})),
|
||||
)
|
||||
.child(
|
||||
Button::new("dismiss-push-warning")
|
||||
.icon(Icon::named(IconRole::Close))
|
||||
.variant(ButtonVariant::Ghost)
|
||||
.small()
|
||||
.disabled(pushing)
|
||||
.on_click(cx.listener(|this, _, _, cx| {
|
||||
this.store.update(cx, |store, _| {
|
||||
store.last_push_warning = None;
|
||||
});
|
||||
cx.notify();
|
||||
})),
|
||||
),
|
||||
)
|
||||
.into_any_element(),
|
||||
)
|
||||
}
|
||||
|
||||
fn render_files_tab(&self, cx: &App) -> AnyElement {
|
||||
if self.loading {
|
||||
let label = if self.store.read(cx).path.is_some() {
|
||||
@@ -1269,7 +916,7 @@ impl RepoDetailView {
|
||||
.into_any_element()
|
||||
}
|
||||
|
||||
fn render_content(&mut self, cx: &mut Context<Self>) -> AnyElement {
|
||||
fn render_pane(&mut self, cx: &mut Context<Self>) -> AnyElement {
|
||||
match self.active_section {
|
||||
RepoSection::Files => self.render_files_tab(cx),
|
||||
RepoSection::Commits => self.history.clone().into_any_element(),
|
||||
@@ -1284,12 +931,6 @@ impl Panel for RepoDetailView {}
|
||||
impl Render for RepoDetailView {
|
||||
fn render(&mut self, _window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
|
||||
let weak = cx.entity().downgrade();
|
||||
|
||||
let banner = self
|
||||
.render_ready_banner(cx)
|
||||
.or_else(|| self.render_push_banner(cx))
|
||||
.or_else(|| self.render_sync_banner(cx));
|
||||
|
||||
let error = self.error.clone().or_else(|| {
|
||||
self.store
|
||||
.read(cx)
|
||||
@@ -1301,14 +942,8 @@ impl Render for RepoDetailView {
|
||||
v_flex()
|
||||
.id("repo")
|
||||
.size_full()
|
||||
.when_some(banner, |this, banner| this.child(banner))
|
||||
.when_some(self.render_push_progress_banner(cx), |this, banner| {
|
||||
this.child(banner)
|
||||
})
|
||||
.when_some(self.render_push_warning_banner(cx), |this, banner| {
|
||||
this.child(banner)
|
||||
})
|
||||
.child(self.render_header(cx))
|
||||
.child(self.render_about(cx))
|
||||
.child(self.render_metadata(cx))
|
||||
.when_some(error, |this, error| {
|
||||
this.child(
|
||||
Alert::new("repo-error")
|
||||
@@ -1332,6 +967,8 @@ impl Render for RepoDetailView {
|
||||
.min_h_0()
|
||||
.w_full()
|
||||
.overflow_hidden()
|
||||
.border_t_1()
|
||||
.border_color(cx.theme().colors.border)
|
||||
.child(self.render_sidebar(cx))
|
||||
.child(
|
||||
v_flex()
|
||||
@@ -1339,7 +976,7 @@ impl Render for RepoDetailView {
|
||||
.min_w_0()
|
||||
.h_full()
|
||||
.overflow_hidden()
|
||||
.child(self.render_content(cx)),
|
||||
.child(self.render_pane(cx)),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user