diff --git a/crates/engine/src/cmd/aep.rs b/crates/engine/src/cmd/aep.rs index 3445a478b..eab218100 100644 --- a/crates/engine/src/cmd/aep.rs +++ b/crates/engine/src/cmd/aep.rs @@ -22,6 +22,8 @@ pub fn is_aep_path(path: &str) -> bool { std::path::Path::new(path).extension().and_then(std::ffi::OsStr::to_str).is_some_and(|e| e.eq_ignore_ascii_case("aep") || e.eq_ignore_ascii_case("aepx")) } +/// `file.importAep`: the `.aep` / `.aepx` at `path` into the open project, in a folder named after +/// the file; refused ([`EngineError::Refused`]) when parts would be lost and `allowLosses` is not set. fn import_aep(s: &mut Session, p: &Value) -> Result { let path = str_p(p, "path").ok_or_else(|| bad("file.importAep", "missing `path`"))?.to_string(); let allow_losses = b_p(p, "allowLosses").unwrap_or(false); @@ -97,6 +99,8 @@ fn import_aep(s: &mut Session, p: &Value) -> Result { })) } +/// `file.exportAep`: the open project as an `.aep` at `path`; refused ([`EngineError::Refused`]) +/// when parts would be lost and `allowLosses` is not set. fn export_aep(s: &mut Session, p: &Value) -> Result { let path = str_p(p, "path").ok_or_else(|| bad("file.exportAep", "missing `path`"))?.to_string(); let allow_losses = b_p(p, "allowLosses").unwrap_or(false); @@ -133,6 +137,7 @@ fn export_aep(s: &mut Session, p: &Value) -> Result { Ok(json!({"path": path, "bytes": res.bytes.len(), "report": res.report})) } +/// File ▸ Import / Export ▸ Adobe After Effects Project…. pub fn specs() -> Vec { vec![ cmd!( diff --git a/crates/engine/src/tests/aep_export.rs b/crates/engine/src/tests/aep_export.rs index a716ef7bc..fc5ea29bc 100644 --- a/crates/engine/src/tests/aep_export.rs +++ b/crates/engine/src/tests/aep_export.rs @@ -73,6 +73,7 @@ fn bad_input_is_an_error_not_a_crash() { assert!(empty.execute_checked("file.exportAep", json!({"path": path})).is_ok()); } +/// File ▸ Export ▸ Adobe After Effects Project… is in the menu under that label. #[test] fn aep_export_menu_entry_exists() { let entries = crate::menus::entries(); diff --git a/crates/engine/src/tests/aep_import.rs b/crates/engine/src/tests/aep_import.rs index 7aba82983..c62987ddf 100644 --- a/crates/engine/src/tests/aep_import.rs +++ b/crates/engine/src/tests/aep_import.rs @@ -231,6 +231,7 @@ fn file_import_takes_after_effects_projects() { let _ = std::fs::remove_dir_all(&dir); } +/// File ▸ Import ▸ Adobe After Effects Project… is in the menu under that label. #[test] fn aep_menu_entry_exists() { let entries = crate::menus::entries(); diff --git a/crates/ui-egui/src/panels/aep_losses.rs b/crates/ui-egui/src/panels/aep_losses.rs index 14010a5df..4eb71104d 100644 --- a/crates/ui-egui/src/panels/aep_losses.rs +++ b/crates/ui-egui/src/panels/aep_losses.rs @@ -90,6 +90,8 @@ pub fn lines(report: &Value) -> Vec<(String, Vec)> { .collect() } +/// Draw the prompt for the conversion waiting on it: its losses by category, Cancel and Import / +/// Export Anyway (Escape cancels). pub fn show(app: &mut EffectcraftApp, ctx: &egui::Context, t: &Tokens) { let Some((id, _, report)) = app.dialog_state.aep_losses.command.clone() else { app.dialog = None; diff --git a/crates/ui-egui/src/panels/home.rs b/crates/ui-egui/src/panels/home.rs index e61d523b1..601f4f1ef 100644 --- a/crates/ui-egui/src/panels/home.rs +++ b/crates/ui-egui/src/panels/home.rs @@ -475,6 +475,8 @@ fn home_page( } } +/// Run the commands the Home screen's buttons and recent files asked for, and leave Home once one +/// opened something (not while a dialog it opened waits, nor when only the list changed). fn run_actions(app: &mut EffectcraftApp, ctx: &egui::Context, actions: Vec<(&str, serde_json::Value)>) { for (id, params) in actions { let before = (app.session.path.clone(), app.session.revision);