Shortcuts: work area from the selection, most recent comp

comp.workAreaToSelection (Cmd+Alt+B) spans the selected layers, or the
whole composition with none selected. comp.activateRecent (Shift+Esc)
goes back to the composition that was active most recently within the
active one's nesting hierarchy; EditorState keeps recent_comps for it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
pravdomil
2026-10-12 20:57:21 +02:00
co-authored by Claude Opus 5.5
parent a644bb07c9
commit d444eceb90
5 changed files with 147 additions and 0 deletions
+9
View File
@@ -200,6 +200,9 @@ pub struct EditorState {
pub active_comp: Option<ItemId>,
/// Open compositions (viewer/timeline tabs), in tab order.
pub open_comps: Vec<ItemId>,
/// Compositions that were active before the current one, most recent first (Shift+Esc).
#[serde(default)]
pub recent_comps: Vec<ItemId>,
/// Current time per comp (the CTI).
pub times: std::collections::BTreeMap<ItemId, Tick>,
pub selected_layers: Vec<LayerId>,
@@ -879,6 +882,12 @@ impl Session {
self.state.open_comps.push(id);
}
if self.state.active_comp != Some(id) {
let previous = self.state.active_comp;
self.state.recent_comps.retain(|c| *c != id && Some(*c) != previous);
if let Some(previous) = previous {
self.state.recent_comps.insert(0, previous);
self.state.recent_comps.truncate(32);
}
self.state.active_comp = Some(id);
self.state.selected_layers.clear();
self.state.selected_props.clear();