From ea67c468809f8a90d648c95e205be580980ffd19 Mon Sep 17 00:00:00 2001 From: arnav-hiwarkar Date: Sat, 17 Oct 2026 14:40:44 +0530 Subject: [PATCH] #1714: doc comments name the saved current times Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/lib.rs | 9 +++++---- crates/project/src/lib.rs | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 3086f378..d6c484d9 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -984,16 +984,17 @@ impl Session { self.events.push(Event::OpenComp(id)); } - /// The open compositions, as a project file records them ([`effectcraft_project::SavedView`]). + /// The open compositions and their current times, as a project file records them + /// ([`effectcraft_project::SavedView`]). pub fn saved_view(&self) -> effectcraft_project::SavedView { let comp_times = self.state.times.iter().filter(|(id, _)| self.project.comp(**id).is_some()).map(|(id, t)| (*id, *t)).collect(); effectcraft_project::SavedView { active_comp: self.state.active_comp, open_comps: self.state.open_comps.clone(), comp_times } } /// Reopen the compositions a project file was saved with (#748), each at its saved current - /// time (#1714). Ids that no longer name a - /// comp are skipped; with none left the project stays on the comp [`Session::replace_project`] - /// opened (its first), as files from before the view was saved do. + /// time (#1714). Ids that no longer name a comp are skipped; with none left the project stays + /// on the comp [`Session::replace_project`] opened (its first), as files from before the view + /// was saved do. pub fn restore_view(&mut self, view: &effectcraft_project::SavedView) { for (id, t) in &view.comp_times { if let Some(comp) = self.project.comp(*id) { diff --git a/crates/project/src/lib.rs b/crates/project/src/lib.rs index be35590a..a4bffbe0 100644 --- a/crates/project/src/lib.rs +++ b/crates/project/src/lib.rs @@ -49,8 +49,9 @@ pub fn saved_by(text: &str) -> Option { serde_json::from_str::(text).ok()?.saved_by } -/// The compositions that were open when a project file was saved (`activeComp` and `openComps` -/// next to `savedBy`), so it reopens where it was left (#748). Editor state rather than project +/// The compositions that were open when a project file was saved and their current times +/// (`activeComp`, `openComps` and `compTimes` next to `savedBy`), so it reopens where it was left +/// (#748, #1714). Editor state rather than project /// content: opening a comp doesn't make the project unsaved, and it isn't part of /// [`Project`]. Older files have none; older versions ignore it. #[derive(Clone, Debug, Default, PartialEq, Eq, Serialize)]