chore: refactor issue detail into a split panel
This commit is contained in:
@@ -167,7 +167,7 @@ impl Render for ImportDialog {
|
|||||||
.gap_3()
|
.gap_3()
|
||||||
.child(
|
.child(
|
||||||
div()
|
div()
|
||||||
.text_base()
|
.text_sm()
|
||||||
.text_color(cx.theme().colors.muted_foreground)
|
.text_color(cx.theme().colors.muted_foreground)
|
||||||
.child(description),
|
.child(description),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ impl Render for OnboardingDialog {
|
|||||||
.gap_3()
|
.gap_3()
|
||||||
.child(
|
.child(
|
||||||
div()
|
div()
|
||||||
.text_base()
|
.text_sm()
|
||||||
.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."),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -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_base()
|
.text_sm()
|
||||||
.whitespace_nowrap()
|
.whitespace_nowrap()
|
||||||
.text_ellipsis()
|
.text_ellipsis()
|
||||||
.child(name),
|
.child(name),
|
||||||
@@ -79,7 +79,7 @@ pub fn thread(
|
|||||||
.child(
|
.child(
|
||||||
h_flex()
|
h_flex()
|
||||||
.gap_2()
|
.gap_2()
|
||||||
.text_base()
|
.text_sm()
|
||||||
.child(
|
.child(
|
||||||
h_flex()
|
h_flex()
|
||||||
.size_6()
|
.size_6()
|
||||||
|
|||||||
@@ -1,24 +1,34 @@
|
|||||||
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
use gpui::prelude::FluentBuilder as _;
|
||||||
use gpui::{
|
use gpui::{
|
||||||
App, Context, Entity, InteractiveElement as _, IntoElement, ParentElement as _, Render,
|
AnyElement, App, AppContext as _, Context, Entity, InteractiveElement as _, IntoElement,
|
||||||
ScrollHandle, SharedString, Styled as _, Subscription, Window, div,
|
ParentElement as _, Pixels, Render, ScrollHandle, SharedString, Styled as _, Subscription,
|
||||||
|
WeakEntity, Window, div, px,
|
||||||
};
|
};
|
||||||
use metadata::ProfileDirectory;
|
use metadata::ProfileDirectory;
|
||||||
use nostr::prelude::EventId;
|
use nostr::prelude::EventId;
|
||||||
use signed_core::GitEvent;
|
use signed_core::GitEvent;
|
||||||
use signed_state::RepoStore;
|
use signed_state::RepoStore;
|
||||||
use ui::avatar::Avatar;
|
use ui::avatar::Avatar;
|
||||||
|
use ui::badge::{Badge, BadgeVariant};
|
||||||
use ui::common::{Sizable as _, StyledExt as _, h_flex, v_flex};
|
use ui::common::{Sizable as _, StyledExt as _, h_flex, v_flex};
|
||||||
use ui::empty_state::EmptyState;
|
use ui::empty_state::EmptyState;
|
||||||
use ui::input::InputState;
|
use ui::input::InputState;
|
||||||
use ui::layout::panel::Panel;
|
use ui::layout::panel::{Panel, PanelSlot, SplitSide};
|
||||||
use ui::scroll_area::ScrollArea;
|
use ui::scroll_area::ScrollArea;
|
||||||
use ui::spinner::Spinner;
|
use ui::spinner::Spinner;
|
||||||
use ui::theme::ActiveTheme as _;
|
use ui::theme::ActiveTheme as _;
|
||||||
use utils::relative_time;
|
use utils::relative_time;
|
||||||
|
|
||||||
use crate::issues::helpers::{comment_form, comments_section, sidebar_section};
|
use crate::app::AppRoot;
|
||||||
use crate::shared::log_dropped;
|
use crate::issues::helpers::{comment_form, comments_section};
|
||||||
use crate::shared::widgets::status_badge;
|
use crate::shared::widgets::status_badge;
|
||||||
|
use crate::shared::{log_dropped, track_event_participants};
|
||||||
|
|
||||||
|
/// The split pane showing the issue's participants and labels.
|
||||||
|
const SIDEBAR_ID: &str = "Issue details";
|
||||||
|
const SIDEBAR_WIDTH: Pixels = px(240.);
|
||||||
|
|
||||||
pub struct IssueDetailView {
|
pub struct IssueDetailView {
|
||||||
store: Entity<RepoStore>,
|
store: Entity<RepoStore>,
|
||||||
@@ -31,6 +41,48 @@ pub struct IssueDetailView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl IssueDetailView {
|
impl IssueDetailView {
|
||||||
|
/// Opens the issue's detail as the main panel and its sidebar in the split pane.
|
||||||
|
pub fn open(
|
||||||
|
workspace: &WeakEntity<AppRoot>,
|
||||||
|
store: Entity<RepoStore>,
|
||||||
|
issue_id: EventId,
|
||||||
|
window: &mut Window,
|
||||||
|
cx: &mut App,
|
||||||
|
) {
|
||||||
|
let id = SharedString::from(format!("issue:{issue_id}"));
|
||||||
|
let sidebar_store = store.clone();
|
||||||
|
|
||||||
|
log_dropped(workspace.update(cx, |root, cx| {
|
||||||
|
root.panels().update(cx, |panels, cx| {
|
||||||
|
panels.open(
|
||||||
|
PanelSlot::Main,
|
||||||
|
id,
|
||||||
|
{
|
||||||
|
let store = store.clone();
|
||||||
|
move |_, cx| cx.new(|cx| IssueDetailView::new(store.clone(), issue_id, cx))
|
||||||
|
},
|
||||||
|
window,
|
||||||
|
cx,
|
||||||
|
);
|
||||||
|
|
||||||
|
let sidebar = cx.new(|cx| IssueSidebarView {
|
||||||
|
store: sidebar_store.clone(),
|
||||||
|
issue_id,
|
||||||
|
directory: ProfileDirectory::new(cx),
|
||||||
|
scroll_handle: ScrollHandle::new(),
|
||||||
|
});
|
||||||
|
|
||||||
|
panels.insert_split_at(
|
||||||
|
SIDEBAR_ID,
|
||||||
|
SIDEBAR_WIDTH,
|
||||||
|
SplitSide::Trailing,
|
||||||
|
Arc::new(sidebar),
|
||||||
|
cx,
|
||||||
|
);
|
||||||
|
})
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
pub fn new(store: Entity<RepoStore>, issue_id: EventId, cx: &mut Context<Self>) -> Self {
|
pub fn new(store: Entity<RepoStore>, issue_id: EventId, cx: &mut Context<Self>) -> Self {
|
||||||
let comment_input = InputState::builder().multiline().build(cx);
|
let comment_input = InputState::builder().multiline().build(cx);
|
||||||
let directory = ProfileDirectory::new(cx);
|
let directory = ProfileDirectory::new(cx);
|
||||||
@@ -60,31 +112,54 @@ impl IssueDetailView {
|
|||||||
/// Track the issue author, everyone who commented and the repository owner.
|
/// Track the issue author, everyone who commented and the repository owner.
|
||||||
fn track_participants(&mut self, cx: &mut Context<Self>) {
|
fn track_participants(&mut self, cx: &mut Context<Self>) {
|
||||||
let store = self.store.read(cx);
|
let store = self.store.read(cx);
|
||||||
|
let owner = store.announcement.as_ref().map(|a| a.owner);
|
||||||
|
|
||||||
let author = store
|
let author = store
|
||||||
.issues
|
.issues
|
||||||
.iter()
|
.iter()
|
||||||
.find(|issue| issue.id == self.issue_id)
|
.find(|issue| issue.id == self.issue_id)
|
||||||
.map(|issue| issue.pubkey);
|
.map(|issue| issue.pubkey);
|
||||||
let owner = store.announcement.as_ref().map(|a| a.owner);
|
|
||||||
let comments: Vec<_> = store
|
let comments: Vec<_> = store
|
||||||
.comments_of(&self.issue_id)
|
.comments_of(&self.issue_id)
|
||||||
.map(|comment| comment.pubkey)
|
.map(|comment| comment.pubkey)
|
||||||
.collect();
|
.collect();
|
||||||
crate::shared::track_event_participants(
|
|
||||||
author,
|
track_event_participants(author, owner, comments.into_iter(), &self.directory, cx);
|
||||||
owner,
|
|
||||||
comments.into_iter(),
|
|
||||||
&self.directory,
|
|
||||||
cx,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Panel for IssueDetailView {
|
impl Panel for IssueDetailView {
|
||||||
fn title(&self, _cx: &App) -> SharedString {
|
fn title(&self, cx: &App) -> SharedString {
|
||||||
|
let subject = self
|
||||||
|
.store
|
||||||
|
.read(cx)
|
||||||
|
.issues
|
||||||
|
.iter()
|
||||||
|
.find(|issue| issue.id == self.issue_id)
|
||||||
|
.map(|issue| issue.activity_subject());
|
||||||
|
|
||||||
|
match subject {
|
||||||
|
Some(subject) => SharedString::from(format!("issue: {subject}")),
|
||||||
|
None => {
|
||||||
let hex = self.issue_id.to_hex();
|
let hex = self.issue_id.to_hex();
|
||||||
let short = hex.get(..8).unwrap_or(&hex);
|
let short = hex.get(..8).unwrap_or(&hex);
|
||||||
SharedString::from(format!("Issue {short}"))
|
SharedString::from(format!("issue: {short}"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn prefix(&self, cx: &App) -> Option<AnyElement> {
|
||||||
|
let owner = self.store.read(cx).announcement.as_ref().map(|a| a.owner)?;
|
||||||
|
let profile = self.directory.read(cx).profile(&owner, cx);
|
||||||
|
|
||||||
|
Some(
|
||||||
|
Avatar::new(owner)
|
||||||
|
.name(profile.name())
|
||||||
|
.picture(profile.picture())
|
||||||
|
.small()
|
||||||
|
.into_any_element(),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn loading(&self, cx: &App) -> bool {
|
fn loading(&self, cx: &App) -> bool {
|
||||||
@@ -112,7 +187,6 @@ impl Render for IssueDetailView {
|
|||||||
} else {
|
} else {
|
||||||
SharedString::from(&issue.content)
|
SharedString::from(&issue.content)
|
||||||
};
|
};
|
||||||
|
|
||||||
(
|
(
|
||||||
issue.activity_subject(),
|
issue.activity_subject(),
|
||||||
profile.name(),
|
profile.name(),
|
||||||
@@ -125,27 +199,22 @@ impl Render for IssueDetailView {
|
|||||||
};
|
};
|
||||||
let picture = self.directory.read(cx).profile(&pubkey, cx).picture();
|
let picture = self.directory.read(cx).profile(&pubkey, cx).picture();
|
||||||
|
|
||||||
h_flex()
|
div()
|
||||||
.id("issue-detail")
|
.id("issue-detail")
|
||||||
.size_full()
|
.size_full()
|
||||||
.child(
|
.child(
|
||||||
ScrollArea::new("issue-detail-scroll")
|
ScrollArea::new("issue-detail-scroll")
|
||||||
.handle(self.scroll_handle.clone())
|
.handle(self.scroll_handle.clone())
|
||||||
.flex_1()
|
.size_full()
|
||||||
.min_w_0()
|
|
||||||
.child(
|
.child(
|
||||||
v_flex()
|
v_flex()
|
||||||
.p_4()
|
.p_4()
|
||||||
.gap_6()
|
.gap_6()
|
||||||
.child(
|
.child(
|
||||||
h_flex().gap_2().child(status_badge(status)).child(
|
h_flex()
|
||||||
div()
|
.gap_2()
|
||||||
.flex_1()
|
.child(status_badge(status))
|
||||||
.min_w_0()
|
.child(div().flex_1().min_w_0().font_semibold().child(title)),
|
||||||
.text_sm()
|
|
||||||
.font_semibold()
|
|
||||||
.child(title),
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
.child(
|
.child(
|
||||||
v_flex()
|
v_flex()
|
||||||
@@ -156,7 +225,7 @@ impl Render for IssueDetailView {
|
|||||||
.child(
|
.child(
|
||||||
h_flex()
|
h_flex()
|
||||||
.gap_2()
|
.gap_2()
|
||||||
.text_base()
|
.text_sm()
|
||||||
.child(
|
.child(
|
||||||
h_flex()
|
h_flex()
|
||||||
.gap_1()
|
.gap_1()
|
||||||
@@ -183,7 +252,7 @@ impl Render for IssueDetailView {
|
|||||||
.child(SharedString::from(age)),
|
.child(SharedString::from(age)),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.child(div().text_base().child(content)),
|
.child(content),
|
||||||
)
|
)
|
||||||
.child(comments_section(
|
.child(comments_section(
|
||||||
&self.store,
|
&self.store,
|
||||||
@@ -202,14 +271,116 @@ impl Render for IssueDetailView {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.child(sidebar_section(
|
|
||||||
&self.store,
|
|
||||||
issue_id,
|
|
||||||
&store.issues,
|
|
||||||
true,
|
|
||||||
&self.directory,
|
|
||||||
cx,
|
|
||||||
))
|
|
||||||
.into_any_element()
|
.into_any_element()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// The issue's participant and label sidebar, shown in the split pane.
|
||||||
|
struct IssueSidebarView {
|
||||||
|
store: Entity<RepoStore>,
|
||||||
|
issue_id: EventId,
|
||||||
|
directory: Entity<ProfileDirectory>,
|
||||||
|
scroll_handle: ScrollHandle,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Panel for IssueSidebarView {
|
||||||
|
fn title(&self, _cx: &App) -> SharedString {
|
||||||
|
SharedString::from(SIDEBAR_ID)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Render for IssueSidebarView {
|
||||||
|
fn render(&mut self, _window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
|
||||||
|
let store = self.store.read(cx);
|
||||||
|
|
||||||
|
let details = store
|
||||||
|
.issues
|
||||||
|
.iter()
|
||||||
|
.find(|issue| issue.id == self.issue_id)
|
||||||
|
.map(|root| {
|
||||||
|
let mut participants = vec![root.pubkey];
|
||||||
|
participants.extend(store.comments_of(&root.id).map(|comment| comment.pubkey));
|
||||||
|
participants.sort_by_key(|key| key.to_hex());
|
||||||
|
participants.dedup();
|
||||||
|
|
||||||
|
let labels: Vec<String> = root.tags.hashtags().map(|tag| tag.to_string()).collect();
|
||||||
|
|
||||||
|
v_flex()
|
||||||
|
.gap_4()
|
||||||
|
.child(
|
||||||
|
v_flex()
|
||||||
|
.gap_2()
|
||||||
|
.child(
|
||||||
|
div()
|
||||||
|
.text_xs()
|
||||||
|
.font_medium()
|
||||||
|
.text_color(cx.theme().colors.muted_foreground)
|
||||||
|
.child("Participants"),
|
||||||
|
)
|
||||||
|
.children(participants.iter().map(|pubkey| {
|
||||||
|
let profile = self.directory.read(cx).profile(pubkey, cx);
|
||||||
|
let name = profile.name();
|
||||||
|
|
||||||
|
h_flex()
|
||||||
|
.gap_1()
|
||||||
|
.child(
|
||||||
|
Avatar::new(*pubkey)
|
||||||
|
.name(name.clone())
|
||||||
|
.picture(profile.picture())
|
||||||
|
.small(),
|
||||||
|
)
|
||||||
|
.child(
|
||||||
|
div()
|
||||||
|
.flex_1()
|
||||||
|
.min_w_0()
|
||||||
|
.whitespace_nowrap()
|
||||||
|
.text_sm()
|
||||||
|
.text_ellipsis()
|
||||||
|
.child(name),
|
||||||
|
)
|
||||||
|
.into_any_element()
|
||||||
|
})),
|
||||||
|
)
|
||||||
|
.child(
|
||||||
|
v_flex()
|
||||||
|
.gap_2()
|
||||||
|
.child(
|
||||||
|
div()
|
||||||
|
.text_xs()
|
||||||
|
.font_medium()
|
||||||
|
.text_color(cx.theme().colors.muted_foreground)
|
||||||
|
.child("Labels"),
|
||||||
|
)
|
||||||
|
.map(|this| {
|
||||||
|
if labels.is_empty() {
|
||||||
|
this.child(
|
||||||
|
div()
|
||||||
|
.text_sm()
|
||||||
|
.text_color(cx.theme().colors.muted_foreground)
|
||||||
|
.child("None yet."),
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
this.child(v_flex().gap_1().items_start().children(
|
||||||
|
labels.iter().map(|label| {
|
||||||
|
Badge::new(
|
||||||
|
SharedString::from(format!("label:{label}")),
|
||||||
|
label.clone(),
|
||||||
|
)
|
||||||
|
.variant(BadgeVariant::Outline)
|
||||||
|
.small()
|
||||||
|
.flex_none()
|
||||||
|
}),
|
||||||
|
))
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
.into_any_element()
|
||||||
|
})
|
||||||
|
.unwrap_or_else(|| div().into_any_element());
|
||||||
|
|
||||||
|
ScrollArea::new("issue-sidebar-scroll")
|
||||||
|
.handle(self.scroll_handle.clone())
|
||||||
|
.size_full()
|
||||||
|
.child(v_flex().w_full().p_4().child(details))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
use gpui::prelude::FluentBuilder as _;
|
|
||||||
use gpui::{
|
use gpui::{
|
||||||
AnyElement, App, Entity, IntoElement, ParentElement as _, SharedString, Styled as _, div, px,
|
AnyElement, App, Entity, IntoElement, ParentElement as _, SharedString, Styled as _, div, px,
|
||||||
};
|
};
|
||||||
use metadata::ProfileDirectory;
|
use metadata::ProfileDirectory;
|
||||||
use nostr::prelude::{Event, EventId, PublicKey};
|
use nostr::prelude::{Event, EventId};
|
||||||
use signed_core::RepoStatus;
|
use signed_core::RepoStatus;
|
||||||
use signed_state::RepoStore;
|
use signed_state::RepoStore;
|
||||||
use ui::avatar::Avatar;
|
use ui::avatar::Avatar;
|
||||||
use ui::badge::{Badge, BadgeVariant};
|
|
||||||
use ui::button::Button;
|
use ui::button::Button;
|
||||||
use ui::common::{Sizable as _, StyledExt as _, h_flex, v_flex};
|
use ui::common::{Sizable as _, StyledExt as _, h_flex, v_flex};
|
||||||
use ui::icons::{Icon, IconRole};
|
use ui::icons::{Icon, IconRole};
|
||||||
@@ -76,98 +74,6 @@ pub(crate) fn filter_by_status<'a>(
|
|||||||
(visible, counts)
|
(visible, counts)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn sidebar_section(
|
|
||||||
store: &Entity<RepoStore>,
|
|
||||||
id: EventId,
|
|
||||||
roots: &[Event],
|
|
||||||
top_gap: bool,
|
|
||||||
directory: &Entity<ProfileDirectory>,
|
|
||||||
cx: &App,
|
|
||||||
) -> AnyElement {
|
|
||||||
let store = store.read(cx);
|
|
||||||
let Some(root) = roots.iter().find(|event| event.id == id) else {
|
|
||||||
return div().into_any_element();
|
|
||||||
};
|
|
||||||
|
|
||||||
let mut participants: Vec<PublicKey> = vec![root.pubkey];
|
|
||||||
participants.extend(store.comments_of(&root.id).map(|comment| comment.pubkey));
|
|
||||||
participants.sort_by_key(PublicKey::to_hex);
|
|
||||||
participants.dedup();
|
|
||||||
|
|
||||||
let labels: Vec<String> = root.tags.hashtags().map(|tag| tag.to_string()).collect();
|
|
||||||
|
|
||||||
v_flex()
|
|
||||||
.w(px(240.))
|
|
||||||
.h_full()
|
|
||||||
.flex_none()
|
|
||||||
.px_4()
|
|
||||||
.gap_4()
|
|
||||||
.border_l_1()
|
|
||||||
.border_color(cx.theme().colors.border)
|
|
||||||
.child(
|
|
||||||
v_flex()
|
|
||||||
.when(top_gap, |this| this.mt_4())
|
|
||||||
.gap_2()
|
|
||||||
.child(
|
|
||||||
div()
|
|
||||||
.text_xs()
|
|
||||||
.font_medium()
|
|
||||||
.text_color(cx.theme().colors.muted_foreground)
|
|
||||||
.child("Participants"),
|
|
||||||
)
|
|
||||||
.children(participants.iter().map(|pubkey| {
|
|
||||||
let profile = directory.read(cx).profile(pubkey, cx);
|
|
||||||
let name = profile.name();
|
|
||||||
|
|
||||||
h_flex()
|
|
||||||
.gap_1()
|
|
||||||
.child(
|
|
||||||
Avatar::new(*pubkey)
|
|
||||||
.name(name.clone())
|
|
||||||
.picture(profile.picture())
|
|
||||||
.small(),
|
|
||||||
)
|
|
||||||
.child(
|
|
||||||
div()
|
|
||||||
.flex_1()
|
|
||||||
.min_w_0()
|
|
||||||
.whitespace_nowrap()
|
|
||||||
.text_base()
|
|
||||||
.text_ellipsis()
|
|
||||||
.child(name),
|
|
||||||
)
|
|
||||||
.into_any_element()
|
|
||||||
})),
|
|
||||||
)
|
|
||||||
.child(
|
|
||||||
v_flex()
|
|
||||||
.gap_2()
|
|
||||||
.child(
|
|
||||||
div()
|
|
||||||
.text_xs()
|
|
||||||
.font_medium()
|
|
||||||
.text_color(cx.theme().colors.muted_foreground)
|
|
||||||
.child("Labels"),
|
|
||||||
)
|
|
||||||
.map(|this| {
|
|
||||||
if labels.is_empty() {
|
|
||||||
this.child(
|
|
||||||
div()
|
|
||||||
.text_base()
|
|
||||||
.text_color(cx.theme().colors.muted_foreground)
|
|
||||||
.child("None yet."),
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
this.child(v_flex().gap_1().children(labels.iter().map(|label| {
|
|
||||||
Badge::new(SharedString::from(format!("label:{label}")), label.clone())
|
|
||||||
.variant(BadgeVariant::Outline)
|
|
||||||
})))
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
.into_any_element()
|
|
||||||
}
|
|
||||||
|
|
||||||
pub(crate) fn comments_section(
|
pub(crate) fn comments_section(
|
||||||
store: &Entity<RepoStore>,
|
store: &Entity<RepoStore>,
|
||||||
root: EventId,
|
root: EventId,
|
||||||
@@ -180,7 +86,7 @@ pub(crate) fn comments_section(
|
|||||||
|
|
||||||
v_flex()
|
v_flex()
|
||||||
.gap_4()
|
.gap_4()
|
||||||
.child(div().text_xs().font_medium().child(title))
|
.child(div().text_xs().font_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();
|
||||||
@@ -196,7 +102,7 @@ pub(crate) fn comments_section(
|
|||||||
.child(
|
.child(
|
||||||
h_flex()
|
h_flex()
|
||||||
.gap_2()
|
.gap_2()
|
||||||
.text_base()
|
.text_sm()
|
||||||
.child(
|
.child(
|
||||||
h_flex()
|
h_flex()
|
||||||
.gap_1()
|
.gap_1()
|
||||||
@@ -219,7 +125,7 @@ pub(crate) fn comments_section(
|
|||||||
.child(SharedString::from(age)),
|
.child(SharedString::from(age)),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.child(div().text_base().child(content))
|
.child(div().text_sm().child(content))
|
||||||
}))
|
}))
|
||||||
.into_any_element()
|
.into_any_element()
|
||||||
}
|
}
|
||||||
@@ -242,8 +148,8 @@ pub(crate) fn comment_form(
|
|||||||
.gap_2()
|
.gap_2()
|
||||||
.child(
|
.child(
|
||||||
Input::new("comment-input", comment_input.clone())
|
Input::new("comment-input", comment_input.clone())
|
||||||
.rows(4)
|
.placeholder("Leave a comment...")
|
||||||
.placeholder("Leave a comment..."),
|
.rows(4),
|
||||||
)
|
)
|
||||||
.child(
|
.child(
|
||||||
h_flex()
|
h_flex()
|
||||||
|
|||||||
@@ -264,38 +264,20 @@ impl Render for IssuesView {
|
|||||||
.border_color(cx.theme().colors.border)
|
.border_color(cx.theme().colors.border)
|
||||||
.hover(|this| this.bg(cx.theme().colors.muted_hover))
|
.hover(|this| this.bg(cx.theme().colors.muted_hover))
|
||||||
.on_click(move |_, window, cx| {
|
.on_click(move |_, window, cx| {
|
||||||
let id =
|
IssueDetailView::open(
|
||||||
SharedString::from(format!("issue:{issue_id}"));
|
&workspace,
|
||||||
let store = store.clone();
|
|
||||||
log_dropped(workspace.update(cx, |root, cx| {
|
|
||||||
root.panels().clone().update(
|
|
||||||
cx,
|
|
||||||
|panels, cx| {
|
|
||||||
panels.open(
|
|
||||||
PanelSlot::Main,
|
|
||||||
id,
|
|
||||||
move |_, cx| {
|
|
||||||
cx.new(|cx| {
|
|
||||||
IssueDetailView::new(
|
|
||||||
store.clone(),
|
store.clone(),
|
||||||
issue_id,
|
issue_id,
|
||||||
cx,
|
|
||||||
)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
window,
|
window,
|
||||||
cx,
|
cx,
|
||||||
)
|
);
|
||||||
},
|
|
||||||
)
|
|
||||||
}));
|
|
||||||
})
|
})
|
||||||
.child(
|
.child(
|
||||||
h_flex()
|
h_flex()
|
||||||
.w_full()
|
.w_full()
|
||||||
.items_start()
|
.items_start()
|
||||||
.gap_2()
|
.gap_2()
|
||||||
.child(h_flex().w_24().child(status_badge(status)))
|
.child(h_flex().w_20().child(status_badge(status)))
|
||||||
.child(
|
.child(
|
||||||
v_flex()
|
v_flex()
|
||||||
.flex_1()
|
.flex_1()
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ impl Render for NewIssueView {
|
|||||||
.child(
|
.child(
|
||||||
div()
|
div()
|
||||||
.pr_16()
|
.pr_16()
|
||||||
.text_base()
|
.text_sm()
|
||||||
.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."),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -5,7 +5,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 _, Render, SharedString, StatefulInteractiveElement as _, StyleRefinement,
|
ParentElement as _, Render, SharedString, StatefulInteractiveElement as _, StyleRefinement,
|
||||||
Styled as _, Subscription, UniformListScrollHandle, WeakEntity, Window, div, uniform_list,
|
Styled as _, Subscription, UniformListScrollHandle, WeakEntity, Window, div, px, uniform_list,
|
||||||
};
|
};
|
||||||
use metadata::ProfileDirectory;
|
use metadata::ProfileDirectory;
|
||||||
use nostr::prelude::{EventId, Kind, Url};
|
use nostr::prelude::{EventId, Kind, Url};
|
||||||
@@ -13,6 +13,7 @@ use signed_core::{GitEvent, PullRequest, RepoAddr};
|
|||||||
use signed_git::{FileCommit, PatchParser};
|
use signed_git::{FileCommit, PatchParser};
|
||||||
use signed_state::{Backend, BackendEvent, Mirrors, RepoStore};
|
use signed_state::{Backend, BackendEvent, Mirrors, RepoStore};
|
||||||
use ui::avatar::Avatar;
|
use ui::avatar::Avatar;
|
||||||
|
use ui::badge::{Badge, BadgeVariant};
|
||||||
use ui::button::Button;
|
use ui::button::Button;
|
||||||
use ui::clipboard::ClipboardButton;
|
use ui::clipboard::ClipboardButton;
|
||||||
use ui::common::{Sizable as _, StyledExt as _, h_flex, v_flex};
|
use ui::common::{Sizable as _, StyledExt as _, h_flex, v_flex};
|
||||||
@@ -29,7 +30,7 @@ use ui::theme::ActiveTheme as _;
|
|||||||
use utils::{relative_time, relative_time_secs};
|
use utils::{relative_time, relative_time_secs};
|
||||||
|
|
||||||
use crate::app::AppRoot;
|
use crate::app::AppRoot;
|
||||||
use crate::issues::helpers::{comment_form, comments_section, sidebar_section};
|
use crate::issues::helpers::{comment_form, comments_section};
|
||||||
use crate::pull_requests::dialogs::update::UpdatePrDialog;
|
use crate::pull_requests::dialogs::update::UpdatePrDialog;
|
||||||
use crate::repo::commit_diff::{CommitDiffView, DiffPane};
|
use crate::repo::commit_diff::{CommitDiffView, DiffPane};
|
||||||
use crate::repo::helpers::short_id;
|
use crate::repo::helpers::short_id;
|
||||||
@@ -401,6 +402,91 @@ impl PullRequestDetailView {
|
|||||||
|
|
||||||
let store = self.store.read(cx);
|
let store = self.store.read(cx);
|
||||||
|
|
||||||
|
let details = store
|
||||||
|
.pull_requests
|
||||||
|
.iter()
|
||||||
|
.find(|pr| pr.id == root_id)
|
||||||
|
.map(|root| {
|
||||||
|
let mut participants = vec![root.pubkey];
|
||||||
|
participants.extend(store.comments_of(&root.id).map(|comment| comment.pubkey));
|
||||||
|
participants.sort_by_key(|key| key.to_hex());
|
||||||
|
participants.dedup();
|
||||||
|
|
||||||
|
let labels: Vec<String> = root.tags.hashtags().map(|tag| tag.to_string()).collect();
|
||||||
|
|
||||||
|
v_flex()
|
||||||
|
.gap_4()
|
||||||
|
.child(
|
||||||
|
v_flex()
|
||||||
|
.gap_2()
|
||||||
|
.child(
|
||||||
|
div()
|
||||||
|
.text_xs()
|
||||||
|
.font_medium()
|
||||||
|
.text_color(cx.theme().colors.muted_foreground)
|
||||||
|
.child("Participants"),
|
||||||
|
)
|
||||||
|
.children(participants.iter().map(|pubkey| {
|
||||||
|
let profile = self.directory.read(cx).profile(pubkey, cx);
|
||||||
|
let name = profile.name();
|
||||||
|
|
||||||
|
h_flex()
|
||||||
|
.gap_1()
|
||||||
|
.child(
|
||||||
|
Avatar::new(*pubkey)
|
||||||
|
.name(name.clone())
|
||||||
|
.picture(profile.picture())
|
||||||
|
.small(),
|
||||||
|
)
|
||||||
|
.child(
|
||||||
|
div()
|
||||||
|
.flex_1()
|
||||||
|
.min_w_0()
|
||||||
|
.whitespace_nowrap()
|
||||||
|
.text_sm()
|
||||||
|
.text_ellipsis()
|
||||||
|
.child(name),
|
||||||
|
)
|
||||||
|
.into_any_element()
|
||||||
|
})),
|
||||||
|
)
|
||||||
|
.child(
|
||||||
|
v_flex()
|
||||||
|
.gap_2()
|
||||||
|
.child(
|
||||||
|
div()
|
||||||
|
.text_xs()
|
||||||
|
.font_medium()
|
||||||
|
.text_color(cx.theme().colors.muted_foreground)
|
||||||
|
.child("Labels"),
|
||||||
|
)
|
||||||
|
.map(|this| {
|
||||||
|
if labels.is_empty() {
|
||||||
|
this.child(
|
||||||
|
div()
|
||||||
|
.text_sm()
|
||||||
|
.text_color(cx.theme().colors.muted_foreground)
|
||||||
|
.child("None yet."),
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
this.child(v_flex().gap_1().items_start().children(
|
||||||
|
labels.iter().map(|label| {
|
||||||
|
Badge::new(
|
||||||
|
SharedString::from(format!("label:{label}")),
|
||||||
|
label.clone(),
|
||||||
|
)
|
||||||
|
.variant(BadgeVariant::Outline)
|
||||||
|
.small()
|
||||||
|
.flex_none()
|
||||||
|
}),
|
||||||
|
))
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
.into_any_element()
|
||||||
|
})
|
||||||
|
.unwrap_or_else(|| div().into_any_element());
|
||||||
|
|
||||||
h_flex()
|
h_flex()
|
||||||
.size_full()
|
.size_full()
|
||||||
.min_h_0()
|
.min_h_0()
|
||||||
@@ -418,7 +504,7 @@ impl PullRequestDetailView {
|
|||||||
.child(
|
.child(
|
||||||
h_flex()
|
h_flex()
|
||||||
.gap_2()
|
.gap_2()
|
||||||
.text_base()
|
.text_sm()
|
||||||
.child(
|
.child(
|
||||||
h_flex()
|
h_flex()
|
||||||
.gap_1()
|
.gap_1()
|
||||||
@@ -438,9 +524,7 @@ impl PullRequestDetailView {
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
.when(!self.description.is_empty(), |this| {
|
.when(!self.description.is_empty(), |this| {
|
||||||
this.child(
|
this.child(div().text_sm().child(self.description.clone()))
|
||||||
div().text_base().child(self.description.clone()),
|
|
||||||
)
|
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.child(comments_section(&self.store, root_id, &self.directory, cx))
|
.child(comments_section(&self.store, root_id, &self.directory, cx))
|
||||||
@@ -454,14 +538,17 @@ impl PullRequestDetailView {
|
|||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.child(sidebar_section(
|
.child(
|
||||||
&self.store,
|
v_flex()
|
||||||
root_id,
|
.w(px(240.))
|
||||||
&store.pull_requests,
|
.h_full()
|
||||||
true,
|
.flex_none()
|
||||||
&self.directory,
|
.px_4()
|
||||||
cx,
|
.pt_4()
|
||||||
))
|
.border_l_1()
|
||||||
|
.border_color(cx.theme().colors.border)
|
||||||
|
.child(details),
|
||||||
|
)
|
||||||
.into_any_element()
|
.into_any_element()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ impl Render for UpdatePrDialog {
|
|||||||
.gap_3()
|
.gap_3()
|
||||||
.child(
|
.child(
|
||||||
div()
|
div()
|
||||||
.text_base()
|
.text_sm()
|
||||||
.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`."),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -406,7 +406,7 @@ impl Render for PullRequestsView {
|
|||||||
.w_full()
|
.w_full()
|
||||||
.items_start()
|
.items_start()
|
||||||
.gap_2()
|
.gap_2()
|
||||||
.child(h_flex().w_24().child(status_badge(status)))
|
.child(h_flex().w_20().child(status_badge(status)))
|
||||||
.child(
|
.child(
|
||||||
v_flex()
|
v_flex()
|
||||||
.flex_1()
|
.flex_1()
|
||||||
|
|||||||
@@ -61,19 +61,7 @@ pub fn open_repo_item(
|
|||||||
let store = cx.new(|cx| RepoStore::new(addr.clone(), hint.cloned(), cx));
|
let store = cx.new(|cx| RepoStore::new(addr.clone(), hint.cloned(), cx));
|
||||||
match item {
|
match item {
|
||||||
RepoItem::Issue(issue_id) => {
|
RepoItem::Issue(issue_id) => {
|
||||||
let id = SharedString::from(format!("issue:{issue_id}"));
|
IssueDetailView::open(workspace, store, issue_id, window, cx);
|
||||||
let store = store.clone();
|
|
||||||
log_dropped(workspace.update(cx, |root, cx| {
|
|
||||||
root.panels().update(cx, |panels, cx| {
|
|
||||||
panels.open(
|
|
||||||
PanelSlot::Main,
|
|
||||||
id,
|
|
||||||
move |_, cx| cx.new(|cx| IssueDetailView::new(store.clone(), issue_id, cx)),
|
|
||||||
window,
|
|
||||||
cx,
|
|
||||||
)
|
|
||||||
})
|
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
RepoItem::PullRequest(pr_id) => {
|
RepoItem::PullRequest(pr_id) => {
|
||||||
let id = SharedString::from(format!("pr:{pr_id}"));
|
let id = SharedString::from(format!("pr:{pr_id}"));
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ where
|
|||||||
T: Into<SharedString>,
|
T: Into<SharedString>,
|
||||||
{
|
{
|
||||||
div()
|
div()
|
||||||
.text_base()
|
.text_sm()
|
||||||
.w_full()
|
.w_full()
|
||||||
.min_w_0()
|
.min_w_0()
|
||||||
.child(value.into())
|
.child(value.into())
|
||||||
@@ -217,7 +217,7 @@ fn maintainers(
|
|||||||
.overflow_hidden()
|
.overflow_hidden()
|
||||||
.whitespace_nowrap()
|
.whitespace_nowrap()
|
||||||
.text_ellipsis()
|
.text_ellipsis()
|
||||||
.text_base()
|
.text_sm()
|
||||||
.child(name),
|
.child(name),
|
||||||
)
|
)
|
||||||
.into_any_element()
|
.into_any_element()
|
||||||
@@ -244,7 +244,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_base()
|
.text_sm()
|
||||||
.child(SharedString::from(middle_truncate(&item, 28, 16))),
|
.child(SharedString::from(middle_truncate(&item, 28, 16))),
|
||||||
)
|
)
|
||||||
.child(ClipboardButton::new(
|
.child(ClipboardButton::new(
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ impl Render for SyncErrorDialog {
|
|||||||
.title("Sync failed")
|
.title("Sync failed")
|
||||||
.content(move |_, cx| {
|
.content(move |_, cx| {
|
||||||
div()
|
div()
|
||||||
.text_base()
|
.text_sm()
|
||||||
.text_color(cx.theme().colors.muted_foreground)
|
.text_color(cx.theme().colors.muted_foreground)
|
||||||
.child(message.clone())
|
.child(message.clone())
|
||||||
.into_any_element()
|
.into_any_element()
|
||||||
@@ -88,7 +88,7 @@ impl Render for DeleteRepositoryDialog {
|
|||||||
.title("Delete repository")
|
.title("Delete repository")
|
||||||
.content(|_, cx| {
|
.content(|_, cx| {
|
||||||
div()
|
div()
|
||||||
.text_base()
|
.text_sm()
|
||||||
.text_color(cx.theme().colors.muted_foreground)
|
.text_color(cx.theme().colors.muted_foreground)
|
||||||
.child(WARNING)
|
.child(WARNING)
|
||||||
.into_any_element()
|
.into_any_element()
|
||||||
|
|||||||
@@ -66,27 +66,27 @@ impl Render for ResetRemoteDialog {
|
|||||||
.gap_2()
|
.gap_2()
|
||||||
.child(
|
.child(
|
||||||
div()
|
div()
|
||||||
.text_base()
|
.text_sm()
|
||||||
.text_color(cx.theme().colors.muted_foreground)
|
.text_color(cx.theme().colors.muted_foreground)
|
||||||
.child(WARNING),
|
.child(WARNING),
|
||||||
)
|
)
|
||||||
.when(!unreachable.is_empty(), |this| {
|
.when(!unreachable.is_empty(), |this| {
|
||||||
this.child(
|
this.child(
|
||||||
div()
|
div()
|
||||||
.text_base()
|
.text_sm()
|
||||||
.text_color(cx.theme().ramps.destructive.base)
|
.text_color(cx.theme().ramps.destructive.base)
|
||||||
.child(ERROR),
|
.child(ERROR),
|
||||||
)
|
)
|
||||||
.children(unreachable.iter().map(|url| {
|
.children(unreachable.iter().map(|url| {
|
||||||
div()
|
div()
|
||||||
.text_base()
|
.text_sm()
|
||||||
.font_family(cx.theme().mono_font)
|
.font_family(cx.theme().mono_font)
|
||||||
.child(url.clone())
|
.child(url.clone())
|
||||||
}))
|
}))
|
||||||
})
|
})
|
||||||
.child(if deleted.is_empty() {
|
.child(if deleted.is_empty() {
|
||||||
div()
|
div()
|
||||||
.text_base()
|
.text_sm()
|
||||||
.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()
|
||||||
@@ -95,7 +95,7 @@ impl Render for ResetRemoteDialog {
|
|||||||
.gap_1()
|
.gap_1()
|
||||||
.children(deleted.iter().map(|name| {
|
.children(deleted.iter().map(|name| {
|
||||||
div()
|
div()
|
||||||
.text_base()
|
.text_sm()
|
||||||
.font_family(cx.theme().mono_font)
|
.font_family(cx.theme().mono_font)
|
||||||
.child(name.clone())
|
.child(name.clone())
|
||||||
}))
|
}))
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ use ui::combobox::ComboboxState;
|
|||||||
use ui::common::{Sizable as _, StyledExt as _, h_flex, v_flex};
|
use ui::common::{Sizable as _, StyledExt as _, h_flex, v_flex};
|
||||||
use ui::icons::{Icon, IconRole};
|
use ui::icons::{Icon, IconRole};
|
||||||
use ui::theme::ActiveTheme as _;
|
use ui::theme::ActiveTheme as _;
|
||||||
|
use ui::tree::TreeItemSeed;
|
||||||
|
|
||||||
use super::RepoDetailView;
|
use super::RepoDetailView;
|
||||||
use ui::tree::TreeItemSeed;
|
|
||||||
|
|
||||||
const GUTTER_WIDTH: f32 = 44.;
|
const GUTTER_WIDTH: f32 = 44.;
|
||||||
pub const DIFF_ROW_HEIGHT: f32 = 20.;
|
pub const DIFF_ROW_HEIGHT: f32 = 20.;
|
||||||
@@ -234,7 +234,7 @@ pub(super) fn fork_row(
|
|||||||
let row = h_flex()
|
let row = h_flex()
|
||||||
.gap_1()
|
.gap_1()
|
||||||
.min_w_0()
|
.min_w_0()
|
||||||
.text_base()
|
.text_sm()
|
||||||
.text_color(cx.theme().colors.muted_foreground)
|
.text_color(cx.theme().colors.muted_foreground)
|
||||||
.child(Icon::named(IconRole::GitBranch).small())
|
.child(Icon::named(IconRole::GitBranch).small())
|
||||||
.child(
|
.child(
|
||||||
@@ -307,7 +307,7 @@ pub(super) fn bound_repo_label(
|
|||||||
h_flex()
|
h_flex()
|
||||||
.flex_shrink_0()
|
.flex_shrink_0()
|
||||||
.gap_2()
|
.gap_2()
|
||||||
.text_base()
|
.text_sm()
|
||||||
.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| {
|
||||||
|
|||||||
@@ -1132,7 +1132,7 @@ impl RepoDetailView {
|
|||||||
.child(Spinner::new("repo-loading"))
|
.child(Spinner::new("repo-loading"))
|
||||||
.child(
|
.child(
|
||||||
div()
|
div()
|
||||||
.text_base()
|
.text_sm()
|
||||||
.text_color(cx.theme().colors.muted_foreground)
|
.text_color(cx.theme().colors.muted_foreground)
|
||||||
.child(label),
|
.child(label),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -100,7 +100,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_base()
|
.text_sm()
|
||||||
.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()
|
||||||
@@ -121,14 +121,14 @@ 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_base()
|
.text_sm()
|
||||||
.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_base()
|
.text_sm()
|
||||||
.text_color(cx.theme().colors.foreground)
|
.text_color(cx.theme().colors.foreground)
|
||||||
.child(
|
.child(
|
||||||
Icon::named(IconRole::Check)
|
Icon::named(IconRole::Check)
|
||||||
@@ -139,7 +139,7 @@ pub fn push_steps_row(steps: &[PushStepStatus], cx: &App) -> Option<AnyElement>
|
|||||||
.into_any_element(),
|
.into_any_element(),
|
||||||
PushStepStatus::Failed(_, reason) => h_flex()
|
PushStepStatus::Failed(_, reason) => h_flex()
|
||||||
.gap_2()
|
.gap_2()
|
||||||
.text_base()
|
.text_sm()
|
||||||
.text_color(cx.theme().ramps.destructive.base)
|
.text_color(cx.theme().ramps.destructive.base)
|
||||||
.child(
|
.child(
|
||||||
Icon::named(IconRole::Close)
|
Icon::named(IconRole::Close)
|
||||||
|
|||||||
@@ -232,7 +232,7 @@ impl RenderOnce for CopyRow {
|
|||||||
.overflow_hidden()
|
.overflow_hidden()
|
||||||
.whitespace_nowrap()
|
.whitespace_nowrap()
|
||||||
.text_ellipsis()
|
.text_ellipsis()
|
||||||
.when(self.large_text, |text| text.text_base())
|
.when(self.large_text, |text| text.text_sm())
|
||||||
.when(!self.large_text, |text| {
|
.when(!self.large_text, |text| {
|
||||||
text.font_family(theme.mono_font).text_xs()
|
text.font_family(theme.mono_font).text_xs()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -373,7 +373,7 @@ impl<E: Styled> ControlSizing for E {
|
|||||||
Size::XSmall => self.text_xs(),
|
Size::XSmall => self.text_xs(),
|
||||||
Size::Small => self.text_xs(),
|
Size::Small => self.text_xs(),
|
||||||
Size::Medium => self.text_sm(),
|
Size::Medium => self.text_sm(),
|
||||||
Size::Large => self.text_base(),
|
Size::Large => self.text_sm(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ impl RenderOnce for EmptyState {
|
|||||||
})
|
})
|
||||||
.child(
|
.child(
|
||||||
div()
|
div()
|
||||||
.text_base()
|
.text_sm()
|
||||||
.font_semibold()
|
.font_semibold()
|
||||||
.text_color(foreground)
|
.text_color(foreground)
|
||||||
.child(self.headline),
|
.child(self.headline),
|
||||||
|
|||||||
@@ -1432,7 +1432,7 @@ fn heading_row(
|
|||||||
.map(|frame| match level {
|
.map(|frame| match level {
|
||||||
MarkdownHeading::H1 => frame.text_xl().font_semibold(),
|
MarkdownHeading::H1 => frame.text_xl().font_semibold(),
|
||||||
MarkdownHeading::H2 => frame.text_lg().font_semibold(),
|
MarkdownHeading::H2 => frame.text_lg().font_semibold(),
|
||||||
MarkdownHeading::H3 => frame.text_base().font_semibold(),
|
MarkdownHeading::H3 => frame.text_sm().font_semibold(),
|
||||||
MarkdownHeading::H4 | MarkdownHeading::H5 | MarkdownHeading::H6 => {
|
MarkdownHeading::H4 | MarkdownHeading::H5 | MarkdownHeading::H6 => {
|
||||||
frame.text_sm().font_semibold()
|
frame.text_sm().font_semibold()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user