From a368683eb4ab26283ef605000c0237e04cb05b0e Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 28 Oct 2026 17:51:28 -0700 Subject: [PATCH] Shape Builder: Find Objects with select waits for a pending merge document.find is a query, so it ran at once while a Shape Builder merge was still being computed. With select it changes the selection, and the pending merge was then discarded. It now applies the merge first, as the other queries that select do. The command sweep also runs document.find with a filter and select, which one key at a time does not reach. --- crates/engine/src/command_sets.rs | 7 ++++--- crates/engine/tests/command_sweep.rs | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/command_sets.rs b/crates/engine/src/command_sets.rs index 6e7db0b10..8ebaf05f9 100644 --- a/crates/engine/src/command_sets.rs +++ b/crates/engine/src/command_sets.rs @@ -64,11 +64,12 @@ pub(crate) fn strip_replay_only(id: &str, p: &mut Value) { } /// Queries that apply the edit the active tool is computing before they run, as edits do -/// ([`Session::finish_tool_edit`]): a batch runs edits, Select All Instances and Lock Guides -/// change the selection, and the proof views, the preferences and added fonts give the documents -/// new revisions (they draw again, and type lays out again). +/// ([`Session::finish_tool_edit`]): a batch runs edits, Find Objects with `select`, Select All +/// Instances and Lock Guides change the selection, and the proof views, the preferences and added +/// fonts give the documents new revisions (they draw again, and type lays out again). const WAIT_FOR_TOOL_EDIT: &[&str] = &[ "command.batch", + "document.find", "symbol.selectInstances", "view.guides.lock", "view.proofSetup", diff --git a/crates/engine/tests/command_sweep.rs b/crates/engine/tests/command_sweep.rs index c584e1ed1..768bbecf2 100644 --- a/crates/engine/tests/command_sweep.rs +++ b/crates/engine/tests/command_sweep.rs @@ -250,6 +250,10 @@ fn commands_that_do_not_wait_for_a_tool_edit_change_no_document() { cases.push(json!({ k.as_str(): v })); } } + // Find Objects selects only with a filter, which one key at a time does not give it. + if c.id == "document.find" { + cases.extend([json!({"kind": "Path", "select": true}), json!({"name": "no such name", "select": true})]); + } for p in &cases { let mut s = fx.session(); let before = tool_edit_state(&s);