Store each comp's layer selection on its own.

A single selected_layers list kept ids from every comp, so the active comp looked selected whenever another comp was. Opening a comp and running a script against a different comp now park and restore that selection.
This commit is contained in:
Vikram Bhaskaran
2026-10-13 17:46:02 +11:00
parent 8c986a1bec
commit c46f80faa2
5 changed files with 123 additions and 23 deletions
+5 -4
View File
@@ -159,10 +159,11 @@ fn close(s: &mut Session, p: &Value) -> Result<Value> {
let id = comp_id(s, p)?;
s.state.open_comps.retain(|c| *c != id);
if s.state.active_comp == Some(id) {
s.state.active_comp = s.state.open_comps.last().copied();
s.state.selected_layers.clear();
s.state.selected_keys.clear();
s.state.selected_props.clear();
if let Some(next) = s.state.open_comps.last().copied() {
s.activate_comp(next);
} else {
s.activate_comp_none();
}
}
Ok(Value::Null)
}