fix: Keep the window draggable while a design opens (#643)
The loading box was a full-window modal whose backdrop covered the custom title bar. It is now a light overlay under the title bar, so dragging, snapping, resizing and the window buttons keep working during open, import and recovery. The timeline rebuild shows feature N of M, and Cancel or Esc stops it at the next feature (solidcraft_doc::progress). Recovery restore now runs off the window thread too. A control or MCP doc.open or import is answered once the file is in and doesn't block frames; edits sent meanwhile wait their turn. The web build still opens in place. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8be0f64f5a
commit
392fae1af4
11 files changed
+734
-125
No files matched your search
@@ -732,4 +732,33 @@ mod tests {
|
||||
assert!(std::fs::read_to_string(&packaged).unwrap().contains("solidcraft/"));
|
||||
std::fs::remove_dir_all(dir).unwrap();
|
||||
}
|
||||
|
||||
/// A watched open reports the timeline's progress; cancelled, it skips the rebuild.
|
||||
#[test]
|
||||
fn watched_open_reports_progress_and_stops_when_cancelled() {
|
||||
use solidcraft_doc::progress::{Progress, watch};
|
||||
use std::sync::Arc;
|
||||
let dir = std::env::temp_dir().join(format!("solidcraft-watched-open-{}", std::process::id()));
|
||||
std::fs::create_dir_all(&dir).unwrap();
|
||||
let path = dir.join("three.solidcraft").to_string_lossy().to_string();
|
||||
let mut s = Session::default();
|
||||
for x in [0, 20, 40] {
|
||||
s.execute("solid.box", &json!({"length":10,"width":10,"height":10,"corner":[x,0,0]})).unwrap();
|
||||
}
|
||||
s.execute("file.save", &json!({"path":path})).unwrap();
|
||||
|
||||
let progress = Arc::new(Progress::default());
|
||||
let mut opened = Session::default();
|
||||
watch(progress.clone(), || opened.execute("doc.open", &json!({"path":path}))).unwrap();
|
||||
assert_eq!(progress.features(), (3, 3));
|
||||
assert_eq!(opened.world_state().bodies.len(), 3);
|
||||
|
||||
let progress = Arc::new(Progress::default());
|
||||
progress.cancel();
|
||||
let mut stopped = Session::default();
|
||||
watch(progress, || stopped.execute("doc.open", &json!({"path":path}))).unwrap();
|
||||
assert!(stopped.model.results.iter().all(|r| r.skipped), "no feature was rebuilt after Cancel");
|
||||
assert!(stopped.world_state().bodies.is_empty());
|
||||
std::fs::remove_dir_all(dir).unwrap();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user