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.

ui2: Do not enable 'stories' feature by default.

Piotr Osiewicz31336b0b7dbf
diff --git a/crates/ui2/Cargo.toml b/crates/ui2/Cargo.toml
index 0a7de6299d1..efbec22bee4 100644
--- a/crates/ui2/Cargo.toml
+++ b/crates/ui2/Cargo.toml
@@ -18,5 +18,5 @@ theme2 = { path = "../theme2" }
rand = "0.8"
[features]
-default = ["stories"]
+default = []
stories = ["dep:itertools"]
diff --git a/crates/ui2/src/components/button.rs b/crates/ui2/src/components/button.rs
index de055bcd5c3..1bb611a86e7 100644
--- a/crates/ui2/src/components/button.rs
+++ b/crates/ui2/src/components/button.rs
@@ -1,6 +1,6 @@
use std::sync::Arc;
-use gpui::{div, DefiniteLength, Hsla, MouseButton, StatefulInteractiveComponent, WindowContext};
+use gpui::{DefiniteLength, Hsla, MouseButton, StatefulInteractiveComponent, WindowContext};
use crate::prelude::*;
use crate::{h_stack, Icon, IconButton, IconElement, Label, LineHeightStyle, TextColor};
diff --git a/crates/ui2/src/components/keybinding.rs b/crates/ui2/src/components/keybinding.rs
index 8da5273bf5f..784886751f0 100644
--- a/crates/ui2/src/components/keybinding.rs
+++ b/crates/ui2/src/components/keybinding.rs
@@ -80,18 +80,12 @@ pub use stories::*;
#[cfg(feature = "stories")]
mod stories {
use super::*;
- use crate::Story;
- use gpui::{actions, Div, Render};
+ pub use crate::KeyBinding;
+ use crate::{binding, Story};
+ use gpui::{Div, Render};
use itertools::Itertools;
-
pub struct KeybindingStory;
- actions!(NoAction);
-
- pub fn binding(key: &str) -> gpui::KeyBinding {
- gpui::KeyBinding::new(key, NoAction {}, None)
- }
-
impl Render for KeybindingStory {
type Element = Div<Self>;
diff --git a/crates/ui2/src/lib.rs b/crates/ui2/src/lib.rs
index 149dcd3fd04..25e9668a09c 100644
--- a/crates/ui2/src/lib.rs
+++ b/crates/ui2/src/lib.rs
@@ -24,6 +24,7 @@ mod to_extract;
pub mod utils;
pub use components::*;
+use gpui::actions;
pub use prelude::*;
pub use static_data::*;
pub use styled_ext::*;
@@ -42,3 +43,8 @@ pub use crate::settings::*;
mod story;
#[cfg(feature = "stories")]
pub use story::*;
+actions!(NoAction);
+
+pub fn binding(key: &str) -> gpui::KeyBinding {
+ gpui::KeyBinding::new(key, NoAction {}, None)
+}