Feature editor: a section, an analysis or the selection changed while it is open leaves OK and Cancel working (#10687) (#10822)

The editor accepts revision changes that only changed what is shown,
counted by the display revision, but only hiding and showing counted
there. Section Analysis, the surface analyses, continuity, the
selection, the status pill catching up and view.render_select bumped
the revision alone, so turning a section off with an editor open made
OK refuse ("the design changed while the feature editor was open") and
Cancel leave the timeline rolled back. They now go through
refresh_display, as visibility changes do.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
semmelrinde
2026-11-02 00:18:00 +00:00
committed by GitHub
parent a735620aa8
commit a22ea76ab6
7 changed files with 44 additions and 13 deletions
+2 -2
View File
@@ -1330,7 +1330,7 @@ fn select_set(s: &mut Session, p: &Value) -> Result<Value> {
s.selection.push(x);
}
}
s.revision += 1;
s.refresh_display();
Ok(json!({"selected": s.selection.len()}))
}
@@ -1387,7 +1387,7 @@ fn select_same_look(s: &mut Session, p: &Value) -> Result<Value> {
fn select_clear(s: &mut Session, _p: &Value) -> Result<Value> {
s.selection.clear();
s.revision += 1;
s.refresh_display();
Ok(json!({"selected": 0}))
}
+2 -2
View File
@@ -24,7 +24,7 @@ fn section(s: &mut Session, p: &Value) -> Result<Value> {
if bool_(p, "clear").unwrap_or(false) {
s.section = None;
s.status_slot(crate::status_items::StatusId::Section, false);
s.revision += 1;
s.refresh_display();
return serde_json::to_value(contract::SectionResult { section: None, param_warnings: Vec::new() }).map_err(|e| bad(cmd, e.to_string()));
}
// A named plane's world axis: which component of a point lies along its normal.
@@ -82,7 +82,7 @@ fn section(s: &mut Session, p: &Value) -> Result<Value> {
s.section_hatch = bool_(p, "hatch").unwrap_or(true);
s.status_slot(crate::status_items::StatusId::Section, true);
s.status_activated(crate::status_items::StatusId::Section);
s.revision += 1;
s.refresh_display();
let section = contract::Section {
origin: [origin.x, origin.y, origin.z],
normal: [normal.x, normal.y, normal.z],
+3 -3
View File
@@ -91,7 +91,7 @@ fn set(s: &mut Session, p: &Value, a: SurfaceAnalysis) -> Result<Value> {
s.analysis = Some(a);
}
s.status_analysis_changed((!bool_(p, "clear").unwrap_or(false)).then_some(crate::status_items::StatusId::SurfaceAnalysis));
s.revision += 1;
s.refresh_display();
let vector = |v: Vec3| [v.x, v.y, v.z];
let analysis = s.analysis.map(|a| match a {
SurfaceAnalysis::Zebra { stripes } => contract::Analysis::Zebra { stripes },
@@ -155,7 +155,7 @@ fn continuity(s: &mut Session, p: &Value) -> Result<Value> {
if bool_(p, "clear").unwrap_or(false) {
s.continuity.clear();
s.status_analysis_changed(None);
s.revision += 1;
s.refresh_display();
return serde_json::to_value(contract::ContinuityResult::Cleared {
analysis: "continuity".into(),
cleared: true,
@@ -273,7 +273,7 @@ fn continuity(s: &mut Session, p: &Value) -> Result<Value> {
s.continuity = seams;
}
s.status_analysis_changed(Some(crate::status_items::StatusId::Continuity));
s.revision += 1;
s.refresh_display();
serde_json::to_value(contract::ContinuityResult::Measured {
analysis: "continuity".into(),
samples,
+1 -1
View File
@@ -315,7 +315,7 @@ fn render_select(s: &mut Session, p: &Value) -> Result<Value> {
let result = serde_json::to_value(request).map_err(|e| bad("view.render_select", e.to_string()))?;
if !s.selection.is_empty() {
s.selection.clear();
s.revision += 1;
s.refresh_display();
}
Ok(result)
}