From e508073632ca28802a1c8cf24e87f5814ed9440d Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 28 Nov 2026 12:03:06 -0800 Subject: [PATCH] 3D: take main's OK fix instead of this branch's #9970 fixed the 3D dialogs' OK on main by ending the running preview before the values run again. This takes out this branch's earlier fix (LivePreview::rerun_next) so the two do not overlap. --- crates/ui-egui/src/dialogs/preview.rs | 6 ------ crates/ui-egui/src/dialogs/three_d.rs | 5 ++--- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/crates/ui-egui/src/dialogs/preview.rs b/crates/ui-egui/src/dialogs/preview.rs index f55dadb7c6..2e029fc1c6 100644 --- a/crates/ui-egui/src/dialogs/preview.rs +++ b/crates/ui-egui/src/dialogs/preview.rs @@ -94,12 +94,6 @@ impl LivePreview { Some(answer) } - /// Forgets the values last previewed and keeps the interaction they ran in, so the next [`Self::run`] previews - /// them again inside that interaction and returns the command's answer, a refusal included. - pub(crate) fn rerun_next(&mut self) { - self.previewed = None; - } - /// OK: keeps the previewed `cmd` as one undo step, or, when its preview is not running, keeps typing in progress /// and runs `cmd` as a step of its own; the command's warning, or a plug-in run's notice, shows in the status bar /// either way. Another edit in progress is left as it is and OK is refused. On an error the dialog stays open. diff --git a/crates/ui-egui/src/dialogs/three_d.rs b/crates/ui-egui/src/dialogs/three_d.rs index 293aae4f45..4706074962 100644 --- a/crates/ui-egui/src/dialogs/three_d.rs +++ b/crates/ui-egui/src/dialogs/three_d.rs @@ -254,9 +254,8 @@ fn ok(app: &mut VectorcraftApp, answer: &ParamResult) -> Result<(), String> { return Err(why); } let (cmd, p, _) = s.request(&answer.fields); - // OK must validate afresh: the live preview also caches refused requests. The preview keeps its interaction, so - // the values run again inside it and the commit below keeps that interaction as the undo step. - s.preview.rerun_next(); + // OK must validate afresh: the live preview also caches refused requests. + s.preview = LivePreview::default(); match s.run_preview(app, cmd, &p) { Some(Ok(())) if finish_unchanged_preview(app) => return Ok(()), Some(Err(why)) => {