1use gpui::{Action, actions};
2use schemars::JsonSchema;
3use serde::{Deserialize, Serialize};
4use std::path::PathBuf;
5
6// If the zed binary doesn't use anything in this crate, it will be optimized away
7// and the actions won't initialize. So we just provide an empty initialization function
8// to be called from main.
9//
10// These may provide relevant context:
11// https://github.com/rust-lang/rust/issues/47384
12// https://github.com/mmastrac/rust-ctor/issues/280
13pub fn init() {}
14
15/// Opens a URL in the system's default web browser.
16#[derive(Clone, PartialEq, Deserialize, JsonSchema, Action)]
17#[action(namespace = zed)]
18#[serde(deny_unknown_fields)]
19pub struct OpenBrowser {
20 pub url: String,
21}
22
23/// Opens a zed:// URL within the application.
24#[derive(Clone, PartialEq, Deserialize, JsonSchema, Action)]
25#[action(namespace = zed)]
26#[serde(deny_unknown_fields)]
27pub struct OpenZedUrl {
28 pub url: String,
29}
30
31/// Opens the keymap to either add a keybinding or change an existing one
32#[derive(PartialEq, Clone, Default, Action, JsonSchema, Serialize, Deserialize)]
33#[action(namespace = zed, no_json, no_register)]
34pub struct ChangeKeybinding {
35 pub action: String,
36}
37
38actions!(
39 zed,
40 [
41 /// Opens the settings editor.
42 #[action(deprecated_aliases = ["zed_actions::OpenSettingsEditor"])]
43 OpenSettings,
44 /// Opens the settings JSON file.
45 #[action(deprecated_aliases = ["zed_actions::OpenSettings"])]
46 OpenSettingsFile,
47 /// Opens project-specific settings.
48 #[action(deprecated_aliases = ["zed_actions::OpenProjectSettings"])]
49 OpenProjectSettings,
50 /// Opens the default keymap file.
51 OpenDefaultKeymap,
52 /// Opens the user keymap file.
53 #[action(deprecated_aliases = ["zed_actions::OpenKeymap"])]
54 OpenKeymapFile,
55 /// Opens the keymap editor.
56 #[action(deprecated_aliases = ["zed_actions::OpenKeymapEditor"])]
57 OpenKeymap,
58 /// Opens account settings.
59 OpenAccountSettings,
60 /// Opens server settings.
61 OpenServerSettings,
62 /// Quits the application.
63 Quit,
64 /// Shows information about Zed.
65 About,
66 /// Opens the documentation website.
67 OpenDocs,
68 /// Views open source licenses.
69 OpenLicenses,
70 /// Opens the telemetry log.
71 OpenTelemetryLog,
72 /// Opens the performance profiler.
73 OpenPerformanceProfiler,
74 /// Opens the onboarding view.
75 OpenOnboarding,
76 /// Shows the auto-update notification for testing.
77 ShowUpdateNotification,
78 ]
79);
80
81#[derive(PartialEq, Clone, Copy, Debug, Deserialize, JsonSchema)]
82#[serde(rename_all = "snake_case")]
83pub enum ExtensionCategoryFilter {
84 Themes,
85 IconThemes,
86 Languages,
87 Grammars,
88 LanguageServers,
89 ContextServers,
90 AgentServers,
91 Snippets,
92 DebugAdapters,
93}
94
95/// Opens the extensions management interface.
96#[derive(PartialEq, Clone, Default, Debug, Deserialize, JsonSchema, Action)]
97#[action(namespace = zed)]
98#[serde(deny_unknown_fields)]
99pub struct Extensions {
100 /// Filters the extensions page down to extensions that are in the specified category.
101 #[serde(default)]
102 pub category_filter: Option<ExtensionCategoryFilter>,
103 /// Focuses just the extension with the specified ID.
104 #[serde(default)]
105 pub id: Option<String>,
106}
107
108/// Opens the ACP registry.
109#[derive(PartialEq, Clone, Default, Debug, Deserialize, JsonSchema, Action)]
110#[action(namespace = zed)]
111#[serde(deny_unknown_fields)]
112pub struct AcpRegistry;
113
114/// Show call diagnostics and connection quality statistics.
115#[derive(PartialEq, Clone, Default, Debug, Deserialize, JsonSchema, Action)]
116#[action(namespace = collab)]
117#[serde(deny_unknown_fields)]
118pub struct ShowCallStats;
119
120/// Decreases the font size in the editor buffer.
121#[derive(PartialEq, Clone, Default, Debug, Deserialize, JsonSchema, Action)]
122#[action(namespace = zed)]
123#[serde(deny_unknown_fields)]
124pub struct DecreaseBufferFontSize {
125 #[serde(default)]
126 pub persist: bool,
127}
128
129/// Increases the font size in the editor buffer.
130#[derive(PartialEq, Clone, Default, Debug, Deserialize, JsonSchema, Action)]
131#[action(namespace = zed)]
132#[serde(deny_unknown_fields)]
133pub struct IncreaseBufferFontSize {
134 #[serde(default)]
135 pub persist: bool,
136}
137
138/// Opens the settings editor at a specific path.
139#[derive(PartialEq, Clone, Debug, Deserialize, JsonSchema, Action)]
140#[action(namespace = zed)]
141#[serde(deny_unknown_fields)]
142pub struct OpenSettingsAt {
143 /// A path to a specific setting (e.g. `theme.mode`)
144 pub path: String,
145}
146
147/// Resets the buffer font size to the default value.
148#[derive(PartialEq, Clone, Default, Debug, Deserialize, JsonSchema, Action)]
149#[action(namespace = zed)]
150#[serde(deny_unknown_fields)]
151pub struct ResetBufferFontSize {
152 #[serde(default)]
153 pub persist: bool,
154}
155
156/// Decreases the font size of the user interface.
157#[derive(PartialEq, Clone, Default, Debug, Deserialize, JsonSchema, Action)]
158#[action(namespace = zed)]
159#[serde(deny_unknown_fields)]
160pub struct DecreaseUiFontSize {
161 #[serde(default)]
162 pub persist: bool,
163}
164
165/// Increases the font size of the user interface.
166#[derive(PartialEq, Clone, Default, Debug, Deserialize, JsonSchema, Action)]
167#[action(namespace = zed)]
168#[serde(deny_unknown_fields)]
169pub struct IncreaseUiFontSize {
170 #[serde(default)]
171 pub persist: bool,
172}
173
174/// Resets the UI font size to the default value.
175#[derive(PartialEq, Clone, Default, Debug, Deserialize, JsonSchema, Action)]
176#[action(namespace = zed)]
177#[serde(deny_unknown_fields)]
178pub struct ResetUiFontSize {
179 #[serde(default)]
180 pub persist: bool,
181}
182
183/// Resets all zoom levels (UI and buffer font sizes, including in the agent panel) to their default values.
184#[derive(PartialEq, Clone, Default, Debug, Deserialize, JsonSchema, Action)]
185#[action(namespace = zed)]
186#[serde(deny_unknown_fields)]
187pub struct ResetAllZoom {
188 #[serde(default)]
189 pub persist: bool,
190}
191
192pub mod editor {
193 use gpui::actions;
194 actions!(
195 editor,
196 [
197 /// Moves cursor up.
198 MoveUp,
199 /// Moves cursor down.
200 MoveDown,
201 /// Reveals the current file in the system file manager.
202 RevealInFileManager,
203 ]
204 );
205}
206
207pub mod dev {
208 use gpui::actions;
209
210 actions!(
211 dev,
212 [
213 /// Toggles the developer inspector for debugging UI elements.
214 ToggleInspector
215 ]
216 );
217}
218
219pub mod remote_debug {
220 use gpui::actions;
221
222 actions!(
223 remote_debug,
224 [
225 /// Simulates a disconnection from the remote server for testing purposes.
226 /// This will trigger the reconnection logic.
227 SimulateDisconnect,
228 /// Simulates a timeout/slow connection to the remote server for testing purposes.
229 /// This will cause heartbeat failures and trigger reconnection.
230 SimulateTimeout,
231 /// Simulates a timeout/slow connection to the remote server for testing purposes.
232 /// This will cause heartbeat failures and attempting a reconnection while having exhausted all attempts.
233 SimulateTimeoutExhausted,
234 ]
235 );
236}
237
238pub mod workspace {
239 use gpui::actions;
240
241 actions!(
242 workspace,
243 [
244 #[action(deprecated_aliases = ["editor::CopyPath", "outline_panel::CopyPath", "project_panel::CopyPath"])]
245 CopyPath,
246 #[action(deprecated_aliases = ["editor::CopyRelativePath", "outline_panel::CopyRelativePath", "project_panel::CopyRelativePath"])]
247 CopyRelativePath,
248 /// Opens the selected file with the system's default application.
249 #[action(deprecated_aliases = ["project_panel::OpenWithSystem"])]
250 OpenWithSystem,
251 ]
252 );
253}
254
255/// Describes which ref to base a new git worktree on. The worktree is
256/// always created in a detached HEAD state; users can opt into creating
257/// a branch afterwards from the worktree itself.
258#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
259#[serde(rename_all = "snake_case", tag = "kind")]
260pub enum NewWorktreeBranchTarget {
261 /// Create a detached worktree from the current HEAD.
262 #[default]
263 CurrentBranch,
264 /// Create a detached worktree at the tip of an existing branch.
265 ExistingBranch { name: String },
266}
267
268/// Creates a new git worktree and switches the workspace to it.
269/// Dispatched by the unified worktree picker when the user selects a "Create new worktree" entry.
270#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema, Action)]
271#[action(namespace = git)]
272#[serde(deny_unknown_fields)]
273pub struct CreateWorktree {
274 /// When this is None, Zed will randomly generate a worktree name.
275 pub worktree_name: Option<String>,
276 pub branch_target: NewWorktreeBranchTarget,
277}
278
279/// Switches the workspace to an existing linked worktree.
280/// Dispatched by the unified worktree picker when the user selects an existing worktree.
281#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema, Action)]
282#[action(namespace = git)]
283#[serde(deny_unknown_fields)]
284pub struct SwitchWorktree {
285 pub path: PathBuf,
286 pub display_name: String,
287}
288
289/// Opens an existing worktree in a new window.
290/// Dispatched by the worktree picker's "Open in New Window" button.
291#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema, Action)]
292#[action(namespace = git)]
293#[serde(deny_unknown_fields)]
294pub struct OpenWorktreeInNewWindow {
295 pub path: PathBuf,
296}
297
298pub mod git {
299 use gpui::actions;
300
301 actions!(
302 git,
303 [
304 /// Checks out a different git branch.
305 CheckoutBranch,
306 /// Switches to a different git branch.
307 Switch,
308 /// Selects a different repository.
309 SelectRepo,
310 /// Filter remotes.
311 FilterRemotes,
312 /// Create a git remote.
313 CreateRemote,
314 /// Opens the git branch selector.
315 #[action(deprecated_aliases = ["branches::OpenRecent"])]
316 Branch,
317 /// Opens the git stash selector.
318 ViewStash,
319 /// Opens the git worktree selector.
320 Worktree,
321 /// Creates a pull request for the current branch.
322 CreatePullRequest
323 ]
324 );
325}
326
327pub mod toast {
328 use gpui::actions;
329
330 actions!(
331 toast,
332 [
333 /// Runs the action associated with a toast notification.
334 RunAction
335 ]
336 );
337}
338
339pub mod command_palette {
340 use gpui::actions;
341
342 actions!(
343 command_palette,
344 [
345 /// Toggles the command palette.
346 Toggle,
347 ]
348 );
349}
350
351pub mod project_panel {
352 use gpui::actions;
353
354 actions!(
355 project_panel,
356 [
357 /// Toggles the project panel.
358 Toggle,
359 /// Toggles focus on the project panel.
360 ToggleFocus
361 ]
362 );
363}
364pub mod feedback {
365 use gpui::actions;
366
367 actions!(
368 feedback,
369 [
370 /// Opens email client to send feedback to Zed support.
371 EmailZed,
372 /// Opens the bug report form.
373 FileBugReport,
374 /// Opens the feature request form.
375 RequestFeature
376 ]
377 );
378}
379
380pub mod theme {
381 use gpui::actions;
382
383 actions!(theme, [ToggleMode]);
384}
385
386pub mod theme_selector {
387 use gpui::Action;
388 use schemars::JsonSchema;
389 use serde::Deserialize;
390
391 /// Toggles the theme selector interface.
392 #[derive(PartialEq, Clone, Default, Debug, Deserialize, JsonSchema, Action)]
393 #[action(namespace = theme_selector)]
394 #[serde(deny_unknown_fields)]
395 pub struct Toggle {
396 /// A list of theme names to filter the theme selector down to.
397 pub themes_filter: Option<Vec<String>>,
398 }
399}
400
401pub mod icon_theme_selector {
402 use gpui::Action;
403 use schemars::JsonSchema;
404 use serde::Deserialize;
405
406 /// Toggles the icon theme selector interface.
407 #[derive(PartialEq, Clone, Default, Debug, Deserialize, JsonSchema, Action)]
408 #[action(namespace = icon_theme_selector)]
409 #[serde(deny_unknown_fields)]
410 pub struct Toggle {
411 /// A list of icon theme names to filter the theme selector down to.
412 pub themes_filter: Option<Vec<String>>,
413 }
414}
415
416pub mod search {
417 use gpui::actions;
418 actions!(
419 search,
420 [
421 /// Toggles searching in ignored files.
422 ToggleIncludeIgnored
423 ]
424 );
425}
426pub mod buffer_search {
427 use gpui::{Action, actions};
428 use schemars::JsonSchema;
429 use serde::Deserialize;
430
431 /// Opens the buffer search interface with the specified configuration.
432 #[derive(PartialEq, Clone, Deserialize, JsonSchema, Action)]
433 #[action(namespace = buffer_search)]
434 #[serde(deny_unknown_fields)]
435 pub struct Deploy {
436 #[serde(default = "util::serde::default_true")]
437 pub focus: bool,
438 #[serde(default)]
439 pub replace_enabled: bool,
440 #[serde(default)]
441 pub selection_search_enabled: bool,
442 }
443
444 impl Deploy {
445 pub fn find() -> Self {
446 Self {
447 focus: true,
448 replace_enabled: false,
449 selection_search_enabled: false,
450 }
451 }
452
453 pub fn replace() -> Self {
454 Self {
455 focus: true,
456 replace_enabled: true,
457 selection_search_enabled: false,
458 }
459 }
460 }
461
462 actions!(
463 buffer_search,
464 [
465 /// Deploys the search and replace interface.
466 DeployReplace,
467 /// Dismisses the search bar.
468 Dismiss,
469 /// Focuses back on the editor.
470 FocusEditor
471 ]
472 );
473}
474pub mod settings_profile_selector {
475 use gpui::Action;
476 use schemars::JsonSchema;
477 use serde::Deserialize;
478
479 #[derive(PartialEq, Clone, Default, Debug, Deserialize, JsonSchema, Action)]
480 #[action(namespace = settings_profile_selector)]
481 pub struct Toggle;
482}
483
484pub mod agent {
485 use gpui::{Action, SharedString, actions};
486 use schemars::JsonSchema;
487 use serde::Deserialize;
488
489 actions!(
490 agent,
491 [
492 /// Opens the agent settings panel.
493 #[action(deprecated_aliases = ["agent::OpenConfiguration"])]
494 OpenSettings,
495 /// Opens the agent onboarding modal.
496 OpenOnboardingModal,
497 /// Resets the agent onboarding state.
498 ResetOnboarding,
499 /// Starts a chat conversation with the agent.
500 Chat,
501 /// Toggles the language model selector dropdown.
502 #[action(deprecated_aliases = ["assistant::ToggleModelSelector", "assistant2::ToggleModelSelector"])]
503 ToggleModelSelector,
504 /// Triggers re-authentication on Gemini
505 ReauthenticateAgent,
506 /// Add the current selection as context for threads in the agent panel.
507 #[action(deprecated_aliases = ["assistant::QuoteSelection", "agent::QuoteSelection"])]
508 AddSelectionToThread,
509 /// Resets the agent panel zoom levels (agent UI and buffer font sizes).
510 ResetAgentZoom,
511 /// Pastes clipboard content without any formatting.
512 PasteRaw,
513 ]
514 );
515
516 /// Opens a new agent thread with the provided branch diff for review.
517 #[derive(Clone, PartialEq, Deserialize, JsonSchema, Action)]
518 #[action(namespace = agent)]
519 #[serde(deny_unknown_fields)]
520 pub struct ReviewBranchDiff {
521 /// The full text of the diff to review.
522 pub diff_text: SharedString,
523 /// The base ref that the diff was computed against (e.g. "main").
524 pub base_ref: SharedString,
525 }
526
527 /// A single merge conflict region extracted from a file.
528 #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema)]
529 pub struct ConflictContent {
530 pub file_path: String,
531 pub conflict_text: String,
532 pub ours_branch_name: String,
533 pub theirs_branch_name: String,
534 }
535
536 /// Opens a new agent thread to resolve specific merge conflicts.
537 #[derive(Clone, PartialEq, Deserialize, JsonSchema, Action)]
538 #[action(namespace = agent)]
539 #[serde(deny_unknown_fields)]
540 pub struct ResolveConflictsWithAgent {
541 /// Individual conflicts with their full text.
542 pub conflicts: Vec<ConflictContent>,
543 }
544
545 /// Opens a new agent thread to resolve merge conflicts in the given file paths.
546 #[derive(Clone, PartialEq, Deserialize, JsonSchema, Action)]
547 #[action(namespace = agent)]
548 #[serde(deny_unknown_fields)]
549 pub struct ResolveConflictedFilesWithAgent {
550 /// File paths with unresolved conflicts (for project-wide resolution).
551 pub conflicted_file_paths: Vec<String>,
552 }
553}
554
555pub mod assistant {
556 use gpui::{Action, actions};
557 use schemars::JsonSchema;
558 use serde::Deserialize;
559 use uuid::Uuid;
560
561 actions!(
562 agent,
563 [
564 /// Toggles the agent panel.
565 Toggle,
566 #[action(deprecated_aliases = ["assistant::ToggleFocus"])]
567 ToggleFocus,
568 FocusAgent,
569 ]
570 );
571
572 /// Opens the rules library for managing agent rules and prompts.
573 #[derive(PartialEq, Clone, Default, Debug, Deserialize, JsonSchema, Action)]
574 #[action(namespace = agent, deprecated_aliases = ["assistant::OpenRulesLibrary", "assistant::DeployPromptLibrary"])]
575 #[serde(deny_unknown_fields)]
576 pub struct OpenRulesLibrary {
577 #[serde(skip)]
578 pub prompt_to_select: Option<Uuid>,
579 }
580
581 /// Deploys the assistant interface with the specified configuration.
582 #[derive(Clone, Default, Deserialize, PartialEq, JsonSchema, Action)]
583 #[action(namespace = assistant)]
584 #[serde(deny_unknown_fields)]
585 pub struct InlineAssist {
586 pub prompt: Option<String>,
587 }
588}
589
590/// Opens the recent projects interface.
591#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
592#[action(namespace = projects)]
593#[serde(deny_unknown_fields)]
594pub struct OpenRecent {
595 #[serde(default)]
596 pub create_new_window: bool,
597}
598
599/// Creates a project from a selected template.
600#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
601#[action(namespace = projects)]
602#[serde(deny_unknown_fields)]
603pub struct OpenRemote {
604 #[serde(default)]
605 pub from_existing_connection: bool,
606 #[serde(default)]
607 pub create_new_window: bool,
608}
609
610/// Opens the dev container connection modal.
611#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
612#[action(namespace = projects)]
613#[serde(deny_unknown_fields)]
614pub struct OpenDevContainer;
615
616/// Where to spawn the task in the UI.
617#[derive(Default, Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
618#[serde(rename_all = "snake_case")]
619pub enum RevealTarget {
620 /// In the central pane group, "main" editor area.
621 Center,
622 /// In the terminal dock, "regular" terminal items' place.
623 #[default]
624 Dock,
625}
626
627/// Spawns a task with name or opens tasks modal.
628#[derive(Debug, PartialEq, Clone, Deserialize, JsonSchema, Action)]
629#[action(namespace = task)]
630#[serde(untagged)]
631pub enum Spawn {
632 /// Spawns a task by the name given.
633 ByName {
634 task_name: String,
635 #[serde(default)]
636 reveal_target: Option<RevealTarget>,
637 },
638 /// Spawns a task by the tag given.
639 ByTag {
640 task_tag: String,
641 #[serde(default)]
642 reveal_target: Option<RevealTarget>,
643 },
644 /// Spawns a task via modal's selection.
645 ViaModal {
646 /// Selected task's `reveal_target` property override.
647 #[serde(default)]
648 reveal_target: Option<RevealTarget>,
649 },
650}
651
652impl Spawn {
653 pub fn modal() -> Self {
654 Self::ViaModal {
655 reveal_target: None,
656 }
657 }
658}
659
660/// Reruns the last task.
661#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
662#[action(namespace = task)]
663#[serde(deny_unknown_fields)]
664pub struct Rerun {
665 /// Controls whether the task context is reevaluated prior to execution of a task.
666 /// If it is not, environment variables such as ZED_COLUMN, ZED_FILE are gonna be the same as in the last execution of a task
667 /// If it is, these variables will be updated to reflect current state of editor at the time task::Rerun is executed.
668 /// default: false
669 #[serde(default)]
670 pub reevaluate_context: bool,
671 /// Overrides `allow_concurrent_runs` property of the task being reran.
672 /// Default: null
673 #[serde(default)]
674 pub allow_concurrent_runs: Option<bool>,
675 /// Overrides `use_new_terminal` property of the task being reran.
676 /// Default: null
677 #[serde(default)]
678 pub use_new_terminal: Option<bool>,
679
680 /// If present, rerun the task with this ID, otherwise rerun the last task.
681 #[serde(skip)]
682 pub task_id: Option<String>,
683}
684
685pub mod outline {
686 use std::sync::OnceLock;
687
688 use gpui::{AnyView, App, Window, actions};
689
690 actions!(
691 outline,
692 [
693 #[action(name = "Toggle")]
694 ToggleOutline
695 ]
696 );
697 /// A pointer to outline::toggle function, exposed here to sewer the breadcrumbs <-> outline dependency.
698 pub static TOGGLE_OUTLINE: OnceLock<fn(AnyView, &mut Window, &mut App)> = OnceLock::new();
699}
700
701actions!(
702 zed_predict_onboarding,
703 [
704 /// Opens the Zed Predict onboarding modal.
705 OpenZedPredictOnboarding
706 ]
707);
708actions!(
709 git_onboarding,
710 [
711 /// Opens the git integration onboarding modal.
712 OpenGitIntegrationOnboarding
713 ]
714);
715
716pub mod debug_panel {
717 use gpui::actions;
718 actions!(
719 debug_panel,
720 [
721 /// Toggles the debug panel.
722 Toggle,
723 /// Toggles focus on the debug panel.
724 ToggleFocus
725 ]
726 );
727}
728
729actions!(
730 debugger,
731 [
732 /// Toggles the enabled state of a breakpoint.
733 ToggleEnableBreakpoint,
734 /// Removes a breakpoint.
735 UnsetBreakpoint,
736 /// Opens the project debug tasks configuration.
737 OpenProjectDebugTasks,
738 ]
739);
740
741pub mod vim {
742 use gpui::actions;
743
744 actions!(
745 vim,
746 [
747 /// Opens the default keymap file.
748 OpenDefaultKeymap
749 ]
750 );
751}
752
753#[derive(Debug, Clone, PartialEq, Eq, Hash)]
754pub struct WslConnectionOptions {
755 pub distro_name: String,
756 pub user: Option<String>,
757}
758
759#[cfg(target_os = "windows")]
760pub mod wsl_actions {
761 use gpui::Action;
762 use schemars::JsonSchema;
763 use serde::Deserialize;
764
765 /// Opens a folder inside Wsl.
766 #[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
767 #[action(namespace = projects)]
768 #[serde(deny_unknown_fields)]
769 pub struct OpenFolderInWsl {
770 #[serde(default)]
771 pub create_new_window: bool,
772 }
773
774 /// Open a wsl distro.
775 #[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
776 #[action(namespace = projects)]
777 #[serde(deny_unknown_fields)]
778 pub struct OpenWsl {
779 #[serde(default)]
780 pub create_new_window: bool,
781 }
782}
783
784pub mod preview {
785 pub mod markdown {
786 use gpui::actions;
787
788 actions!(
789 markdown,
790 [
791 /// Opens a markdown preview for the current file.
792 OpenPreview,
793 /// Opens a markdown preview in a split pane.
794 OpenPreviewToTheSide,
795 ]
796 );
797 }
798
799 pub mod svg {
800 use gpui::actions;
801
802 actions!(
803 svg,
804 [
805 /// Opens an SVG preview for the current file.
806 OpenPreview,
807 /// Opens an SVG preview in a split pane.
808 OpenPreviewToTheSide,
809 ]
810 );
811 }
812}
813
814pub mod agents_sidebar {
815 use gpui::{Action, actions};
816 use schemars::JsonSchema;
817 use serde::Deserialize;
818
819 /// Toggles the thread switcher popup when the sidebar is focused.
820 #[derive(PartialEq, Clone, Deserialize, JsonSchema, Default, Action)]
821 #[action(namespace = agents_sidebar)]
822 #[serde(deny_unknown_fields)]
823 pub struct ToggleThreadSwitcher {
824 #[serde(default)]
825 pub select_last: bool,
826 }
827
828 actions!(
829 agents_sidebar,
830 [
831 /// Moves focus to the sidebar's search/filter editor.
832 FocusSidebarFilter,
833 ]
834 );
835}
836
837pub mod notebook {
838 use gpui::actions;
839
840 actions!(
841 notebook,
842 [
843 /// Opens a Jupyter notebook file.
844 OpenNotebook,
845 /// Runs all cells in the notebook.
846 RunAll,
847 /// Runs the current cell and stays on it.
848 Run,
849 /// Runs the current cell and advances to the next cell.
850 RunAndAdvance,
851 /// Clears all cell outputs.
852 ClearOutputs,
853 /// Moves the current cell up.
854 MoveCellUp,
855 /// Moves the current cell down.
856 MoveCellDown,
857 /// Adds a new markdown cell.
858 AddMarkdownBlock,
859 /// Adds a new code cell.
860 AddCodeBlock,
861 /// Restarts the kernel.
862 RestartKernel,
863 /// Interrupts the current execution.
864 InterruptKernel,
865 /// Move down in cells.
866 NotebookMoveDown,
867 /// Move up in cells.
868 NotebookMoveUp,
869 /// Enters the current cell's editor (edit mode).
870 EnterEditMode,
871 /// Exits the cell editor and returns to cell command mode.
872 EnterCommandMode,
873 ]
874 );
875}