diff --git a/crates/engine/src/settings/prefs/sections.rs b/crates/engine/src/settings/prefs/sections.rs index cb1d1bfb4..7a00b4915 100644 --- a/crates/engine/src/settings/prefs/sections.rs +++ b/crates/engine/src/settings/prefs/sections.rs @@ -93,7 +93,8 @@ page!(Previews { /// Largest downsampling while playing back: `1/2`, `1/4`, `1/8`. adaptive_resolution_limit: String = "1/8".into(), show_internal_wireframes: bool = false, - cache_frames_when_idle: bool = false, + /// Cache Frames When Idle: on by default (#3321); a saved `false` stays off. + cache_frames_when_idle: bool = true, fast_previews: bool = false, /// `faster` or `moreAccurate`. zoom_quality: String = "moreAccurate".into(), diff --git a/crates/engine/src/tests/m145.rs b/crates/engine/src/tests/m145.rs index 2bd32deb1..08ed81a3c 100644 --- a/crates/engine/src/tests/m145.rs +++ b/crates/engine/src/tests/m145.rs @@ -263,6 +263,17 @@ fn a_low_memory_episode_toasts_once_and_reapplies_the_budget() { assert_eq!(toasts(&mut s), 1); } +/// #3321: Cache Frames When Idle is on by default; a saved "off" stays off. +#[test] +fn cache_frames_when_idle_is_on_by_default() { + use crate::prefs::Prefs; + assert!(Prefs::default().previews.cache_frames_when_idle); + assert!(Prefs::from_json(r#"{"version": 5, "previews": {"fastPreviews": true}}"#).previews.cache_frames_when_idle, "not saved: on"); + let off = Prefs::from_json(r#"{"version": 5, "previews": {"cacheFramesWhenIdle": false}}"#); + assert!(!off.previews.cache_frames_when_idle, "saved off: off"); + assert!(!Prefs::from_json(&off.to_json()).previews.cache_frames_when_idle, "and after the next save"); +} + /// #3298: settings saved with the three cache budgets (version 4, or a later file that still /// has them) keep RAM Reserved for Other Applications and lose the budgets: they are not kept /// as unknown keys and written back. diff --git a/crates/ui-egui/src/state.rs b/crates/ui-egui/src/state.rs index 60a30e97e..922594292 100644 --- a/crates/ui-egui/src/state.rs +++ b/crates/ui-egui/src/state.rs @@ -806,7 +806,8 @@ impl Default for UiState { home_learn: false, home_templates: false, align_to_selection: false, - cache_when_idle: false, + // (the setting's default, #3321; the settings set it when they load) + cache_when_idle: true, tracker_source: None, layer_panel: None, layer_view: None,