From 4f0e4901b521c2b70c085a10fcf2c5f56c9aebe6 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 13 Oct 2026 14:48:00 +0000 Subject: [PATCH 1/3] Menu strip: File, Edit, Selection and View menus (Pulsar-Native#1012) The script editor's toolbar starts with the editor menu strip. Its items dispatch the editor's existing actions to the open file's view, whose panel already handles them for the context menu. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01RXesb588JFPYCDBnK94vn5 --- src/script_editor/mod.rs | 53 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 4 deletions(-) diff --git a/src/script_editor/mod.rs b/src/script_editor/mod.rs index 3b5464e..6194038 100644 --- a/src/script_editor/mod.rs +++ b/src/script_editor/mod.rs @@ -638,6 +638,7 @@ impl ScriptEditor { let dirty = editor.current_is_modified(); let generating = editor.is_generating(); let status = editor.lsp_status(cx); + let view_focus = editor.current_view().map(|view| view.focus_handle(cx)); h_flex() .w_full() @@ -648,10 +649,16 @@ impl ScriptEditor { .border_b_1() .border_color(cx.theme().border) .child( - div() - .text_sm() - .text_color(cx.theme().muted_foreground) - .child(path), + h_flex() + .gap_2() + .items_center() + .child(Self::render_menus(view_focus)) + .child( + div() + .text_sm() + .text_color(cx.theme().muted_foreground) + .child(path), + ), ) .child( div() @@ -690,6 +697,44 @@ impl ScriptEditor { ) } + /// The editor's menu strip (Pulsar-Native#1012). Its items dispatch to + /// the open file's view, whose panel handles them as it does for the + /// context menu and the keys. + fn render_menus(view_focus: Option) -> impl IntoElement { + use text_editor::{ + EditorCopy, EditorCopyPath, EditorCut, EditorPaste, EditorRedo, EditorSave, + EditorSelectAll, EditorUndo, EditorUnfoldAll, + }; + let open = view_focus.is_some(); + let strip = plugin_editor_api::EditorMenuStrip::new("script-editor-menus") + .menu( + plugin_editor_api::EditorMenu::new("File") + .action_if("Save", EditorSave, open) + .action_if("Copy File Path", EditorCopyPath, open), + ) + .menu( + plugin_editor_api::EditorMenu::new("Edit") + .action_if("Undo", EditorUndo, open) + .action_if("Redo", EditorRedo, open) + .separator() + .action_if("Cut", EditorCut, open) + .action_if("Copy", EditorCopy, open) + .action_if("Paste", EditorPaste, open), + ) + .menu( + plugin_editor_api::EditorMenu::new("Selection") + .action_if("Select All", EditorSelectAll, open), + ) + .menu( + plugin_editor_api::EditorMenu::new("View") + .action_if("Unfold All", EditorUnfoldAll, open), + ); + match view_focus { + Some(focus) => strip.action_context(focus), + None => strip, + } + } + /// Synchronize scroll positions between left and right editors in diff mode fn sync_diff_editor_scrolls(&mut self, cx: &mut Context) { if self.mode != ScriptEditorMode::Diff { From 748af0e4b28b89a56bfcd3007db8d75828038351 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 13 Oct 2026 15:15:34 +0000 Subject: [PATCH 2/3] CI: build against Pulsar-Native with the shared editor menus The menu strip uses plugin_editor_api::EditorMenuStrip and EditorMenu, which landed in Pulsar-Native with #1167 (6c61db9aa). The check still checked out 55aa2dba1, which predates them. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01RXesb588JFPYCDBnK94vn5 --- .github/workflows/check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 52c1213..7653490 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -40,7 +40,7 @@ jobs: - uses: actions/checkout@v4 with: repository: Far-Beyond-Pulsar/Pulsar-Native - ref: 55aa2dba1c3cd5ddc31d7664985670a2414a4eb6 + ref: 6c61db9aacb29efc4a49bc23a7b1622eb6510a61 submodules: recursive path: pulsar From 8c7ac13dc8bd03da73abf2174f0795e0f6fcecab Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 13 Oct 2026 15:42:32 +0000 Subject: [PATCH 3/3] Standalone build: SceneDB at the revision Pulsar-Native pins Pulsar-Native 6c61db9aa (the revision the check builds against) pins SceneDB 81bb3557, and its Helio uses that revision's asset API (AssetId, register_loader, register_binding). This manifest's SceneDB patch still named 685b1b0a, so helio_component failed to compile. Cargo.lock is re-resolved by Cargo for the new pins; Gamma follows the revision plugin_editor_api now requires. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01RXesb588JFPYCDBnK94vn5 --- Cargo.lock | 13 ++++++++----- Cargo.toml | 4 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index acc9cc3..be1fa90 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2653,7 +2653,7 @@ dependencies = [ [[package]] name = "gamma" version = "0.2.0" -source = "git+https://github.com/Far-Beyond-Pulsar/Gamma?rev=b4ebf98486fb716d090d35b689a4eb8a0e414cc1#b4ebf98486fb716d090d35b689a4eb8a0e414cc1" +source = "git+https://github.com/Far-Beyond-Pulsar/Gamma?rev=c8c52864aa7b3e129ab8be4b2d2d5e6af03c255b#c8c52864aa7b3e129ab8be4b2d2d5e6af03c255b" dependencies = [ "gamma-core", "gamma-derive", @@ -2662,7 +2662,7 @@ dependencies = [ [[package]] name = "gamma-core" version = "0.2.0" -source = "git+https://github.com/Far-Beyond-Pulsar/Gamma?rev=b4ebf98486fb716d090d35b689a4eb8a0e414cc1#b4ebf98486fb716d090d35b689a4eb8a0e414cc1" +source = "git+https://github.com/Far-Beyond-Pulsar/Gamma?rev=c8c52864aa7b3e129ab8be4b2d2d5e6af03c255b#c8c52864aa7b3e129ab8be4b2d2d5e6af03c255b" dependencies = [ "rustc-hash 2.1.3", ] @@ -2670,7 +2670,7 @@ dependencies = [ [[package]] name = "gamma-derive" version = "0.2.0" -source = "git+https://github.com/Far-Beyond-Pulsar/Gamma?rev=b4ebf98486fb716d090d35b689a4eb8a0e414cc1#b4ebf98486fb716d090d35b689a4eb8a0e414cc1" +source = "git+https://github.com/Far-Beyond-Pulsar/Gamma?rev=c8c52864aa7b3e129ab8be4b2d2d5e6af03c255b#c8c52864aa7b3e129ab8be4b2d2d5e6af03c255b" dependencies = [ "proc-macro2", "quote", @@ -6520,8 +6520,10 @@ name = "plugin_editor_api" version = "0.1.0" dependencies = [ "engine_subsystems", + "gamma", "gpui-ce", "inventory", + "profiling 0.1.0", "pulsar_events", "pulsar_lsp", "pulsar_reflection", @@ -6547,6 +6549,7 @@ dependencies = [ "once_cell", "parking_lot", "plugin_editor_api", + "profiling 0.1.0", "pulsar_events", "pulsar_world_registry", "serde_json", @@ -6989,7 +6992,7 @@ dependencies = [ [[package]] name = "pulsar_scenedb" version = "0.1.0" -source = "git+https://github.com//Far-Beyond-Pulsar/SceneDB?rev=685b1b0aa212b64912549efd583c93480bea027f#685b1b0aa212b64912549efd583c93480bea027f" +source = "git+https://github.com//Far-Beyond-Pulsar/SceneDB?rev=81bb3557b71014ccc00f1275f60138867cc492ea#81bb3557b71014ccc00f1275f60138867cc492ea" dependencies = [ "ahash", "profiling 0.1.0", @@ -7005,7 +7008,7 @@ dependencies = [ [[package]] name = "pulsar_scenedb_derive" version = "0.1.0" -source = "git+https://github.com//Far-Beyond-Pulsar/SceneDB?rev=685b1b0aa212b64912549efd583c93480bea027f#685b1b0aa212b64912549efd583c93480bea027f" +source = "git+https://github.com//Far-Beyond-Pulsar/SceneDB?rev=81bb3557b71014ccc00f1275f60138867cc492ea#81bb3557b71014ccc00f1275f60138867cc492ea" dependencies = [ "proc-macro2", "pulsar_reflection_codegen", diff --git a/Cargo.toml b/Cargo.toml index c865aec..a5593aa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -132,8 +132,8 @@ pulsar_reflection_codegen = { path = "../../../crates/external/pulsar-reflection # The patch VALUE uses the `//`-spelled URL: cargo refuses a patch that resolves # to the exact same source, so the alternate spelling carries the pushed rev. [patch."https://github.com/Far-Beyond-Pulsar/SceneDB"] -pulsar_scenedb = { git = "https://github.com//Far-Beyond-Pulsar/SceneDB", rev = "685b1b0aa212b64912549efd583c93480bea027f" } -pulsar_scenedb_derive = { git = "https://github.com//Far-Beyond-Pulsar/SceneDB", rev = "685b1b0aa212b64912549efd583c93480bea027f" } +pulsar_scenedb = { git = "https://github.com//Far-Beyond-Pulsar/SceneDB", rev = "81bb3557b71014ccc00f1275f60138867cc492ea" } +pulsar_scenedb_derive = { git = "https://github.com//Far-Beyond-Pulsar/SceneDB", rev = "81bb3557b71014ccc00f1275f60138867cc492ea" } [profile.dev.package."*"] # Keep our crate fast to compile, but optimize heavy dependencies