EffectCraft: An open-source motion graphics and compositing tool written by scratch in pure Rust
fix: use timeline.revealProps from updated main instead of custom implementation, remove redundant test
caldiag548001e1a9a0
diff --git a/crates/ui-egui/src/panels/effect_controls.rs b/crates/ui-egui/src/panels/effect_controls.rsindex 737988802..7aa406635 100644--- a/crates/ui-egui/src/panels/effect_controls.rs+++ b/crates/ui-egui/src/panels/effect_controls.rs@@ -273,8 +273,13 @@ fn prop_row(app.auto.add(&format!("effectControls.prop.{uid}.name"), name_clip, &prop.name);p.with_clip_rect(name_clip.intersect(p.clip_rect())).text(pos2(swr.max.x + 6.0, cy), Align2::LEFT_CENTER, &prop.name, Tokens::ui(12.0), t.text);let name_response = ui.interact(name_clip, egui::Id::new(("ec-prop-name", uid)), Sense::click());- if name_response.double_clicked() && super::timeline::reveal_effect_property(app, layer.id.0, uid) {- app.raise_panel(crate::dock::PanelKind::Timeline);+ if name_response.double_clicked() {+ app.ui.timeline.search.clear();+ app.ui.timeline.scroll_to = Some(crate::state::ScrollTo::Property(uid));+ if let Err(e) = crate::menus::frontend(app, ui.ctx(), "timeline.revealProps", json!({"props": [{"layer": layer.id.0, "prop": uid}]})) {+ app.ui.status = e;+ }+ app.show_panel(crate::dock::PanelKind::Timeline);}app.auto.add(&format!("effectControls.prop.{uid}.name"), name_clip, &prop.name);let merge = format!("ec-{uid}");diff --git a/crates/ui-egui/src/panels/timeline.rs b/crates/ui-egui/src/panels/timeline.rsindex 789b1ff9b..aff4ef2c8 100644--- a/crates/ui-egui/src/panels/timeline.rs+++ b/crates/ui-egui/src/panels/timeline.rs@@ -1134,21 +1134,6 @@ pub(crate) fn open_effect_paths(app: &mut EffectcraftApp, layer: u64, props: &[uapp.ui.timeline.open_groups.extend(open);}-/// Show an Effect Controls property in its layer's Timeline Effects view.-pub(crate) fn reveal_effect_property(app: &mut EffectcraftApp, layer: u64, prop: u64) -> bool {- let Some(l) = app.session.active_comp().and_then(|c| c.layer(LayerId(layer))) else { return false };- let Some(fx) = l.effects().map(|g| g.uid) else { return false };- let path = enclosing_groups(l, prop);- if path.first() != Some(&fx) {- return false;- }- let tl = &mut app.ui.timeline;- tl.open_layers.insert(layer);- tl.layer_reveal.insert(layer, vec!["effects".into()]);- tl.open_groups.extend(path);- true-}-/// After a reveal shortcut that picks properties by state (EE expressions): those inside effects/// on `layers` show under their effect, twirled open.pub(crate) fn open_revealed(app: &mut EffectcraftApp, layers: &[u64], kinds: &[String]) {@@ -4385,32 +4370,6 @@ mod tests {assert!(labels(&app).iter().any(|r| r.trim() == "Scale"));}- #[test]- fn reveal_effect_property_opens_layer_effect_path_in_timeline() {- let mut app = app();- let comp = app.session.active_comp().unwrap().clone();- let bx = comp.layers.iter().find(|l| l.name == "Box").unwrap().id.0;- let prop = comp- .layer(LayerId(bx))- .and_then(|layer| layer.effects())- .and_then(|effects| effects.groups().next())- .and_then(|effect| effect.get("blurriness"))- .unwrap()- .uid;-- assert!(reveal_effect_property(&mut app, bx, prop));- assert!(app.ui.timeline.open_layers.contains(&bx));- assert_eq!(app.ui.timeline.layer_reveal.get(&bx), Some(&vec!["effects".to_string()]));-- let rows = labels(&app);- let effect = rows.iter().position(|row| row.trim() == ">Gaussian Blur").unwrap();- assert_eq!(rows.get(effect + 1).map(String::as_str).map(str::trim), Some("Blurriness"), "{rows:?}");- assert!(rows.iter().any(|row| row.trim() == "Blur Dimensions"), "Effects view shows the effect's other properties too: {rows:?}");-- let transform_prop = comp.layer(LayerId(bx)).and_then(|layer| layer.transform()).and_then(|group| group.get("position")).unwrap().uid;- assert!(!reveal_effect_property(&mut app, bx, transform_prop), "non-effect properties do not change the Effects view");- }-#[test]fn columns_toggle_and_layout() {let mut app = app();