refactor(kernels): extract reusable clipboard and matchprop kernels

Publishes app-free domain logic for shared use: match_special_props and PolylineMatchStyle move to entities::match_props; xdict trio usable headlessly; new match_layer, copy_to_clipboard, paste_entities and match_properties kernels over CadDocument. Handlers stay thin shells keeping undo, dirty flags, selection and command-line echo.

Adds cross-document copy, paste and property-match tests plus a headless proof driving copy, paste and match with no app instance.
This commit is contained in:
Karim Jerbi committed 2026-09-24 21:47:14 +01:00
1 parent e4fa5232f6
commit 7052016dce
6 files changed
+1556 -631

No files matched your search

+3 -9
View File
@@ -37,15 +37,9 @@ impl OpenCADStudio {
handles: &[acadrust::Handle],
base: glam::DVec3,
) -> usize {
let (entities, deps) = {
let document = &self.tabs[i].scene.document;
let entities: Vec<_> = handles
.iter()
.filter_map(|&handle| document.get_entity(handle).cloned())
.collect();
let deps = super::super::ClipboardDeps::capture(document, &entities);
(entities, deps)
};
// Clone + dep-capture live in the shared kernel; storage stays here.
let (entities, deps) =
super::super::command_driver::copy_to_clipboard_kernel(&self.tabs[i].scene.document, handles);
let count = entities.len();
self.clipboard_base = base;
self.clipboard = entities;