#1714: doc comments name the saved current times

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
arnav-hiwarkarandClaude Opus 5.5 committed 2026-10-17 14:40:44 +05:30
1 parent b9172fec2f
commit ea67c46880
2 files changed
+8 -6

No files matched your search

+5 -4
View File
@@ -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) {
+3 -2
View File
@@ -49,8 +49,9 @@ pub fn saved_by(text: &str) -> Option<String> {
serde_json::from_str::<Meta>(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)]