Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Recategorize a few items in the component preview (#35681)

Danilo Lealcc9317525631
diff --git a/crates/agent_ui/src/ui/end_trial_upsell.rs b/crates/agent_ui/src/ui/end_trial_upsell.rs
index 0d9751afecb..3a8a1198005 100644
--- a/crates/agent_ui/src/ui/end_trial_upsell.rs
+++ b/crates/agent_ui/src/ui/end_trial_upsell.rs
@@ -94,18 +94,20 @@ impl RenderOnce for EndTrialUpsell {
impl Component for EndTrialUpsell {
fn scope() -> ComponentScope {
- ComponentScope::Agent
+ ComponentScope::Onboarding
+ }
+
+ fn name() -> &'static str {
+ "End of Trial Upsell Banner"
}
fn sort_name() -> &'static str {
- "AgentEndTrialUpsell"
+ "End of Trial Upsell Banner"
}
fn preview(_window: &mut Window, _cx: &mut App) -> Option<AnyElement> {
Some(
v_flex()
- .p_4()
- .gap_4()
.child(EndTrialUpsell {
dismiss_upsell: Arc::new(|_, _| {}),
})
diff --git a/crates/ai_onboarding/src/ai_onboarding.rs b/crates/ai_onboarding/src/ai_onboarding.rs
index 9372a33fedb..b9a1e49a4ac 100644
--- a/crates/ai_onboarding/src/ai_onboarding.rs
+++ b/crates/ai_onboarding/src/ai_onboarding.rs
@@ -368,7 +368,15 @@ impl RenderOnce for ZedAiOnboarding {
impl Component for ZedAiOnboarding {
fn scope() -> ComponentScope {
- ComponentScope::Agent
+ ComponentScope::Onboarding
+ }
+
+ fn name() -> &'static str {
+ "Agent Panel Banners"
+ }
+
+ fn sort_name() -> &'static str {
+ "Agent Panel Banners"
}
fn preview(_window: &mut Window, _cx: &mut App) -> Option<AnyElement> {
diff --git a/crates/ai_onboarding/src/ai_upsell_card.rs b/crates/ai_onboarding/src/ai_upsell_card.rs
index a3fea5dce32..4e4833f7700 100644
--- a/crates/ai_onboarding/src/ai_upsell_card.rs
+++ b/crates/ai_onboarding/src/ai_upsell_card.rs
@@ -236,7 +236,7 @@ impl RenderOnce for AiUpsellCard {
impl Component for AiUpsellCard {
fn scope() -> ComponentScope {
- ComponentScope::Agent
+ ComponentScope::Onboarding
}
fn name() -> &'static str {
diff --git a/crates/component/src/component.rs b/crates/component/src/component.rs
index 02840cc3cb9..0c05ba4a97f 100644
--- a/crates/component/src/component.rs
+++ b/crates/component/src/component.rs
@@ -318,8 +318,10 @@ pub enum ComponentScope {
Notification,
#[strum(serialize = "Overlays & Layering")]
Overlays,
+ Onboarding,
Status,
Typography,
+ Utilities,
#[strum(serialize = "Version Control")]
VersionControl,
}
diff --git a/crates/language_models/src/provider/cloud.rs b/crates/language_models/src/provider/cloud.rs
index 2108547c4f8..134b2bef6c7 100644
--- a/crates/language_models/src/provider/cloud.rs
+++ b/crates/language_models/src/provider/cloud.rs
@@ -1267,8 +1267,16 @@ impl Render for ConfigurationView {
}
impl Component for ZedAiConfiguration {
+ fn name() -> &'static str {
+ "AI Configuration Content"
+ }
+
+ fn sort_name() -> &'static str {
+ "AI Configuration Content"
+ }
+
fn scope() -> ComponentScope {
- ComponentScope::Agent
+ ComponentScope::Onboarding
}
fn preview(_window: &mut Window, _cx: &mut App) -> Option<AnyElement> {
diff --git a/crates/onboarding/src/theme_preview.rs b/crates/onboarding/src/theme_preview.rs
index 53631be1c9b..81eb14ec4b0 100644
--- a/crates/onboarding/src/theme_preview.rs
+++ b/crates/onboarding/src/theme_preview.rs
@@ -299,6 +299,18 @@ impl RenderOnce for ThemePreviewTile {
}
impl Component for ThemePreviewTile {
+ fn scope() -> ComponentScope {
+ ComponentScope::Onboarding
+ }
+
+ fn name() -> &'static str {
+ "Theme Preview Tile"
+ }
+
+ fn sort_name() -> &'static str {
+ "Theme Preview Tile"
+ }
+
fn description() -> Option<&'static str> {
Some(Self::DOCS)
}
diff --git a/crates/ui/src/components/banner.rs b/crates/ui/src/components/banner.rs
index b16ca795b4b..d88905d4664 100644
--- a/crates/ui/src/components/banner.rs
+++ b/crates/ui/src/components/banner.rs
@@ -131,7 +131,7 @@ impl RenderOnce for Banner {
impl Component for Banner {
fn scope() -> ComponentScope {
- ComponentScope::Notification
+ ComponentScope::DataDisplay
}
fn preview(_window: &mut Window, _cx: &mut App) -> Option<AnyElement> {
diff --git a/crates/ui/src/components/callout.rs b/crates/ui/src/components/callout.rs
index d15fa122ed9..9c1c9fb1a9d 100644
--- a/crates/ui/src/components/callout.rs
+++ b/crates/ui/src/components/callout.rs
@@ -158,7 +158,7 @@ impl RenderOnce for Callout {
impl Component for Callout {
fn scope() -> ComponentScope {
- ComponentScope::Notification
+ ComponentScope::DataDisplay
}
fn description() -> Option<&'static str> {
diff --git a/crates/ui/src/components/tab.rs b/crates/ui/src/components/tab.rs
index a205c33358e..d704846a683 100644
--- a/crates/ui/src/components/tab.rs
+++ b/crates/ui/src/components/tab.rs
@@ -179,7 +179,7 @@ impl RenderOnce for Tab {
impl Component for Tab {
fn scope() -> ComponentScope {
- ComponentScope::None
+ ComponentScope::Navigation
}
fn description() -> Option<&'static str> {
diff --git a/crates/ui/src/styles/animation.rs b/crates/ui/src/styles/animation.rs
index 0649bee1f82..ee5352d4540 100644
--- a/crates/ui/src/styles/animation.rs
+++ b/crates/ui/src/styles/animation.rs
@@ -99,7 +99,7 @@ struct Animation {}
impl Component for Animation {
fn scope() -> ComponentScope {
- ComponentScope::None
+ ComponentScope::Utilities
}
fn description() -> Option<&'static str> {
diff --git a/crates/ui/src/styles/color.rs b/crates/ui/src/styles/color.rs
index c7b995d39af..586b2ccc576 100644
--- a/crates/ui/src/styles/color.rs
+++ b/crates/ui/src/styles/color.rs
@@ -126,7 +126,7 @@ impl From<Hsla> for Color {
impl Component for Color {
fn scope() -> ComponentScope {
- ComponentScope::None
+ ComponentScope::Utilities
}
fn description() -> Option<&'static str> {