Vendor the native UI kit as crates/ui
- crates/ui holds the theme, icons, components, data widgets, editor surfaces, layout, and utilities; cargo feature gates are gone. - One merged icon set of 154 SVGs where the app file wins every duplicate name, served by a single rust-embed Assets source. - IconRole grows the 25 app glyphs, so assets::CustomIconName and crates/assets are deleted. - ui::init owns the theme and key bindings that desktop used to bind in three calls. - docs/gpui-native-kit-gaps.md becomes docs/ui-gaps.md; the icon gap is closed.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use gpui::App;
|
||||
use gpui_native_kit::theme::{ThemeVariant, follow_system, set_mode_override};
|
||||
use settings::{AppearanceMode, Settings};
|
||||
use ui::theme::{ThemeVariant, follow_system, set_mode_override};
|
||||
|
||||
/// Applies the persisted light/dark/system preference to the kit theme.
|
||||
pub fn apply_appearance(settings: &Settings, cx: &mut App) {
|
||||
|
||||
@@ -6,15 +6,15 @@ use gpui::{
|
||||
AppContext as _, Context, Entity, IntoElement, ParentElement as _, Render, Styled as _,
|
||||
Subscription, Window, div,
|
||||
};
|
||||
use gpui_native_kit::icons::IconRole;
|
||||
use gpui_native_kit::layout::panel::PanelRow;
|
||||
use gpui_native_kit::layout::shell::Shell;
|
||||
use gpui_native_kit::layout::titlebar::Titlebar;
|
||||
use gpui_native_kit::theme::ActiveTheme as _;
|
||||
use gpui_native_kit::toast::{Toast, Toasts};
|
||||
use helpers::apply_appearance;
|
||||
use settings::SettingsStore;
|
||||
use signed_state::{Backend, BackendEvent};
|
||||
use ui::icons::IconRole;
|
||||
use ui::layout::panel::PanelRow;
|
||||
use ui::layout::shell::Shell;
|
||||
use ui::layout::titlebar::Titlebar;
|
||||
use ui::theme::ActiveTheme as _;
|
||||
use ui::toast::{Toast, Toasts};
|
||||
|
||||
use crate::app::placeholder::PlaceholderView;
|
||||
use crate::app::sign_in::SignedOutView;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use gpui::{
|
||||
Context, IntoElement, ParentElement as _, Render, SharedString, Styled as _, Window, div,
|
||||
};
|
||||
use gpui_native_kit::empty_state::EmptyState;
|
||||
use gpui_native_kit::layout::panel::Panel;
|
||||
use ui::empty_state::EmptyState;
|
||||
use ui::layout::panel::Panel;
|
||||
|
||||
/// A tab that stands in for a screen that is not ported yet.
|
||||
pub struct PlaceholderView {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
use gpui::{
|
||||
Context, FontWeight, IntoElement, ParentElement as _, Render, Styled as _, Window, div,
|
||||
};
|
||||
use gpui_native_kit::button::{Button, ButtonVariant};
|
||||
use gpui_native_kit::common::v_flex;
|
||||
use gpui_native_kit::layout::panel::Panel;
|
||||
use ui::button::{Button, ButtonVariant};
|
||||
use ui::common::v_flex;
|
||||
use ui::layout::panel::Panel;
|
||||
|
||||
use crate::identity;
|
||||
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
use assets::CustomIconName;
|
||||
use gpui::prelude::FluentBuilder as _;
|
||||
use gpui::{
|
||||
AnyElement, Entity, InteractiveElement as _, IntoElement, ParentElement as _, SharedString,
|
||||
StatefulInteractiveElement as _, Styled as _, WeakEntity, div, px,
|
||||
};
|
||||
use gpui_native_kit::avatar::Avatar;
|
||||
use gpui_native_kit::common::{Sizable as _, h_flex, v_flex};
|
||||
use gpui_native_kit::icons::Icon;
|
||||
use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use metadata::ProfileDirectory;
|
||||
use signed_core::Announcement;
|
||||
use signed_state::{RepoListStore, Timestamp};
|
||||
use ui::avatar::Avatar;
|
||||
use ui::common::{Sizable as _, h_flex, v_flex};
|
||||
use ui::icons::{Icon, IconRole};
|
||||
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use utils::relative_time;
|
||||
|
||||
use crate::repo::actions::open_repo_panel;
|
||||
@@ -134,7 +133,7 @@ pub(super) fn render_card(
|
||||
.text_color(cx.theme().colors.muted_foreground)
|
||||
.whitespace_nowrap()
|
||||
.child(
|
||||
Icon::named(CustomIconName::GitBranch)
|
||||
Icon::named(IconRole::GitBranch)
|
||||
.size(px(12.))
|
||||
.color(cx.theme().colors.muted_foreground),
|
||||
)
|
||||
|
||||
@@ -1,24 +1,23 @@
|
||||
mod helpers;
|
||||
|
||||
use assets::CustomIconName;
|
||||
use gpui::prelude::FluentBuilder as _;
|
||||
use gpui::{
|
||||
AnyElement, Context, Entity, InteractiveElement as _, IntoElement, ParentElement as _, Render,
|
||||
SharedString, Styled as _, Subscription, UniformListScrollHandle, WeakEntity, Window, div, px,
|
||||
uniform_list,
|
||||
};
|
||||
use gpui_native_kit::common::{h_flex, v_flex};
|
||||
use gpui_native_kit::empty_state::EmptyState;
|
||||
use gpui_native_kit::icons::{Icon, IconRole};
|
||||
use gpui_native_kit::input::{Input, InputState, InputStateEvent};
|
||||
use gpui_native_kit::layout::panel::Panel;
|
||||
use gpui_native_kit::scrollbar::Scrollbar;
|
||||
use gpui_native_kit::segmented::{Segmented, SegmentedOption};
|
||||
use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use helpers::{RepoFilter, render_card};
|
||||
use metadata::ProfileDirectory;
|
||||
use nostr::prelude::PublicKey;
|
||||
use signed_state::RepoListStore;
|
||||
use ui::common::{h_flex, v_flex};
|
||||
use ui::empty_state::EmptyState;
|
||||
use ui::icons::{Icon, IconRole};
|
||||
use ui::input::{Input, InputState, InputStateEvent};
|
||||
use ui::layout::panel::Panel;
|
||||
use ui::scrollbar::Scrollbar;
|
||||
use ui::segmented::{Segmented, SegmentedOption};
|
||||
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
|
||||
use crate::workspace::Workspace;
|
||||
|
||||
@@ -131,7 +130,7 @@ impl ExploreView {
|
||||
SegmentedOption::new(RepoFilter::All, "All")
|
||||
.icon(Icon::named(IconRole::Grid).small().color(muted)),
|
||||
SegmentedOption::new(RepoFilter::Popular, "Popular")
|
||||
.icon(Icon::named(CustomIconName::Trending).small().color(muted)),
|
||||
.icon(Icon::named(IconRole::Trending).small().color(muted)),
|
||||
SegmentedOption::new(RepoFilter::Recent, "Recent")
|
||||
.icon(Icon::named(IconRole::Clock).small().color(muted)),
|
||||
])
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
use gpui::{
|
||||
AnyElement, Context, IntoElement, ParentElement as _, Render, Styled as _, Window, div,
|
||||
};
|
||||
use gpui_native_kit::button::{Button, ButtonVariant};
|
||||
use gpui_native_kit::common::v_flex;
|
||||
use gpui_native_kit::dialog::Dialog;
|
||||
use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use signed_state::Backend;
|
||||
use ui::button::{Button, ButtonVariant};
|
||||
use ui::common::v_flex;
|
||||
use ui::dialog::Dialog;
|
||||
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
|
||||
use crate::shared::dialogs::close_global;
|
||||
|
||||
|
||||
@@ -3,13 +3,13 @@ use gpui::{
|
||||
AnyElement, App, AppContext as _, Context, Entity, IntoElement, ParentElement as _, Render,
|
||||
Styled as _, Subscription, Task, Window, div, px,
|
||||
};
|
||||
use gpui_native_kit::button::Button;
|
||||
use gpui_native_kit::common::v_flex;
|
||||
use gpui_native_kit::dialog::Dialog;
|
||||
use gpui_native_kit::field::Field;
|
||||
use gpui_native_kit::input::{Input, InputState, InputStateEvent};
|
||||
use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use signed_state::Backend;
|
||||
use ui::button::Button;
|
||||
use ui::common::v_flex;
|
||||
use ui::dialog::Dialog;
|
||||
use ui::field::Field;
|
||||
use ui::input::{Input, InputState, InputStateEvent};
|
||||
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
|
||||
use crate::shared::dialogs::close_global;
|
||||
use crate::shared::progress::{DialogProgress, error_row};
|
||||
|
||||
@@ -3,13 +3,13 @@ use gpui::{
|
||||
AnyElement, App, AppContext as _, Context, Entity, IntoElement, ParentElement as _, Render,
|
||||
Styled as _, Window, div, px,
|
||||
};
|
||||
use gpui_native_kit::button::Button;
|
||||
use gpui_native_kit::common::v_flex;
|
||||
use gpui_native_kit::dialog::Dialog;
|
||||
use gpui_native_kit::field::Field;
|
||||
use gpui_native_kit::input::{Input, InputState};
|
||||
use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use signed_state::Backend;
|
||||
use ui::button::Button;
|
||||
use ui::common::v_flex;
|
||||
use ui::dialog::Dialog;
|
||||
use ui::field::Field;
|
||||
use ui::input::{Input, InputState};
|
||||
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
|
||||
use crate::shared::dialogs::close_global;
|
||||
use crate::shared::progress::{DialogProgress, error_row};
|
||||
|
||||
@@ -3,13 +3,13 @@ use gpui::{
|
||||
AnyElement, App, AppContext as _, Context, Entity, IntoElement, ParentElement as _, Render,
|
||||
Styled as _, Subscription, Window, px,
|
||||
};
|
||||
use gpui_native_kit::button::Button;
|
||||
use gpui_native_kit::common::v_flex;
|
||||
use gpui_native_kit::dialog::Dialog;
|
||||
use gpui_native_kit::field::Field;
|
||||
use gpui_native_kit::icons::{Icon, IconRole};
|
||||
use gpui_native_kit::input::{Input, InputState, InputStateEvent};
|
||||
use signed_state::Backend;
|
||||
use ui::button::Button;
|
||||
use ui::common::v_flex;
|
||||
use ui::dialog::Dialog;
|
||||
use ui::field::Field;
|
||||
use ui::icons::{Icon, IconRole};
|
||||
use ui::input::{Input, InputState, InputStateEvent};
|
||||
|
||||
use crate::shared::dialogs::close_global;
|
||||
use crate::shared::progress::{DialogProgress, error_row, push_steps_row};
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
use assets::CustomIconName;
|
||||
use gpui::prelude::FluentBuilder as _;
|
||||
use gpui::{
|
||||
AnyElement, App, Div, Entity, InteractiveElement as _, IntoElement, ParentElement as _,
|
||||
SharedString, Stateful, Styled as _, div, px,
|
||||
};
|
||||
use gpui_native_kit::avatar::Avatar;
|
||||
use gpui_native_kit::badge::Badge;
|
||||
use gpui_native_kit::common::{Sizable as _, h_flex, v_flex};
|
||||
use gpui_native_kit::icons::Icon;
|
||||
use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use metadata::ProfileDirectory;
|
||||
use nostr::prelude::{Event, Kind, PublicKey};
|
||||
use ui::avatar::Avatar;
|
||||
use ui::badge::Badge;
|
||||
use ui::common::{Sizable as _, h_flex, v_flex};
|
||||
use ui::icons::{Icon, IconRole};
|
||||
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use utils::relative_time;
|
||||
|
||||
pub fn repo_header(id: SharedString, name: SharedString, unread: usize, cx: &App) -> AnyElement {
|
||||
@@ -87,7 +86,7 @@ pub fn thread(
|
||||
.items_center()
|
||||
.justify_center()
|
||||
.child(
|
||||
Icon::named(CustomIconName::Inbox)
|
||||
Icon::named(IconRole::Inbox)
|
||||
.small()
|
||||
.color(cx.theme().colors.muted_foreground),
|
||||
),
|
||||
@@ -179,7 +178,7 @@ pub fn empty_state(message: &'static str, cx: &App) -> AnyElement {
|
||||
.gap_2()
|
||||
.py_8()
|
||||
.child(
|
||||
Icon::named(CustomIconName::Inbox)
|
||||
Icon::named(IconRole::Inbox)
|
||||
.size(px(24.))
|
||||
.color(cx.theme().colors.muted_foreground),
|
||||
)
|
||||
|
||||
@@ -7,16 +7,16 @@ use gpui::{
|
||||
SharedString, StatefulInteractiveElement as _, Styled as _, Subscription, Task, WeakEntity,
|
||||
Window, div,
|
||||
};
|
||||
use gpui_native_kit::button::Button;
|
||||
use gpui_native_kit::common::{h_flex, v_flex};
|
||||
use gpui_native_kit::icons::{Icon, IconRole};
|
||||
use gpui_native_kit::layout::panel::Panel;
|
||||
use gpui_native_kit::scroll_area::ScrollArea;
|
||||
use gpui_native_kit::theme::{TextRole, Typeset as _};
|
||||
use metadata::ProfileDirectory;
|
||||
use nostr::prelude::{Event, EventId, Kind, PublicKey, Timestamp};
|
||||
use signed_core::{InboxItem, InboxReadState, RepoAddr};
|
||||
use signed_state::{Backend, BackendEvent, Inbox, RefreshGate, RefreshRequest, RepoListStore};
|
||||
use ui::button::Button;
|
||||
use ui::common::{h_flex, v_flex};
|
||||
use ui::icons::{Icon, IconRole};
|
||||
use ui::layout::panel::Panel;
|
||||
use ui::scroll_area::ScrollArea;
|
||||
use ui::theme::{TextRole, Typeset as _};
|
||||
|
||||
mod helpers;
|
||||
|
||||
|
||||
@@ -2,17 +2,17 @@ use gpui::{
|
||||
Context, Entity, InteractiveElement as _, IntoElement, ParentElement as _, Render,
|
||||
ScrollHandle, SharedString, Styled as _, Subscription, Window, div,
|
||||
};
|
||||
use gpui_native_kit::avatar::Avatar;
|
||||
use gpui_native_kit::common::{Sizable as _, h_flex, v_flex};
|
||||
use gpui_native_kit::empty_state::EmptyState;
|
||||
use gpui_native_kit::input::InputState;
|
||||
use gpui_native_kit::layout::panel::Panel;
|
||||
use gpui_native_kit::scroll_area::ScrollArea;
|
||||
use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use metadata::ProfileDirectory;
|
||||
use nostr::prelude::{EventId, PublicKey};
|
||||
use signed_core::GitEvent;
|
||||
use signed_state::RepoStore;
|
||||
use ui::avatar::Avatar;
|
||||
use ui::common::{Sizable as _, h_flex, v_flex};
|
||||
use ui::empty_state::EmptyState;
|
||||
use ui::input::InputState;
|
||||
use ui::layout::panel::Panel;
|
||||
use ui::scroll_area::ScrollArea;
|
||||
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use utils::relative_time;
|
||||
|
||||
use crate::issues::helpers::{comment_form, comments_section, issue_roots, sidebar_section};
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
use assets::CustomIconName;
|
||||
use gpui::prelude::FluentBuilder as _;
|
||||
use gpui::{
|
||||
AnyElement, App, Entity, IntoElement, ParentElement as _, SharedString, Styled as _, div, px,
|
||||
};
|
||||
use gpui_native_kit::avatar::Avatar;
|
||||
use gpui_native_kit::badge::{Badge, BadgeVariant};
|
||||
use gpui_native_kit::button::Button;
|
||||
use gpui_native_kit::common::{Sizable as _, h_flex, v_flex};
|
||||
use gpui_native_kit::icons::Icon;
|
||||
use gpui_native_kit::input::{Input, InputState};
|
||||
use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use gpui_native_kit::tooltip::Tooltip;
|
||||
use metadata::ProfileDirectory;
|
||||
use nostr::prelude::{Event, EventId, PublicKey};
|
||||
use signed_core::RepoStatus;
|
||||
use signed_state::RepoStore;
|
||||
use ui::avatar::Avatar;
|
||||
use ui::badge::{Badge, BadgeVariant};
|
||||
use ui::button::Button;
|
||||
use ui::common::{Sizable as _, h_flex, v_flex};
|
||||
use ui::icons::{Icon, IconRole};
|
||||
use ui::input::{Input, InputState};
|
||||
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use ui::tooltip::Tooltip;
|
||||
use utils::relative_time;
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
@@ -245,7 +244,7 @@ pub(crate) fn comment_form(
|
||||
.typeset(TextRole::Caption, cx)
|
||||
.text_color(cx.theme().colors.muted_foreground)
|
||||
.child(
|
||||
Icon::named(CustomIconName::Markdown)
|
||||
Icon::named(IconRole::Markdown)
|
||||
.size(px(12.))
|
||||
.color(cx.theme().colors.muted_foreground),
|
||||
)
|
||||
|
||||
@@ -1,24 +1,23 @@
|
||||
use assets::CustomIconName;
|
||||
use gpui::prelude::FluentBuilder as _;
|
||||
use gpui::{
|
||||
AnyElement, AppContext as _, Context, Entity, InteractiveElement as _, IntoElement,
|
||||
ParentElement as _, Render, SharedString, StatefulInteractiveElement as _, Styled as _,
|
||||
Subscription, UniformListScrollHandle, WeakEntity, Window, div, px, uniform_list,
|
||||
};
|
||||
use gpui_native_kit::avatar::Avatar;
|
||||
use gpui_native_kit::button::Button;
|
||||
use gpui_native_kit::common::{Sizable as _, h_flex, v_flex};
|
||||
use gpui_native_kit::empty_state::EmptyState;
|
||||
use gpui_native_kit::icons::Icon;
|
||||
use gpui_native_kit::layout::panel::Panel;
|
||||
use gpui_native_kit::scrollbar::Scrollbar;
|
||||
use gpui_native_kit::segmented::{Segmented, SegmentedOption};
|
||||
use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use helpers::{IssueFilter, StatusCounts, filter_by_status};
|
||||
use metadata::ProfileDirectory;
|
||||
use nostr::prelude::PublicKey;
|
||||
use signed_core::GitEvent;
|
||||
use signed_state::RepoStore;
|
||||
use ui::avatar::Avatar;
|
||||
use ui::button::Button;
|
||||
use ui::common::{Sizable as _, h_flex, v_flex};
|
||||
use ui::empty_state::EmptyState;
|
||||
use ui::icons::{Icon, IconRole};
|
||||
use ui::layout::panel::Panel;
|
||||
use ui::scrollbar::Scrollbar;
|
||||
use ui::segmented::{Segmented, SegmentedOption};
|
||||
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use utils::relative_time;
|
||||
|
||||
use self::detail::IssueDetailView;
|
||||
@@ -136,14 +135,14 @@ impl IssuesView {
|
||||
Segmented::new("issue-filter", self.filter)
|
||||
.options(vec![
|
||||
SegmentedOption::new(IssueFilter::All, format!("All ({})", counts.total))
|
||||
.icon(Icon::named(CustomIconName::GitIssueDone).color(muted)),
|
||||
.icon(Icon::named(IconRole::GitIssueDone).color(muted)),
|
||||
SegmentedOption::new(IssueFilter::Open, format!("Open ({})", counts.open))
|
||||
.icon(Icon::named(CustomIconName::GitIssueOpen).color(muted)),
|
||||
.icon(Icon::named(IconRole::GitIssueOpen).color(muted)),
|
||||
SegmentedOption::new(
|
||||
IssueFilter::Closed,
|
||||
format!("Closed ({})", counts.closed),
|
||||
)
|
||||
.icon(Icon::named(CustomIconName::GitIssueClosed).color(muted)),
|
||||
.icon(Icon::named(IconRole::GitIssueClosed).color(muted)),
|
||||
])
|
||||
.on_change(move |filter, _, cx| {
|
||||
if let Err(error) = weak.update(cx, |this, cx| {
|
||||
@@ -158,7 +157,7 @@ impl IssuesView {
|
||||
.child(
|
||||
Button::new("new-issue")
|
||||
.label("New issue")
|
||||
.icon(Icon::named(CustomIconName::CirclePlus))
|
||||
.icon(Icon::named(IconRole::CirclePlus))
|
||||
.on_click(cx.listener(|this, _, _, cx| {
|
||||
new_issue::open(this.store.clone(), cx);
|
||||
})),
|
||||
|
||||
@@ -2,13 +2,13 @@ use gpui::{
|
||||
AnyElement, App, AppContext as _, Context, Entity, IntoElement, ParentElement as _, Render,
|
||||
Styled as _, Window, div,
|
||||
};
|
||||
use gpui_native_kit::button::Button;
|
||||
use gpui_native_kit::common::v_flex;
|
||||
use gpui_native_kit::dialog::Dialog;
|
||||
use gpui_native_kit::field::Field;
|
||||
use gpui_native_kit::input::{Input, InputState};
|
||||
use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use signed_state::RepoStore;
|
||||
use ui::button::Button;
|
||||
use ui::common::v_flex;
|
||||
use ui::dialog::Dialog;
|
||||
use ui::field::Field;
|
||||
use ui::input::{Input, InputState};
|
||||
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
|
||||
use crate::shared::dialogs::{close_global, open_global};
|
||||
|
||||
|
||||
@@ -1,29 +1,28 @@
|
||||
use std::path::PathBuf;
|
||||
|
||||
use assets::CustomIconName;
|
||||
use gpui::prelude::FluentBuilder as _;
|
||||
use gpui::{
|
||||
AnyElement, AppContext as _, Context, Entity, InteractiveElement as _, IntoElement,
|
||||
ParentElement as _, Render, SharedString, Styled as _, Subscription, UniformListScrollHandle,
|
||||
WeakEntity, Window, div, uniform_list,
|
||||
};
|
||||
use gpui_native_kit::avatar::Avatar;
|
||||
use gpui_native_kit::button::Button;
|
||||
use gpui_native_kit::clipboard::ClipboardButton;
|
||||
use gpui_native_kit::common::{Sizable as _, h_flex, v_flex};
|
||||
use gpui_native_kit::data::tabs::{Tab, Tabs};
|
||||
use gpui_native_kit::icons::Icon;
|
||||
use gpui_native_kit::input::InputState;
|
||||
use gpui_native_kit::layout::panel::Panel;
|
||||
use gpui_native_kit::scroll_area::ScrollArea;
|
||||
use gpui_native_kit::scrollbar::Scrollbar;
|
||||
use gpui_native_kit::spinner::Spinner;
|
||||
use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use metadata::ProfileDirectory;
|
||||
use nostr::prelude::{EventId, Kind, PublicKey, Url};
|
||||
use signed_core::{GitEvent, PullRequest, RepoAddr};
|
||||
use signed_git::{FileCommit, PatchParser};
|
||||
use signed_state::{Backend, Mirrors, RepoStore};
|
||||
use ui::avatar::Avatar;
|
||||
use ui::button::Button;
|
||||
use ui::clipboard::ClipboardButton;
|
||||
use ui::common::{Sizable as _, h_flex, v_flex};
|
||||
use ui::data::tabs::{Tab, Tabs};
|
||||
use ui::icons::{Icon, IconRole};
|
||||
use ui::input::InputState;
|
||||
use ui::layout::panel::Panel;
|
||||
use ui::scroll_area::ScrollArea;
|
||||
use ui::scrollbar::Scrollbar;
|
||||
use ui::spinner::Spinner;
|
||||
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use utils::relative_time;
|
||||
|
||||
use super::dialogs;
|
||||
@@ -540,7 +539,7 @@ impl PullRequestDetailView {
|
||||
this.child(
|
||||
Button::new("branch")
|
||||
.label(branch)
|
||||
.icon(Icon::named(CustomIconName::GitBranch))
|
||||
.icon(Icon::named(IconRole::GitBranch))
|
||||
.small(),
|
||||
)
|
||||
})
|
||||
|
||||
@@ -2,14 +2,14 @@ use gpui::{
|
||||
AnyElement, App, AppContext as _, Context, Entity, IntoElement, ParentElement as _, Render,
|
||||
Styled as _, Window, div,
|
||||
};
|
||||
use gpui_native_kit::button::Button;
|
||||
use gpui_native_kit::common::v_flex;
|
||||
use gpui_native_kit::dialog::Dialog;
|
||||
use gpui_native_kit::field::Field;
|
||||
use gpui_native_kit::input::{Input, InputState};
|
||||
use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use nostr::prelude::Event;
|
||||
use signed_state::RepoStore;
|
||||
use ui::button::Button;
|
||||
use ui::common::v_flex;
|
||||
use ui::dialog::Dialog;
|
||||
use ui::field::Field;
|
||||
use ui::input::{Input, InputState};
|
||||
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
|
||||
use crate::shared::dialogs::{close_global, open_global};
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
use std::path::PathBuf;
|
||||
|
||||
use gpui::{SharedString, WeakEntity};
|
||||
use gpui_native_kit::menu::MenuItem;
|
||||
use nostr::prelude::PublicKey;
|
||||
use signed_core::{Announcement, RepoAddr, RepoStatus};
|
||||
use ui::menu::MenuItem;
|
||||
use utils::middle_truncate;
|
||||
|
||||
use super::NewPullRequestView;
|
||||
|
||||
@@ -1,24 +1,23 @@
|
||||
use assets::CustomIconName;
|
||||
use gpui::prelude::FluentBuilder as _;
|
||||
use gpui::{
|
||||
AnyElement, AppContext as _, Context, Entity, InteractiveElement as _, IntoElement,
|
||||
ParentElement as _, Render, SharedString, StatefulInteractiveElement as _, Styled as _,
|
||||
Subscription, UniformListScrollHandle, WeakEntity, Window, div, px, uniform_list,
|
||||
};
|
||||
use gpui_native_kit::alert::{Alert, AlertSeverity};
|
||||
use gpui_native_kit::avatar::Avatar;
|
||||
use gpui_native_kit::common::{Sizable as _, h_flex, v_flex};
|
||||
use gpui_native_kit::dropdown_menu::DropdownMenu;
|
||||
use gpui_native_kit::icons::Icon;
|
||||
use gpui_native_kit::layout::panel::Panel;
|
||||
use gpui_native_kit::menu::MenuItem;
|
||||
use gpui_native_kit::scrollbar::Scrollbar;
|
||||
use gpui_native_kit::segmented::{Segmented, SegmentedOption};
|
||||
use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use metadata::ProfileDirectory;
|
||||
use nostr::prelude::{Kind, PublicKey};
|
||||
use signed_core::GitEvent;
|
||||
use signed_state::RepoStore;
|
||||
use ui::alert::{Alert, AlertSeverity};
|
||||
use ui::avatar::Avatar;
|
||||
use ui::common::{Sizable as _, h_flex, v_flex};
|
||||
use ui::dropdown_menu::DropdownMenu;
|
||||
use ui::icons::{Icon, IconRole};
|
||||
use ui::layout::panel::Panel;
|
||||
use ui::menu::MenuItem;
|
||||
use ui::scrollbar::Scrollbar;
|
||||
use ui::segmented::{Segmented, SegmentedOption};
|
||||
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use utils::relative_time;
|
||||
|
||||
mod detail;
|
||||
@@ -215,27 +214,27 @@ impl PullRequestsView {
|
||||
PullRequestFilter::All,
|
||||
format!("All ({})", counts.total),
|
||||
)
|
||||
.icon(Icon::named(CustomIconName::GitPullRequest).color(muted)),
|
||||
.icon(Icon::named(IconRole::GitPullRequest).color(muted)),
|
||||
SegmentedOption::new(
|
||||
PullRequestFilter::Open,
|
||||
format!("Open ({})", counts.open),
|
||||
)
|
||||
.icon(Icon::named(CustomIconName::GitPullRequest).color(muted)),
|
||||
.icon(Icon::named(IconRole::GitPullRequest).color(muted)),
|
||||
SegmentedOption::new(
|
||||
PullRequestFilter::Closed,
|
||||
format!("Closed ({})", counts.closed),
|
||||
)
|
||||
.icon(Icon::named(CustomIconName::GitPullRequestClosed).color(muted)),
|
||||
.icon(Icon::named(IconRole::GitPullRequestClosed).color(muted)),
|
||||
SegmentedOption::new(
|
||||
PullRequestFilter::Draft,
|
||||
format!("Draft ({})", counts.draft),
|
||||
)
|
||||
.icon(Icon::named(CustomIconName::GitPullRequestDraft).color(muted)),
|
||||
.icon(Icon::named(IconRole::GitPullRequestDraft).color(muted)),
|
||||
SegmentedOption::new(
|
||||
PullRequestFilter::Merged,
|
||||
format!("Merged ({})", counts.applied),
|
||||
)
|
||||
.icon(Icon::named(CustomIconName::GitPullRequestMerged).color(muted)),
|
||||
.icon(Icon::named(IconRole::GitPullRequestMerged).color(muted)),
|
||||
])
|
||||
.on_change(move |filter, _, cx| {
|
||||
if let Err(error) = weak.update(cx, |this, cx| {
|
||||
@@ -250,7 +249,7 @@ impl PullRequestsView {
|
||||
.child(
|
||||
DropdownMenu::new("new-pr-actions")
|
||||
.label("New")
|
||||
.icon(Icon::named(CustomIconName::GitPullRequest))
|
||||
.icon(Icon::named(IconRole::GitPullRequest))
|
||||
.open(self.new_pr_menu_open)
|
||||
.on_click(move |_, window, cx| {
|
||||
if let Err(error) =
|
||||
|
||||
@@ -1,24 +1,23 @@
|
||||
use std::path::PathBuf;
|
||||
|
||||
use assets::CustomIconName;
|
||||
use gpui::prelude::FluentBuilder as _;
|
||||
use gpui::{
|
||||
AnyElement, App, AppContext as _, Context, Entity, InteractiveElement as _, IntoElement,
|
||||
ParentElement as _, Render, SharedString, Styled as _, Subscription, UniformListScrollHandle,
|
||||
WeakEntity, Window, div, px, uniform_list,
|
||||
};
|
||||
use gpui_native_kit::button::Button;
|
||||
use gpui_native_kit::combobox::{Combobox, ComboboxState};
|
||||
use gpui_native_kit::common::{h_flex, v_flex};
|
||||
use gpui_native_kit::data::tabs::{Tab, Tabs};
|
||||
use gpui_native_kit::icons::{Icon, IconRole};
|
||||
use gpui_native_kit::input::{Input, InputState};
|
||||
use gpui_native_kit::layout::panel::Panel;
|
||||
use gpui_native_kit::menu::Menu;
|
||||
use gpui_native_kit::scrollbar::Scrollbar;
|
||||
use gpui_native_kit::spinner::Spinner;
|
||||
use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use signed_state::{CheckoutsStore, RepoStore};
|
||||
use ui::button::Button;
|
||||
use ui::combobox::{Combobox, ComboboxState};
|
||||
use ui::common::{h_flex, v_flex};
|
||||
use ui::data::tabs::{Tab, Tabs};
|
||||
use ui::icons::{Icon, IconRole};
|
||||
use ui::input::{Input, InputState};
|
||||
use ui::layout::panel::Panel;
|
||||
use ui::menu::Menu;
|
||||
use ui::scrollbar::Scrollbar;
|
||||
use ui::spinner::Spinner;
|
||||
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
|
||||
use super::helpers::{ForkCompare, fork_display_name, truncate_label};
|
||||
use crate::repo::commit_diff::{CommitDiffView, DiffPane};
|
||||
@@ -307,7 +306,7 @@ impl NewPullRequestView {
|
||||
.trigger(move |_, _| {
|
||||
Button::new("compare-source")
|
||||
.label(source_label.clone())
|
||||
.variant(gpui_native_kit::button::ButtonVariant::Secondary)
|
||||
.variant(ui::button::ButtonVariant::Secondary)
|
||||
.into_any_element()
|
||||
})
|
||||
.items(move |_, _| {
|
||||
@@ -357,9 +356,9 @@ impl NewPullRequestView {
|
||||
.tabs(move |_, _| {
|
||||
vec![
|
||||
Tab::new("files", format!("Files ({files})"))
|
||||
.lead(Icon::named(CustomIconName::GitFile)),
|
||||
.lead(Icon::named(IconRole::GitFile)),
|
||||
Tab::new("commits", format!("Commits ({commits})"))
|
||||
.lead(Icon::named(CustomIconName::GitCommit)),
|
||||
.lead(Icon::named(IconRole::GitCommit)),
|
||||
]
|
||||
})
|
||||
.on_change(move |index, _, cx| {
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
use assets::CustomIconName;
|
||||
use gpui::prelude::FluentBuilder as _;
|
||||
use gpui::{
|
||||
AnyElement, Context, Entity, InteractiveElement as _, IntoElement, ParentElement as _, Render,
|
||||
SharedString, Styled as _, WeakEntity, Window, div,
|
||||
};
|
||||
use gpui_native_kit::button::Button;
|
||||
use gpui_native_kit::common::{h_flex, v_flex};
|
||||
use gpui_native_kit::icons::Icon;
|
||||
use gpui_native_kit::input::{Input, InputState};
|
||||
use gpui_native_kit::layout::panel::Panel;
|
||||
use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use signed_state::RepoStore;
|
||||
use ui::button::Button;
|
||||
use ui::common::{h_flex, v_flex};
|
||||
use ui::icons::{Icon, IconRole};
|
||||
use ui::input::{Input, InputState};
|
||||
use ui::layout::panel::Panel;
|
||||
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
|
||||
use crate::workspace::Workspace;
|
||||
|
||||
@@ -110,7 +109,7 @@ impl SendPatchView {
|
||||
.child(
|
||||
Button::new("send-patch")
|
||||
.label("Send patch")
|
||||
.icon(Icon::named(CustomIconName::ArrowUp))
|
||||
.icon(Icon::named(IconRole::ArrowUp))
|
||||
.loading(self.submitting)
|
||||
.disabled(!can_submit)
|
||||
.on_click(move |_, _, cx| {
|
||||
|
||||
@@ -7,17 +7,17 @@ use gpui::{
|
||||
Render, ScrollStrategy, SharedString, Styled as _, Task, UniformListScrollHandle, Window, div,
|
||||
px, uniform_list,
|
||||
};
|
||||
use gpui_native_kit::badge::{Badge, BadgeVariant};
|
||||
use gpui_native_kit::clipboard::ClipboardButton;
|
||||
use gpui_native_kit::common::{h_flex, v_flex};
|
||||
use gpui_native_kit::data::tree::{Tree, TreeItem};
|
||||
use gpui_native_kit::icons::{Icon, IconRole};
|
||||
use gpui_native_kit::layout::panel::Panel;
|
||||
use gpui_native_kit::layout::resizable::{Resizable, ResizableState};
|
||||
use gpui_native_kit::scrollbar::Scrollbar;
|
||||
use gpui_native_kit::spinner::Spinner;
|
||||
use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use signed_git::{CommitDiff, DiffStatus, FileCommit, FileDiff, Repo};
|
||||
use ui::badge::{Badge, BadgeVariant};
|
||||
use ui::clipboard::ClipboardButton;
|
||||
use ui::common::{h_flex, v_flex};
|
||||
use ui::data::tree::{Tree, TreeItem};
|
||||
use ui::icons::{Icon, IconRole};
|
||||
use ui::layout::panel::Panel;
|
||||
use ui::layout::resizable::{Resizable, ResizableState};
|
||||
use ui::scrollbar::Scrollbar;
|
||||
use ui::spinner::Spinner;
|
||||
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use utils::relative_time_secs;
|
||||
|
||||
use super::helpers::{DiffRow, diff_rows, render_diff_row};
|
||||
|
||||
@@ -2,14 +2,14 @@ use gpui::{
|
||||
AnyElement, App, AppContext as _, Context, Entity, IntoElement, ParentElement as _, Render,
|
||||
SharedString, Styled as _, Window, div, px,
|
||||
};
|
||||
use gpui_native_kit::avatar::Avatar;
|
||||
use gpui_native_kit::clipboard::ClipboardButton;
|
||||
use gpui_native_kit::common::{Sizable as _, h_flex, v_flex};
|
||||
use gpui_native_kit::dialog::Dialog;
|
||||
use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use metadata::ProfileDirectory;
|
||||
use nostr::prelude::PublicKey;
|
||||
use signed_core::Announcement;
|
||||
use ui::avatar::Avatar;
|
||||
use ui::clipboard::ClipboardButton;
|
||||
use ui::common::{Sizable as _, h_flex, v_flex};
|
||||
use ui::dialog::Dialog;
|
||||
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use utils::middle_truncate;
|
||||
|
||||
use crate::shared::dialogs::{close_global, open_global};
|
||||
|
||||
@@ -5,16 +5,16 @@ use gpui::{
|
||||
AnyElement, App, AppContext as _, Context, Entity, IntoElement, ParentElement as _,
|
||||
PathPromptOptions, Render, Styled as _, WeakEntity, Window, div, px,
|
||||
};
|
||||
use gpui_native_kit::button::{Button, ButtonVariant};
|
||||
use gpui_native_kit::common::{h_flex, v_flex};
|
||||
use gpui_native_kit::dialog::Dialog;
|
||||
use gpui_native_kit::field::Field;
|
||||
use gpui_native_kit::icons::{Icon, IconRole};
|
||||
use gpui_native_kit::input::{Input, InputState};
|
||||
use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use gpui_native_kit::tooltip::Tooltip;
|
||||
use settings::SettingsStore;
|
||||
use signed_state::{Backend, CheckoutsStore};
|
||||
use ui::button::{Button, ButtonVariant};
|
||||
use ui::common::{h_flex, v_flex};
|
||||
use ui::dialog::Dialog;
|
||||
use ui::field::Field;
|
||||
use ui::icons::{Icon, IconRole};
|
||||
use ui::input::{Input, InputState};
|
||||
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use ui::tooltip::Tooltip;
|
||||
|
||||
use super::grasp_servers::{GraspServersState, grasp_servers_field, load_user_grasp_servers};
|
||||
use crate::repo::actions::open_repo_panel;
|
||||
|
||||
@@ -3,16 +3,16 @@ use gpui::{
|
||||
AnyElement, App, AppContext as _, Entity, IntoElement, ParentElement as _, SharedString,
|
||||
Styled as _, Window, div,
|
||||
};
|
||||
use gpui_native_kit::button::{Button, ButtonVariant};
|
||||
use gpui_native_kit::common::{h_flex, v_flex};
|
||||
use gpui_native_kit::icons::{Icon, IconRole};
|
||||
use gpui_native_kit::input::{Input, InputState};
|
||||
use gpui_native_kit::switch::Switch;
|
||||
use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use gpui_native_kit::tooltip::Tooltip;
|
||||
use nostr::prelude::RelayUrl;
|
||||
use settings::{DEFAULT_GRASP_SERVERS, GraspServersSettings};
|
||||
use signed_state::Backend;
|
||||
use ui::button::{Button, ButtonVariant};
|
||||
use ui::common::{h_flex, v_flex};
|
||||
use ui::icons::{Icon, IconRole};
|
||||
use ui::input::{Input, InputState};
|
||||
use ui::switch::Switch;
|
||||
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use ui::tooltip::Tooltip;
|
||||
|
||||
/// State of the grasp-server section of a publish dialog, so async results can be rendered.
|
||||
#[derive(Default)]
|
||||
|
||||
@@ -5,18 +5,18 @@ use gpui::{
|
||||
AnyElement, App, AppContext as _, Context, Entity, IntoElement, ParentElement as _, Render,
|
||||
SharedString, Styled as _, WeakEntity, Window, div, px,
|
||||
};
|
||||
use gpui_native_kit::button::Button;
|
||||
use gpui_native_kit::common::v_flex;
|
||||
use gpui_native_kit::dialog::Dialog;
|
||||
use gpui_native_kit::field::Field;
|
||||
use gpui_native_kit::icons::{Icon, IconRole};
|
||||
use gpui_native_kit::input::{Input, InputState};
|
||||
use gpui_native_kit::select::{Select, SelectOption};
|
||||
use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use settings::SettingsStore;
|
||||
use signed_core::RepoAddr;
|
||||
use signed_git::Repo;
|
||||
use signed_state::Backend;
|
||||
use ui::button::Button;
|
||||
use ui::common::v_flex;
|
||||
use ui::dialog::Dialog;
|
||||
use ui::field::Field;
|
||||
use ui::icons::{Icon, IconRole};
|
||||
use ui::input::{Input, InputState};
|
||||
use ui::select::{Select, SelectOption};
|
||||
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
|
||||
use super::grasp_servers::{GraspServersState, grasp_servers_field, load_user_grasp_servers};
|
||||
use crate::repo::RepoDetailView;
|
||||
|
||||
@@ -2,11 +2,11 @@ use gpui::{
|
||||
AnyElement, App, AppContext as _, Context, Entity, IntoElement, ParentElement as _, Render,
|
||||
Styled as _, Window, div, px,
|
||||
};
|
||||
use gpui_native_kit::button::{Button, ButtonVariant};
|
||||
use gpui_native_kit::common::v_flex;
|
||||
use gpui_native_kit::dialog::Dialog;
|
||||
use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use signed_state::RepoStore;
|
||||
use ui::button::{Button, ButtonVariant};
|
||||
use ui::common::v_flex;
|
||||
use ui::dialog::Dialog;
|
||||
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
|
||||
use crate::shared::dialogs::{close_global, open_global};
|
||||
|
||||
|
||||
@@ -7,13 +7,13 @@ use gpui::{
|
||||
AnyElement, App, AppContext as _, Context, Entity, EventEmitter, IntoElement,
|
||||
ParentElement as _, SharedString, Styled as _, Task, WeakEntity, Window, div, px,
|
||||
};
|
||||
use gpui_native_kit::common::{h_flex, v_flex};
|
||||
use gpui_native_kit::data::tree::{Tree, TreeItem};
|
||||
use gpui_native_kit::editor::code::CodeViewState;
|
||||
use gpui_native_kit::editor::markdown::MarkdownViewState;
|
||||
use gpui_native_kit::icons::{Icon, IconRole};
|
||||
use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use signed_git::{FileCommit, Repo, WorktreeSnapshot};
|
||||
use ui::common::{h_flex, v_flex};
|
||||
use ui::data::tree::{Tree, TreeItem};
|
||||
use ui::editor::code::CodeViewState;
|
||||
use ui::editor::markdown::MarkdownViewState;
|
||||
use ui::icons::{Icon, IconRole};
|
||||
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
|
||||
use super::helpers::{code_language, is_markdown_path, preview_spinner, source_hash};
|
||||
use crate::shared::tree::{TreeItemSeed, TreeRow, collect_expanded, flatten};
|
||||
|
||||
@@ -1,23 +1,22 @@
|
||||
use std::collections::HashSet;
|
||||
|
||||
use assets::CustomIconName;
|
||||
use gpui::prelude::FluentBuilder as _;
|
||||
use gpui::{
|
||||
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};
|
||||
use gpui_native_kit::clipboard::ClipboardButton;
|
||||
use gpui_native_kit::common::{Sizable, h_flex, v_flex};
|
||||
use gpui_native_kit::dropdown_menu::DropdownMenu;
|
||||
use gpui_native_kit::icons::{Icon, IconRole};
|
||||
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, CheckoutStatus, CheckoutSyncStatus, CheckoutsStore, Nip34Kind};
|
||||
use ui::avatar::Avatar;
|
||||
use ui::button::{Button, ButtonVariant};
|
||||
use ui::clipboard::ClipboardButton;
|
||||
use ui::common::{Sizable, h_flex, v_flex};
|
||||
use ui::dropdown_menu::DropdownMenu;
|
||||
use ui::icons::{Icon, IconRole};
|
||||
use ui::menu::MenuItem;
|
||||
use ui::popover::Popover;
|
||||
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use ui::tooltip::Tooltip;
|
||||
use utils::relative_time_secs;
|
||||
|
||||
use super::helpers::{bound_repo_label, clone_group, fork_row, nostr_clone_url, repo_display_name};
|
||||
@@ -197,7 +196,7 @@ impl RepoDetailView {
|
||||
.trigger(move |_, _| {
|
||||
Button::new("code")
|
||||
.label("Code")
|
||||
.icon(Icon::named(CustomIconName::GitClone))
|
||||
.icon(Icon::named(IconRole::GitClone))
|
||||
.tooltip(Tooltip::text("Clone repository"))
|
||||
.loading(cloning)
|
||||
.disabled(cloning)
|
||||
@@ -250,7 +249,7 @@ impl RepoDetailView {
|
||||
.child(
|
||||
h_flex().justify_end().child(
|
||||
Button::new("download")
|
||||
.icon(Icon::named(CustomIconName::GitClone))
|
||||
.icon(Icon::named(IconRole::GitClone))
|
||||
.label("Download")
|
||||
.on_click({
|
||||
let weak = weak_download.clone();
|
||||
@@ -271,7 +270,7 @@ impl RepoDetailView {
|
||||
)
|
||||
.child(
|
||||
DropdownMenu::new("repo-menu")
|
||||
.icon(CustomIconName::EllipsisVertical)
|
||||
.icon(IconRole::EllipsisVertical)
|
||||
.variant(ButtonVariant::Ghost)
|
||||
.disabled(pushing)
|
||||
.open(self.repo_menu_open)
|
||||
@@ -374,7 +373,7 @@ impl RepoDetailView {
|
||||
Some(binding) => this.child(bound_repo_label(binding, &self.directory, cx)),
|
||||
None => this.child(
|
||||
Button::new("init")
|
||||
.icon(Icon::named(CustomIconName::ArrowUp))
|
||||
.icon(Icon::named(IconRole::ArrowUp))
|
||||
.label("Initialize on Nostr")
|
||||
.tooltip(Tooltip::text("Publish this repository to Nostr"))
|
||||
.on_click(cx.listener(|this, _, window, cx| {
|
||||
@@ -438,7 +437,7 @@ impl RepoDetailView {
|
||||
};
|
||||
let path = status.path.clone();
|
||||
(
|
||||
Icon::named(CustomIconName::ArrowUp),
|
||||
Icon::named(IconRole::ArrowUp),
|
||||
SharedString::from(format!("{commits} ready to push")),
|
||||
format!("Push {}", status.branch),
|
||||
path,
|
||||
@@ -533,10 +532,7 @@ impl RepoDetailView {
|
||||
history.open_commit_diff(&commit_id, window, cx);
|
||||
});
|
||||
})
|
||||
.child(
|
||||
Icon::named(CustomIconName::GitCommit)
|
||||
.color(cx.theme().colors.muted_foreground),
|
||||
)
|
||||
.child(Icon::named(IconRole::GitCommit).color(cx.theme().colors.muted_foreground))
|
||||
.child(
|
||||
div()
|
||||
.font_family(cx.theme().mono_font)
|
||||
|
||||
@@ -1,23 +1,22 @@
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use anyhow::Error;
|
||||
use assets::CustomIconName;
|
||||
use gpui::prelude::FluentBuilder as _;
|
||||
use gpui::{
|
||||
AnyElement, App, Context, Entity, InteractiveElement as _, IntoElement, ParentElement as _,
|
||||
SharedString, StatefulInteractiveElement as _, Styled as _, Window, div, px,
|
||||
};
|
||||
use gpui_native_kit::avatar::Avatar;
|
||||
use gpui_native_kit::clipboard::ClipboardButton;
|
||||
use gpui_native_kit::combobox::ComboboxState;
|
||||
use gpui_native_kit::common::{Sizable as _, h_flex, v_flex};
|
||||
use gpui_native_kit::icons::Icon;
|
||||
use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use metadata::ProfileDirectory;
|
||||
use nostr::prelude::{RelayUrl, ToBech32};
|
||||
use signed_core::Announcement;
|
||||
use signed_git::{DiffHunk, DiffLine, DiffLineKind, FileCommit, FileDiff, Repo};
|
||||
use signed_state::{Nip34Binding, RepoListStore, RepoStore};
|
||||
use ui::avatar::Avatar;
|
||||
use ui::clipboard::ClipboardButton;
|
||||
use ui::combobox::ComboboxState;
|
||||
use ui::common::{Sizable as _, h_flex, v_flex};
|
||||
use ui::icons::{Icon, IconRole};
|
||||
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use utils::relative_time_secs;
|
||||
|
||||
use super::RepoDetailView;
|
||||
@@ -117,7 +116,7 @@ pub(super) fn fork_row(
|
||||
.min_w_0()
|
||||
.typeset(TextRole::Body, cx)
|
||||
.text_color(cx.theme().colors.muted_foreground)
|
||||
.child(Icon::named(CustomIconName::GitBranch).small())
|
||||
.child(Icon::named(IconRole::GitBranch).small())
|
||||
.child(div().whitespace_nowrap().text_ellipsis().child(label));
|
||||
|
||||
Some(if clickable {
|
||||
@@ -230,15 +229,13 @@ pub(super) fn preview_spinner() -> AnyElement {
|
||||
.size_full()
|
||||
.items_center()
|
||||
.justify_center()
|
||||
.child(gpui_native_kit::spinner::Spinner::new(
|
||||
"repo-preview-spinner",
|
||||
))
|
||||
.child(ui::spinner::Spinner::new("repo-preview-spinner"))
|
||||
.into_any_element()
|
||||
}
|
||||
|
||||
/// The kit grammar for a path; only four languages are supported.
|
||||
pub(super) fn code_language(path: &str) -> gpui_native_kit::editor::highlight::Language {
|
||||
use gpui_native_kit::editor::highlight::Language;
|
||||
pub(super) fn code_language(path: &str) -> ui::editor::highlight::Language {
|
||||
use ui::editor::highlight::Language;
|
||||
match Path::new(path)
|
||||
.extension()
|
||||
.and_then(|ext| ext.to_str())
|
||||
|
||||
@@ -6,12 +6,12 @@ use gpui::{
|
||||
AppContext as _, Context, Entity, IntoElement, ParentElement as _, Render, SharedString,
|
||||
Styled as _, Task, UniformListScrollHandle, WeakEntity, Window, div, uniform_list,
|
||||
};
|
||||
use gpui_native_kit::common::v_flex;
|
||||
use gpui_native_kit::scrollbar::Scrollbar;
|
||||
use gpui_native_kit::spinner::Spinner;
|
||||
use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use signed_git::{CommitList, Repo};
|
||||
use signed_state::RepoStore;
|
||||
use ui::common::v_flex;
|
||||
use ui::scrollbar::Scrollbar;
|
||||
use ui::spinner::Spinner;
|
||||
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
|
||||
use super::commit_diff::CommitDiffView;
|
||||
use super::helpers::commit_row;
|
||||
|
||||
@@ -2,20 +2,12 @@ use std::collections::HashSet;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use anyhow::Error;
|
||||
use assets::CustomIconName;
|
||||
use gpui::prelude::FluentBuilder as _;
|
||||
use gpui::{
|
||||
AnyElement, App, AppContext as _, Context, Entity, InteractiveElement as _, IntoElement,
|
||||
ParentElement as _, PathPromptOptions, Render, SharedString, Styled as _, Subscription, Task,
|
||||
WeakEntity, Window, div,
|
||||
};
|
||||
use gpui_native_kit::alert::{Alert, AlertSeverity};
|
||||
use gpui_native_kit::common::{h_flex, v_flex};
|
||||
use gpui_native_kit::data::sidebar::{Sidebar, SidebarEntry};
|
||||
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 _};
|
||||
use metadata::ProfileDirectory;
|
||||
use nostr::prelude::{PublicKey, Url};
|
||||
use signed_core::{Announcement, RepoAddr};
|
||||
@@ -23,6 +15,13 @@ use signed_git::{FileCommit, GitCache, Repo};
|
||||
use signed_state::{
|
||||
Backend, CheckoutsStore, LocalReposStore, Mirrors, Nip34Binding, RepoStore, SyncStatusDirectory,
|
||||
};
|
||||
use ui::alert::{Alert, AlertSeverity};
|
||||
use ui::common::{h_flex, v_flex};
|
||||
use ui::data::sidebar::{Sidebar, SidebarEntry};
|
||||
use ui::icons::{Icon, IconRole};
|
||||
use ui::layout::panel::Panel;
|
||||
use ui::spinner::Spinner;
|
||||
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
|
||||
pub mod actions;
|
||||
pub mod commit_diff;
|
||||
@@ -885,19 +884,19 @@ impl RepoDetailView {
|
||||
.entries(move |_, cx| {
|
||||
let mut entries = vec![
|
||||
SidebarEntry::row("repo-nav-commits", "Commits")
|
||||
.prefix(Icon::named(CustomIconName::GitCommit))
|
||||
.prefix(Icon::named(IconRole::GitCommit))
|
||||
.when_some(commit_count, |entry, count| entry.suffix(count.to_string())),
|
||||
];
|
||||
|
||||
if include_issues {
|
||||
entries.push(
|
||||
SidebarEntry::row("repo-nav-issues", "Issues")
|
||||
.prefix(Icon::named(CustomIconName::GitIssueDone))
|
||||
.prefix(Icon::named(IconRole::GitIssueDone))
|
||||
.when_some(issue_count, |entry, count| entry.suffix(count.to_string())),
|
||||
);
|
||||
entries.push(
|
||||
SidebarEntry::row("repo-nav-pulls", "Pull requests")
|
||||
.prefix(Icon::named(CustomIconName::GitPullRequest))
|
||||
.prefix(Icon::named(IconRole::GitPullRequest))
|
||||
.when_some(pull_count, |entry, count| entry.suffix(count.to_string())),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use gpui::{App, AppContext as _, Entity, SharedString, WeakEntity, Window};
|
||||
use gpui_native_kit::combobox::{Combobox, ComboboxState};
|
||||
use ui::combobox::{Combobox, ComboboxState};
|
||||
|
||||
use super::RepoDetailView;
|
||||
use super::helpers::sync_selector;
|
||||
|
||||
@@ -4,14 +4,14 @@ use gpui::{
|
||||
AnyElement, App, AppContext as _, Entity, IntoElement, ParentElement as _, PathPromptOptions,
|
||||
SharedString, Styled as _, Window, div, px,
|
||||
};
|
||||
use gpui_native_kit::button::Button;
|
||||
use gpui_native_kit::common::{h_flex, v_flex};
|
||||
use gpui_native_kit::icons::{Icon, IconRole};
|
||||
use gpui_native_kit::input::{Input, InputState};
|
||||
use gpui_native_kit::select::{Select, SelectOption};
|
||||
use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use gpui_native_kit::tooltip::Tooltip;
|
||||
use settings::{AppearanceMode, EventFetchingStrategy, SettingsStore};
|
||||
use ui::button::Button;
|
||||
use ui::common::{h_flex, v_flex};
|
||||
use ui::icons::{Icon, IconRole};
|
||||
use ui::input::{Input, InputState};
|
||||
use ui::select::{Select, SelectOption};
|
||||
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use ui::tooltip::Tooltip;
|
||||
|
||||
use crate::repo::dialogs::grasp_servers::{normalize_server, server_host};
|
||||
|
||||
@@ -134,7 +134,7 @@ pub fn grasp_servers_editor(input: &Entity<InputState>, cx: &App) -> AnyElement
|
||||
.child(
|
||||
Button::new(format!("settings-remove-server:{ix}"))
|
||||
.icon(Icon::named(IconRole::Close))
|
||||
.variant(gpui_native_kit::button::ButtonVariant::Ghost)
|
||||
.variant(ui::button::ButtonVariant::Ghost)
|
||||
.tooltip(Tooltip::text("Remove"))
|
||||
.on_click({
|
||||
let store = store.clone();
|
||||
@@ -163,7 +163,7 @@ pub fn grasp_servers_editor(input: &Entity<InputState>, cx: &App) -> AnyElement
|
||||
.child(
|
||||
Button::new("settings-add-server")
|
||||
.icon(Icon::named(IconRole::Plus))
|
||||
.variant(gpui_native_kit::button::ButtonVariant::Ghost)
|
||||
.variant(ui::button::ButtonVariant::Ghost)
|
||||
.tooltip(Tooltip::text("Add grasp server"))
|
||||
.on_click({
|
||||
let input = input.clone();
|
||||
@@ -234,7 +234,7 @@ pub fn scan_paths_editor(cx: &App) -> AnyElement {
|
||||
.child(
|
||||
Button::new(format!("settings-remove-path:{ix}"))
|
||||
.icon(Icon::named(IconRole::Close))
|
||||
.variant(gpui_native_kit::button::ButtonVariant::Ghost)
|
||||
.variant(ui::button::ButtonVariant::Ghost)
|
||||
.tooltip(Tooltip::text("Remove"))
|
||||
.on_click(move |_, _, cx| {
|
||||
store.update(cx, |store, cx| {
|
||||
@@ -307,7 +307,7 @@ pub fn default_folder_selector(default_folder: &Entity<InputState>) -> AnyElemen
|
||||
.child(
|
||||
Button::new("settings-choose-folder")
|
||||
.icon(Icon::named(IconRole::Folder))
|
||||
.variant(gpui_native_kit::button::ButtonVariant::Ghost)
|
||||
.variant(ui::button::ButtonVariant::Ghost)
|
||||
.tooltip(Tooltip::text("Choose folder"))
|
||||
.on_click(move |_, window, cx| {
|
||||
choose_default_folder(&folder, window, cx);
|
||||
|
||||
@@ -4,15 +4,15 @@ use gpui::{
|
||||
App, AppContext as _, Context, Entity, IntoElement, ParentElement as _, Render, Styled as _,
|
||||
Window, px,
|
||||
};
|
||||
use gpui_native_kit::common::v_flex;
|
||||
use gpui_native_kit::dialog::Dialog;
|
||||
use gpui_native_kit::input::InputState;
|
||||
use gpui_native_kit::separator::Separator;
|
||||
use helpers::{
|
||||
appearance_select, default_folder_selector, event_fetching_select, grasp_servers_editor,
|
||||
scan_paths_editor, setting_block, setting_row,
|
||||
};
|
||||
use settings::SettingsStore;
|
||||
use ui::common::v_flex;
|
||||
use ui::dialog::Dialog;
|
||||
use ui::input::InputState;
|
||||
use ui::separator::Separator;
|
||||
|
||||
use crate::shared::dialogs::open_global;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use gpui::{App, Entity, SharedString, WeakEntity, Window};
|
||||
use gpui_native_kit::layout::panel::{Panel, PanelView};
|
||||
use ui::layout::panel::{Panel, PanelView};
|
||||
|
||||
use crate::workspace::Workspace;
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@ use gpui::{
|
||||
AnyElement, App, Context, IntoElement as _, ParentElement as _, SharedString, Styled as _,
|
||||
Subscription, div,
|
||||
};
|
||||
use gpui_native_kit::common::{h_flex, v_flex};
|
||||
use gpui_native_kit::icons::{Icon, IconRole};
|
||||
use gpui_native_kit::spinner::Spinner;
|
||||
use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use signed_core::RepoAddr;
|
||||
use signed_state::{Backend, BackendEvent, PushStepStatus};
|
||||
use ui::common::{h_flex, v_flex};
|
||||
use ui::icons::{Icon, IconRole};
|
||||
use ui::spinner::Spinner;
|
||||
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
|
||||
/// Progress of an async dialog action: a busy flag that disables the form and an error shown below it.
|
||||
#[derive(Debug, Default)]
|
||||
|
||||
@@ -1,31 +1,18 @@
|
||||
use assets::CustomIconName;
|
||||
use gpui::{AnyElement, App, IntoElement, ParentElement as _, SharedString, Styled as _, div};
|
||||
use gpui_native_kit::badge::{Badge, BadgeVariant};
|
||||
use gpui_native_kit::empty_state::EmptyState;
|
||||
use gpui_native_kit::icons::Icon;
|
||||
use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use gpui_native_kit::tooltip::Tooltip;
|
||||
use signed_core::RepoStatus;
|
||||
use ui::badge::{Badge, BadgeVariant};
|
||||
use ui::empty_state::EmptyState;
|
||||
use ui::icons::{Icon, IconRole};
|
||||
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use ui::tooltip::Tooltip;
|
||||
|
||||
/// The status pill shown on issue and pull-request rows.
|
||||
pub fn status_badge(status: RepoStatus) -> Badge {
|
||||
let (label, variant, icon) = match status {
|
||||
RepoStatus::Open => ("Open", BadgeVariant::Neutral, CustomIconName::GitIssueOpen),
|
||||
RepoStatus::Closed => (
|
||||
"Closed",
|
||||
BadgeVariant::Danger,
|
||||
CustomIconName::GitIssueClosed,
|
||||
),
|
||||
RepoStatus::Draft => (
|
||||
"Draft",
|
||||
BadgeVariant::Warning,
|
||||
CustomIconName::GitIssueOngoing,
|
||||
),
|
||||
RepoStatus::Applied => (
|
||||
"Applied",
|
||||
BadgeVariant::Success,
|
||||
CustomIconName::GitIssueDone,
|
||||
),
|
||||
RepoStatus::Open => ("Open", BadgeVariant::Neutral, IconRole::GitIssueOpen),
|
||||
RepoStatus::Closed => ("Closed", BadgeVariant::Danger, IconRole::GitIssueClosed),
|
||||
RepoStatus::Draft => ("Draft", BadgeVariant::Warning, IconRole::GitIssueOngoing),
|
||||
RepoStatus::Applied => ("Applied", BadgeVariant::Success, IconRole::GitIssueDone),
|
||||
};
|
||||
|
||||
Badge::new(format!("status-{label}"), label)
|
||||
@@ -37,7 +24,7 @@ pub fn status_badge(status: RepoStatus) -> Badge {
|
||||
/// A centered empty-state message filling the available space.
|
||||
pub fn empty_state(message: impl Into<SharedString>) -> AnyElement {
|
||||
let message = message.into();
|
||||
gpui_native_kit::common::v_flex()
|
||||
ui::common::v_flex()
|
||||
.size_full()
|
||||
.items_center()
|
||||
.justify_center()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use gpui::{AnyElement, App, IntoElement};
|
||||
use gpui_native_kit::avatar::Avatar;
|
||||
use gpui_native_kit::common::Sizable as _;
|
||||
use signed_state::ResolvedLocalRepo;
|
||||
use ui::avatar::Avatar;
|
||||
use ui::common::Sizable as _;
|
||||
|
||||
/// The bound owner's avatar, falling back to the path's pixel avatar when unowned.
|
||||
pub(super) fn local_avatar(
|
||||
|
||||
@@ -4,20 +4,20 @@ use gpui::{
|
||||
AnyElement, App, AppContext as _, Context, IntoElement, ParentElement as _, SharedString,
|
||||
Styled as _, Subscription, WeakEntity, Window, px,
|
||||
};
|
||||
use gpui_native_kit::avatar::Avatar;
|
||||
use gpui_native_kit::button::{Button, ButtonVariant};
|
||||
use gpui_native_kit::command_palette::{Command, CommandPalette, CommandPaletteState};
|
||||
use gpui_native_kit::common::{Sizable as _, h_flex};
|
||||
use gpui_native_kit::data::tabs::{Tab, Tabs, TabsVariant};
|
||||
use gpui_native_kit::icons::{Icon, IconRole};
|
||||
use gpui_native_kit::menu::{Menu, MenuItem};
|
||||
use gpui_native_kit::theme::ActiveTheme as _;
|
||||
use gpui_native_kit::tooltip::Tooltip;
|
||||
use helpers::local_avatar;
|
||||
use metadata::{Profile, ProfileDirectory};
|
||||
use nostr::prelude::PublicKey;
|
||||
use signed_core::Announcement;
|
||||
use signed_state::{Backend, BackendEvent, LocalReposStore, RepoListStore, ResolvedLocalRepo};
|
||||
use ui::avatar::Avatar;
|
||||
use ui::button::{Button, ButtonVariant};
|
||||
use ui::command_palette::{Command, CommandPalette, CommandPaletteState};
|
||||
use ui::common::{Sizable as _, h_flex};
|
||||
use ui::data::tabs::{Tab, Tabs, TabsVariant};
|
||||
use ui::icons::{Icon, IconRole};
|
||||
use ui::menu::{Menu, MenuItem};
|
||||
use ui::theme::ActiveTheme as _;
|
||||
use ui::tooltip::Tooltip;
|
||||
|
||||
use crate::repo::{RepoDetailView, actions, dialogs};
|
||||
use crate::shared::{log_dropped, panels};
|
||||
|
||||
@@ -4,9 +4,9 @@ use std::sync::Arc;
|
||||
use gpui::{
|
||||
Context, IntoElement, ParentElement as _, Render, SharedString, Styled as _, Window, div,
|
||||
};
|
||||
use gpui_native_kit::common::v_flex;
|
||||
use gpui_native_kit::data::tabs::{Tab, Tabs, TabsVariant};
|
||||
use gpui_native_kit::layout::panel::{Panel, PanelView};
|
||||
use ui::common::v_flex;
|
||||
use ui::data::tabs::{Tab, Tabs, TabsVariant};
|
||||
use ui::layout::panel::{Panel, PanelView};
|
||||
|
||||
use crate::shared::log_dropped;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user