From 9cabeea68bfe56c10b2f9649677fa73da0273019 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sun, 4 Oct 2026 11:32:11 +0700 Subject: [PATCH] M3.8: register the split paint modules next to paint so the command palette keeps listing them (Stroke Options for "stroke") Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/mod.rs | 12 +++++++----- crates/engine/src/tests_cmdsplit.rs | 5 +++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/crates/engine/src/cmd/mod.rs b/crates/engine/src/cmd/mod.rs index 26dd788f..1df0c1bc 100644 --- a/crates/engine/src/cmd/mod.rs +++ b/crates/engine/src/cmd/mod.rs @@ -153,6 +153,13 @@ pub fn command_specs() -> &'static [CommandSpec] { v.extend(select::specs()); v.extend(wand::specs()); v.extend(paint::specs()); + // Split out of `paint` (M3.8); kept next to it so lists in registry order (the command + // palette, `engine.commands`) show them where they always were. + v.extend(stroke::specs()); + v.extend(appearance::specs()); + v.extend(style::specs()); + v.extend(swatch::specs()); + v.extend(gradient::specs()); v.extend(opacitymask::specs()); v.extend(layer::specs()); v.extend(draw2::specs()); @@ -184,11 +191,6 @@ pub fn command_specs() -> &'static [CommandSpec] { v.extend(patterncmds::specs()); v.extend(prefscmds::specs()); v.extend(distortcmds::specs()); - v.extend(appearance::specs()); - v.extend(gradient::specs()); - v.extend(stroke::specs()); - v.extend(style::specs()); - v.extend(swatch::specs()); v }) } diff --git a/crates/engine/src/tests_cmdsplit.rs b/crates/engine/src/tests_cmdsplit.rs index a14eab53..12e7f56d 100644 --- a/crates/engine/src/tests_cmdsplit.rs +++ b/crates/engine/src/tests_cmdsplit.rs @@ -48,8 +48,13 @@ fn moved_commands_keep_their_ids() { "swatch.duplicate", "swatch.sortByName", ]; + let pos = |id: &str| command_specs().iter().position(|c| c.id == id).unwrap_or_else(|| panic!("{id}")); + let (paint_end, after_paint) = (pos("transparency.set"), pos("transparency.makeOpacityMask")); for id in ids { assert_eq!(command_specs().iter().filter(|c| c.id == id).count(), 1, "{id}"); + // Registered right after `paint` (where they lived), so the command palette, which lists + // the first matches in registry order, still shows them (e.g. Stroke Options for "stroke"). + assert!((paint_end..after_paint).contains(&pos(id)), "{id}"); } }