diff --git a/Cargo.lock b/Cargo.lock index a8e75648..d066f7dc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -724,7 +724,7 @@ dependencies = [ "bitflags 2.9.1", "cexpr", "clang-sys", - "itertools 0.11.0", + "itertools 0.10.5", "lazy_static", "lazycell", "log", @@ -747,7 +747,7 @@ dependencies = [ "bitflags 2.9.1", "cexpr", "clang-sys", - "itertools 0.11.0", + "itertools 0.10.5", "log", "prettyplease", "proc-macro2", @@ -1417,7 +1417,7 @@ dependencies = [ [[package]] name = "collections" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed.git#a067c16c823354da63966273ac15d1aa93c0e922" +source = "git+https://github.com/zed-industries/zed.git#aa330fcf2c4c1153d5c4f0408a4f6bfc145d94d5" dependencies = [ "indexmap 2.9.0", "rustc-hash 2.1.0", @@ -1975,7 +1975,7 @@ dependencies = [ [[package]] name = "derive_refineable" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed.git#a067c16c823354da63966273ac15d1aa93c0e922" +source = "git+https://github.com/zed-industries/zed.git#aa330fcf2c4c1153d5c4f0408a4f6bfc145d94d5" dependencies = [ "proc-macro2", "quote", @@ -3121,7 +3121,7 @@ dependencies = [ [[package]] name = "gpui" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed.git#a067c16c823354da63966273ac15d1aa93c0e922" +source = "git+https://github.com/zed-industries/zed.git#aa330fcf2c4c1153d5c4f0408a4f6bfc145d94d5" dependencies = [ "anyhow", "as-raw-xcb-connection", @@ -3304,7 +3304,7 @@ dependencies = [ [[package]] name = "gpui_macros" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed.git#a067c16c823354da63966273ac15d1aa93c0e922" +source = "git+https://github.com/zed-industries/zed.git#aa330fcf2c4c1153d5c4f0408a4f6bfc145d94d5" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -3574,7 +3574,7 @@ dependencies = [ [[package]] name = "http_client" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed.git#a067c16c823354da63966273ac15d1aa93c0e922" +source = "git+https://github.com/zed-industries/zed.git#aa330fcf2c4c1153d5c4f0408a4f6bfc145d94d5" dependencies = [ "anyhow", "bytes", @@ -3591,7 +3591,7 @@ dependencies = [ [[package]] name = "http_client_tls" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed.git#a067c16c823354da63966273ac15d1aa93c0e922" +source = "git+https://github.com/zed-industries/zed.git#aa330fcf2c4c1153d5c4f0408a4f6bfc145d94d5" dependencies = [ "rustls", "rustls-platform-verifier", @@ -4417,7 +4417,7 @@ dependencies = [ [[package]] name = "media" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed.git#a067c16c823354da63966273ac15d1aa93c0e922" +source = "git+https://github.com/zed-industries/zed.git#aa330fcf2c4c1153d5c4f0408a4f6bfc145d94d5" dependencies = [ "anyhow", "bindgen 0.71.1", @@ -6322,7 +6322,7 @@ dependencies = [ [[package]] name = "refineable" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed.git#a067c16c823354da63966273ac15d1aa93c0e922" +source = "git+https://github.com/zed-industries/zed.git#aa330fcf2c4c1153d5c4f0408a4f6bfc145d94d5" dependencies = [ "derive_refineable", "workspace-hack", @@ -6477,7 +6477,7 @@ dependencies = [ [[package]] name = "reqwest_client" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed.git#a067c16c823354da63966273ac15d1aa93c0e922" +source = "git+https://github.com/zed-industries/zed.git#aa330fcf2c4c1153d5c4f0408a4f6bfc145d94d5" dependencies = [ "anyhow", "bytes", @@ -7052,7 +7052,7 @@ checksum = "d369a96f978623eb3dc28807c4852d6cc617fed53da5d3c400feff1ef34a714a" [[package]] name = "semantic_version" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed.git#a067c16c823354da63966273ac15d1aa93c0e922" +source = "git+https://github.com/zed-industries/zed.git#aa330fcf2c4c1153d5c4f0408a4f6bfc145d94d5" dependencies = [ "anyhow", "serde", @@ -7634,7 +7634,7 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "sum_tree" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed.git#a067c16c823354da63966273ac15d1aa93c0e922" +source = "git+https://github.com/zed-industries/zed.git#aa330fcf2c4c1153d5c4f0408a4f6bfc145d94d5" dependencies = [ "arrayvec", "log", @@ -8862,7 +8862,7 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "util" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed.git#a067c16c823354da63966273ac15d1aa93c0e922" +source = "git+https://github.com/zed-industries/zed.git#aa330fcf2c4c1153d5c4f0408a4f6bfc145d94d5" dependencies = [ "anyhow", "async-fs 2.1.2", diff --git a/crates/story/examples/description_list.rs b/crates/story/examples/description_list.rs index 2163c34c..9916923b 100644 --- a/crates/story/examples/description_list.rs +++ b/crates/story/examples/description_list.rs @@ -11,11 +11,10 @@ use gpui_component::{ use serde::Deserialize; use story::Assets; -#[derive(Clone, PartialEq, Eq, Deserialize)] +#[derive(Action, Clone, PartialEq, Eq, Deserialize)] +#[action(namespace = example, no_json)] struct ChangeSize(Size); -impl_internal_actions!(example, [ChangeSize]); - pub struct Example { layout: Axis, bordered: bool, diff --git a/crates/story/examples/dock.rs b/crates/story/examples/dock.rs index 8500e2b7..4f155987 100644 --- a/crates/story/examples/dock.rs +++ b/crates/story/examples/dock.rs @@ -16,13 +16,14 @@ use story::{ SwitchStory, TableStory, TooltipStory, WebViewStory, }; -#[derive(Clone, PartialEq, Eq, Deserialize)] +#[derive(Action, Clone, PartialEq, Eq, Deserialize)] +#[action(namespace = story, no_json)] pub struct AddPanel(DockPlacement); -#[derive(Clone, PartialEq, Eq, Deserialize)] +#[derive(Action, Clone, PartialEq, Eq, Deserialize)] +#[action(namespace = story, no_json)] pub struct TogglePanelVisible(SharedString); -impl_internal_actions!(story, [AddPanel, TogglePanelVisible]); actions!(story, [ToggleDockToggleButton]); const MAIN_DOCK_AREA: DockAreaTab = DockAreaTab { diff --git a/crates/story/examples/tiles.rs b/crates/story/examples/tiles.rs index 9575fcb0..d0fc5bfd 100644 --- a/crates/story/examples/tiles.rs +++ b/crates/story/examples/tiles.rs @@ -12,7 +12,7 @@ use serde::{Deserialize, Serialize}; use std::{sync::Arc, time::Duration}; use story::{Assets, ButtonStory, IconStory, StoryContainer}; -actions!(main_menu, [Quit]); +actions!(story, [Quit]); const TILES_DOCK_AREA: DockAreaTab = DockAreaTab { id: "story-tiles", diff --git a/crates/story/src/button_story.rs b/crates/story/src/button_story.rs index 834b8b63..6aaa1f44 100644 --- a/crates/story/src/button_story.rs +++ b/crates/story/src/button_story.rs @@ -12,7 +12,7 @@ use gpui_component::{ use crate::section; -actions!(button_story, [Disabled, Loading, Selected, Compact]); +actions!(story, [Disabled, Loading, Selected, Compact]); pub struct ButtonStory { focus_handle: gpui::FocusHandle, diff --git a/crates/story/src/drawer_story.rs b/crates/story/src/drawer_story.rs index b157cfa0..a381df42 100644 --- a/crates/story/src/drawer_story.rs +++ b/crates/story/src/drawer_story.rs @@ -22,7 +22,7 @@ use gpui_component::{ use crate::section; -actions!(modal_story, [TestAction]); +actions!(story, [TestAction]); pub struct ListItemDeletegate { story: WeakEntity, diff --git a/crates/story/src/dropdown_story.rs b/crates/story/src/dropdown_story.rs index f4d5aa54..307b589f 100644 --- a/crates/story/src/dropdown_story.rs +++ b/crates/story/src/dropdown_story.rs @@ -11,7 +11,7 @@ use gpui_component::{ use crate::section; -actions!(dropdown_story, [Tab, TabPrev]); +actions!(story, [Tab, TabPrev]); const CONTEXT: &str = "DropdownStory"; pub fn init(cx: &mut App) { diff --git a/crates/story/src/form_story.rs b/crates/story/src/form_story.rs index b908b78f..feea36bc 100644 --- a/crates/story/src/form_story.rs +++ b/crates/story/src/form_story.rs @@ -15,7 +15,7 @@ use gpui_component::{ v_flex, AxisExt, FocusableCycle, Selectable, Sizable, Size, }; -actions!(input_story, [Tab, TabPrev]); +actions!(story, [Tab, TabPrev]); pub struct FormStory { name_input: Entity, diff --git a/crates/story/src/input_story.rs b/crates/story/src/input_story.rs index e011db86..3d751f00 100644 --- a/crates/story/src/input_story.rs +++ b/crates/story/src/input_story.rs @@ -11,7 +11,7 @@ use gpui_component::{ v_flex, ContextModal, FocusableCycle, Icon, IconName, Sizable, }; -actions!(input_story, [Tab, TabPrev]); +actions!(story, [Tab, TabPrev]); const CONTEXT: &str = "InputStory"; diff --git a/crates/story/src/lib.rs b/crates/story/src/lib.rs index d999bd04..af7928cb 100644 --- a/crates/story/src/lib.rs +++ b/crates/story/src/lib.rs @@ -43,8 +43,8 @@ mod welcome_story; pub use assets::Assets; use gpui::{ - actions, div, impl_internal_actions, prelude::FluentBuilder as _, px, rems, size, AnyElement, - AnyView, App, AppContext, Bounds, Context, Div, Entity, EventEmitter, Focusable, Global, Hsla, + actions, div, prelude::FluentBuilder as _, px, rems, size, Action, AnyElement, AnyView, App, + AppContext, Bounds, Context, Div, Entity, EventEmitter, Focusable, Global, Hsla, InteractiveElement, IntoElement, KeyBinding, Menu, MenuItem, ParentElement, Render, RenderOnce, SharedString, StatefulInteractiveElement, Styled, Window, WindowBounds, WindowKind, WindowOptions, @@ -105,23 +105,22 @@ use gpui_component::{ v_flex, ActiveTheme, ContextModal, IconName, Root, TitleBar, }; -#[derive(Clone, PartialEq, Eq, Deserialize)] +#[derive(Action, Clone, PartialEq, Eq, Deserialize)] +#[action(namespace = story, no_json)] pub struct SelectScrollbarShow(ScrollbarShow); -#[derive(Clone, PartialEq, Eq, Deserialize)] +#[derive(Action, Clone, PartialEq, Eq, Deserialize)] +#[action(namespace = story, no_json)] pub struct SelectLocale(SharedString); -#[derive(Clone, PartialEq, Eq, Deserialize)] +#[derive(Action, Clone, PartialEq, Eq, Deserialize)] +#[action(namespace = story, no_json)] pub struct SelectFont(usize); -#[derive(Clone, PartialEq, Eq, Deserialize)] +#[derive(Action, Clone, PartialEq, Eq, Deserialize)] +#[action(namespace = story, no_json)] pub struct SelectRadius(usize); -impl_internal_actions!( - story, - [SelectLocale, SelectFont, SelectRadius, SelectScrollbarShow] -); - actions!(story, [Quit, Open, CloseWindow, ToggleSearch]); const PANEL_NAME: &str = "StoryContainer"; diff --git a/crates/story/src/list_story.rs b/crates/story/src/list_story.rs index b875a640..2f89ac23 100644 --- a/crates/story/src/list_story.rs +++ b/crates/story/src/list_story.rs @@ -16,7 +16,7 @@ use gpui_component::{ v_flex, ActiveTheme, Sizable, }; -actions!(list_story, [SelectedCompany]); +actions!(story, [SelectedCompany]); #[derive(Clone, Default)] struct Company { diff --git a/crates/story/src/menu_story.rs b/crates/story/src/menu_story.rs index 9bf7b9c7..ce217fe4 100644 --- a/crates/story/src/menu_story.rs +++ b/crates/story/src/menu_story.rs @@ -1,7 +1,7 @@ use gpui::{ - actions, div, impl_internal_actions, px, App, AppContext, Context, Corner, Entity, FocusHandle, - Focusable, InteractiveElement, IntoElement, KeyBinding, ParentElement as _, Render, - SharedString, Styled as _, Window, + actions, div, px, Action, App, AppContext, Context, Corner, Entity, FocusHandle, Focusable, + InteractiveElement, IntoElement, KeyBinding, ParentElement as _, Render, SharedString, + Styled as _, Window, }; use gpui_component::{ button::Button, context_menu::ContextMenuExt, h_flex, popup_menu::PopupMenuExt as _, v_flex, @@ -11,11 +11,11 @@ use serde::Deserialize; use crate::section; -#[derive(Clone, PartialEq, Deserialize)] +#[derive(Action, Clone, PartialEq, Deserialize)] +#[action(namespace = story, no_json)] struct Info(usize); -actions!(popover_story, [Copy, Paste, Cut, SearchAll, ToggleCheck]); -impl_internal_actions!(popover_story, [Info]); +actions!(story, [Copy, Paste, Cut, SearchAll, ToggleCheck]); pub fn init(cx: &mut App) { cx.bind_keys([ diff --git a/crates/story/src/modal_story.rs b/crates/story/src/modal_story.rs index 4e58be32..f80e5ec0 100644 --- a/crates/story/src/modal_story.rs +++ b/crates/story/src/modal_story.rs @@ -17,7 +17,7 @@ use gpui_component::{ }; use crate::section; -actions!(modal_story, [TestAction]); +actions!(story, [TestAction]); pub struct ModalStory { focus_handle: FocusHandle, diff --git a/crates/story/src/number_input_story.rs b/crates/story/src/number_input_story.rs index c4bf392d..d5b1cf85 100644 --- a/crates/story/src/number_input_story.rs +++ b/crates/story/src/number_input_story.rs @@ -11,7 +11,7 @@ use gpui_component::{ v_flex, FocusableCycle, IconName, Sizable, }; -actions!(input_story, [Tab, TabPrev]); +actions!(story, [Tab, TabPrev]); const CONTEXT: &str = "NumberInputStory"; diff --git a/crates/story/src/otp_input_story.rs b/crates/story/src/otp_input_story.rs index 9438d803..691862b5 100644 --- a/crates/story/src/otp_input_story.rs +++ b/crates/story/src/otp_input_story.rs @@ -11,7 +11,7 @@ use gpui_component::{ }; use crate::section; -actions!(input_story, [Tab, TabPrev]); +actions!(story, [Tab, TabPrev]); const CONTEXT: &str = "OtpInputStory"; diff --git a/crates/story/src/popover_story.rs b/crates/story/src/popover_story.rs index aa00ba20..c7deac8d 100644 --- a/crates/story/src/popover_story.rs +++ b/crates/story/src/popover_story.rs @@ -1,7 +1,7 @@ use gpui::{ - actions, div, impl_internal_actions, px, App, AppContext, Context, Corner, DismissEvent, - Element, Entity, EventEmitter, FocusHandle, Focusable, InteractiveElement, IntoElement, - KeyBinding, MouseButton, ParentElement as _, Render, Styled as _, Window, + actions, div, px, Action, App, AppContext, Context, Corner, DismissEvent, Element, Entity, + EventEmitter, FocusHandle, Focusable, InteractiveElement, IntoElement, KeyBinding, MouseButton, + ParentElement as _, Render, Styled as _, Window, }; use gpui_component::{ button::{Button, ButtonVariants as _}, @@ -13,11 +13,11 @@ use gpui_component::{ }; use serde::Deserialize; -#[derive(Clone, PartialEq, Deserialize)] +#[derive(Action, Clone, PartialEq, Eq, Deserialize)] +#[action(namespace = story, no_json)] struct Info(usize); -actions!(popover_story, [Copy, Paste, Cut, SearchAll, ToggleCheck]); -impl_internal_actions!(popover_story, [Info]); +actions!(story, [Copy, Paste, Cut, SearchAll, ToggleCheck]); pub fn init(cx: &mut App) { cx.bind_keys([ diff --git a/crates/story/src/sidebar_story.rs b/crates/story/src/sidebar_story.rs index 3436d87a..10f9b554 100644 --- a/crates/story/src/sidebar_story.rs +++ b/crates/story/src/sidebar_story.rs @@ -1,8 +1,8 @@ use std::collections::HashMap; use gpui::{ - div, impl_internal_actions, prelude::FluentBuilder, relative, App, AppContext, ClickEvent, - Context, Entity, Focusable, IntoElement, ParentElement, Render, SharedString, Styled, Window, + div, prelude::FluentBuilder, relative, Action, App, AppContext, ClickEvent, Context, Entity, + Focusable, IntoElement, ParentElement, Render, SharedString, Styled, Window, }; use gpui_component::{ @@ -21,11 +21,10 @@ use gpui_component::{ }; use serde::Deserialize; -#[derive(Clone, PartialEq, Eq, Deserialize)] +#[derive(Action, Clone, PartialEq, Eq, Deserialize)] +#[action(namespace = story, no_json)] pub struct SelectCompany(SharedString); -impl_internal_actions!(sidebar_story, [SelectCompany]); - pub struct SidebarStory { active_items: HashMap, last_active_item: Item, diff --git a/crates/story/src/table_story.rs b/crates/story/src/table_story.rs index 5285a107..371c2cc2 100644 --- a/crates/story/src/table_story.rs +++ b/crates/story/src/table_story.rs @@ -5,9 +5,9 @@ use std::{ use fake::{Fake, Faker}; use gpui::{ - div, impl_internal_actions, prelude::FluentBuilder as _, px, AnyElement, App, AppContext, - ClickEvent, Context, Edges, Entity, Focusable, InteractiveElement, IntoElement, ParentElement, - Pixels, Render, SharedString, StatefulInteractiveElement, Styled, Timer, Window, + div, prelude::FluentBuilder as _, px, Action, AnyElement, App, AppContext, ClickEvent, Context, + Edges, Entity, Focusable, InteractiveElement, IntoElement, ParentElement, Pixels, Render, + SharedString, StatefulInteractiveElement, Styled, Timer, Window, }; use gpui_component::{ button::Button, @@ -23,14 +23,14 @@ use gpui_component::{ }; use serde::Deserialize; -#[derive(Clone, PartialEq, Eq, Deserialize)] +#[derive(Action, Clone, PartialEq, Eq, Deserialize)] +#[action(namespace = story, no_json)] struct ChangeSize(Size); -#[derive(Clone, PartialEq, Eq, Deserialize)] +#[derive(Action, Clone, PartialEq, Eq, Deserialize)] +#[action(namespace = story, no_json)] struct OpenDetail(usize); -impl_internal_actions!(table_story, [ChangeSize, OpenDetail]); - #[derive(Clone, Debug, Default)] struct Stock { id: usize, diff --git a/crates/story/src/textarea_story.rs b/crates/story/src/textarea_story.rs index 8fb73405..8ffea246 100644 --- a/crates/story/src/textarea_story.rs +++ b/crates/story/src/textarea_story.rs @@ -11,7 +11,7 @@ use gpui_component::{ v_flex, FocusableCycle, Sizable, }; -actions!(input_story, [Tab, TabPrev]); +actions!(story, [Tab, TabPrev]); const CONTEXT: &str = "TextareaStory"; diff --git a/crates/story/src/toggle_story.rs b/crates/story/src/toggle_story.rs index 33b25474..37783e6b 100644 --- a/crates/story/src/toggle_story.rs +++ b/crates/story/src/toggle_story.rs @@ -8,7 +8,7 @@ use gpui_component::{ h_flex, v_flex, IconName, Sizable, }; -actions!(button_story, [Disabled, Loading, Selected, Compact]); +actions!(story, [Disabled, Loading, Selected, Compact]); pub struct ToggleStory { focus_handle: gpui::FocusHandle, diff --git a/crates/story/src/tooltip_story.rs b/crates/story/src/tooltip_story.rs index 75159760..81f0ff6b 100644 --- a/crates/story/src/tooltip_story.rs +++ b/crates/story/src/tooltip_story.rs @@ -16,7 +16,7 @@ use gpui_component::{ use crate::{section, Story}; -actions!(tooltip, [Info]); +actions!(story, [Info]); pub fn init(cx: &mut App) { cx.bind_keys([KeyBinding::new("ctrl-shift-delete", Info, Some("Tooltip"))]); diff --git a/crates/ui/src/actions.rs b/crates/ui/src/actions.rs index 17acbb62..9be2fa1d 100644 --- a/crates/ui/src/actions.rs +++ b/crates/ui/src/actions.rs @@ -1,11 +1,11 @@ -use gpui::{actions, impl_internal_actions}; +use gpui::{actions, Action}; use serde::Deserialize; -#[derive(Clone, PartialEq, Eq, Deserialize)] +#[derive(Clone, Action, PartialEq, Eq, Deserialize)] +#[action(namespace = list, no_json)] pub struct Confirm { /// Is confirm with secondary. pub secondary: bool, } actions!(list, [Cancel, SelectPrev, SelectNext]); -impl_internal_actions!(list, [Confirm]); diff --git a/crates/ui/src/input/state.rs b/crates/ui/src/input/state.rs index 9b1967ed..7097ca20 100644 --- a/crates/ui/src/input/state.rs +++ b/crates/ui/src/input/state.rs @@ -2,6 +2,7 @@ //! //! Based on the `Input` example from the `gpui` crate. //! https://github.com/zed-industries/zed/blob/main/crates/gpui/examples/input.rs +use gpui::Action; use serde::Deserialize; use smallvec::SmallVec; use std::cell::RefCell; @@ -10,12 +11,11 @@ use std::rc::Rc; use unicode_segmentation::*; use gpui::{ - actions, div, impl_internal_actions, point, prelude::FluentBuilder as _, px, relative, App, - AppContext, Bounds, ClipboardItem, Context, Entity, EntityInputHandler, EventEmitter, - FocusHandle, Focusable, InteractiveElement as _, IntoElement, KeyBinding, KeyDownEvent, - MouseButton, MouseDownEvent, MouseMoveEvent, MouseUpEvent, ParentElement as _, Pixels, Point, - Render, ScrollHandle, ScrollWheelEvent, SharedString, Styled as _, Subscription, - UTF16Selection, Window, WrappedLine, + actions, div, point, prelude::FluentBuilder as _, px, relative, App, AppContext, Bounds, + ClipboardItem, Context, Entity, EntityInputHandler, EventEmitter, FocusHandle, Focusable, + InteractiveElement as _, IntoElement, KeyBinding, KeyDownEvent, MouseButton, MouseDownEvent, + MouseMoveEvent, MouseUpEvent, ParentElement as _, Pixels, Point, Render, ScrollHandle, + ScrollWheelEvent, SharedString, Styled as _, Subscription, UTF16Selection, Window, WrappedLine, }; // TODO: @@ -34,14 +34,13 @@ use crate::input::hover_popover::DiagnosticPopover; use crate::input::marker::Marker; use crate::{history::History, scroll::ScrollbarState, Root}; -#[derive(Clone, PartialEq, Eq, Deserialize)] +#[derive(Action, Clone, PartialEq, Eq, Deserialize)] +#[action(namespace = input, no_json)] pub struct Enter { /// Is confirm with secondary. pub secondary: bool, } -impl_internal_actions!(input, [Enter]); - actions!( input, [ diff --git a/crates/ui/src/tab/tab_bar.rs b/crates/ui/src/tab/tab_bar.rs index 9d22ad5a..1ff702d5 100644 --- a/crates/ui/src/tab/tab_bar.rs +++ b/crates/ui/src/tab/tab_bar.rs @@ -5,20 +5,19 @@ use crate::popup_menu::PopupMenuExt as _; use crate::{h_flex, ActiveTheme, IconName, Selectable, Sizable, Size, StyledExt}; use gpui::prelude::FluentBuilder as _; use gpui::{ - div, impl_internal_actions, AnyElement, App, Corner, Div, Edges, ElementId, IntoElement, - ParentElement, RenderOnce, ScrollHandle, Stateful, StatefulInteractiveElement as _, - StyleRefinement, Styled, Window, + div, Action, AnyElement, App, Corner, Div, Edges, ElementId, IntoElement, ParentElement, + RenderOnce, ScrollHandle, Stateful, StatefulInteractiveElement as _, StyleRefinement, Styled, + Window, }; use gpui::{px, InteractiveElement}; use smallvec::SmallVec; use super::{Tab, TabVariant}; -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Action, Debug, Clone, Copy, PartialEq, Eq)] +#[action(namespace = tab_bar, no_json)] pub struct SelectTab(usize); -impl_internal_actions!(tab_bar, [SelectTab]); - #[derive(IntoElement)] pub struct TabBar { base: Stateful
, diff --git a/crates/webview/src/context_menu.rs b/crates/webview/src/context_menu.rs index 95bce26d..cbac8d6e 100644 --- a/crates/webview/src/context_menu.rs +++ b/crates/webview/src/context_menu.rs @@ -1,4 +1,4 @@ -use gpui::{App, Entity, Window, impl_actions}; +use gpui::{Action, App, Entity, Window}; use gpui_component::popup_menu::PopupMenu; use rust_i18n::t; use schemars::JsonSchema; @@ -7,7 +7,8 @@ use wef::{ContextMenuParams, Frame, LogicalUnit, Point}; use crate::WebView; -#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, JsonSchema)] +#[derive(Action, Debug, Clone, Copy, PartialEq, Eq, Deserialize, JsonSchema)] +#[action(namespace = webview)] pub(crate) enum ContextMenuAction { CopyLinkAddress, Undo, @@ -22,8 +23,6 @@ pub(crate) enum ContextMenuAction { Reload, } -impl_actions!(webview, [ContextMenuAction]); - pub(crate) struct ContextMenuInfo { pub(crate) crood: Point>, pub(crate) frame: Frame,