forked from 1b-agent/fieldcraft-upstream
Session::opened identifies the open document
It changes when file.open, file.recover or file.sample replaces the session and when geometry.open opens another design file or starts a new model; an edit, a solve or reopening the same design keep it. The desktop app frames the view on that change (#233). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UhhZMBTviDQxZvwnyP89fo
This commit is contained in:
1 parent
a0f48c7207
commit
696b64c30f
3 files changed
+48
No files matched your search
@@ -90,6 +90,11 @@ fn open(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
"related": fit.related,
|
||||
"stale": {"mesh_bodies": fit.mesh_bodies, "sets": fit.sets, "seeds": fit.seeds},
|
||||
});
|
||||
// Another design file (or a new model) is another document; the same file opened again after
|
||||
// an edit is the same one.
|
||||
if new_model || s.sources.design.as_ref().is_none_or(|d| d.path() != source.path()) {
|
||||
s.mark_opened();
|
||||
}
|
||||
s.design = Some(Arc::new(design));
|
||||
s.sources.design = Some(source);
|
||||
Ok(out)
|
||||
|
||||
Reference in new issue
Block a user