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:
jyvikoandClaude Opus 5.5 authored and Irakli Kourtis committed 2026-10-14 22:29:44 -04:00
1 parent a0f48c7207
commit 696b64c30f
3 files changed
+48

No files matched your search

+1
View File
@@ -232,6 +232,7 @@ impl Session {
opened.limits = self.limits;
opened.file_access = std::mem::take(&mut self.file_access);
opened.clear_history();
opened.mark_opened();
*self = opened;
}
}
+5
View File
@@ -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)