Merge branch 'worktree-agent-acb4c3cd3f5057c6a' (M15.1 web build)

Also: render uses web_time::Instant in layer styles; renderQueue.add documents
its render-settings/output-module keys so checked execution accepts them (+test).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Brandon Thomas
2026-10-02 00:41:56 -04:00
co-authored by Claude Opus 5.5
32 changed files with 1375 additions and 94 deletions
+10 -1
View File
@@ -358,7 +358,9 @@ fn render_frame(app: &EffectcraftApp, p: &Value) -> Outcome {
Err(e) => return err(e),
};
let mut out = json!({"comp": cid.0, "time": t.seconds(), "width": w, "height": h});
if p.get("base64").and_then(Value::as_bool) == Some(true) {
// (the web has no file system: inline unless a path is given)
let inline = p.get("base64").and_then(Value::as_bool).unwrap_or(cfg!(target_arch = "wasm32") && p.get("path").is_none());
if inline {
out["png"] = json!(base64(&png));
return ok(out);
}
@@ -430,6 +432,13 @@ pub fn save_screenshot(ctx: &egui::Context, image: &egui::ColorImage, path: Opti
rgba.extend_from_slice(&[c.r(), c.g(), c.b(), 255]);
}
}
if path.is_none() && cfg!(target_arch = "wasm32") {
// no file system on the web: inline PNG
return match encode_png(&rgba, cw as u32, ch as u32) {
Ok(png) => json!({"ok": true, "result": {"png": base64(&png), "width": cw, "height": ch}}),
Err(e) => json!({"ok": false, "error": e}),
};
}
let path = path.map(str::to_string).unwrap_or_else(|| std::env::temp_dir().join("effectcraft-screenshot.png").to_string_lossy().to_string());
match encode_png(&rgba, cw as u32, ch as u32) {
Ok(png) => match std::fs::write(&path, png) {