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,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) =
|
||||
|
||||
Reference in New Issue
Block a user