From f842a58a4f8afc7ca638de10455579fff68c5122 Mon Sep 17 00:00:00 2001 From: skylartaylor Date: Sun, 25 Oct 2026 22:25:40 +0100 Subject: [PATCH] M14: clarify text selection and footage playback contracts --- crates/engine/src/commands/layer.rs | 4 ++-- crates/ui-egui/src/panels/footage_panel.rs | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/crates/engine/src/commands/layer.rs b/crates/engine/src/commands/layer.rs index 3b76100f4..ba4bdfb4a 100644 --- a/crates/engine/src/commands/layer.rs +++ b/crates/engine/src/commands/layer.rs @@ -169,8 +169,8 @@ fn text_range_p(p: &Value) -> Option> { /// and height are `w.abs().max(1.0)` and `h.abs().max(1.0)`; the layer position is the box centre. /// It is left justified unless `justify` is given. The layer is named by `name`, else the first 40 /// characters of the first text line, else "Text". `edit: true` also opens a new editing -/// session with the caret after the text and `created: true`, so leaving it empty removes the -/// layer. +/// session with anchor `0` and the caret after the text, selecting all initial text so the next +/// insertion replaces it. The session has `created: true`, so leaving it empty removes the layer. fn new_text(s: &mut Session, p: &Value) -> Result { let cid = comp_id(s, p)?; let comp = s.project.comp(cid).ok_or(EngineError::NoComp)?.clone(); diff --git a/crates/ui-egui/src/panels/footage_panel.rs b/crates/ui-egui/src/panels/footage_panel.rs index bc74ca69e..64c2ced12 100644 --- a/crates/ui-egui/src/panels/footage_panel.rs +++ b/crates/ui-egui/src/panels/footage_panel.rs @@ -1,7 +1,8 @@ //! The Footage panel (double-click footage in the Project panel): the source on its own time //! ruler, play / pause, In and Out marks, and the Edit Target buttons — Overlay Edit and Ripple //! Insert Edit — that cut the marked range into the active composition at its current time. -//! Everything runs `footage.*` commands (state in `EditorState::footage_panel`). +//! Time, marks and edits run `footage.*` commands (state in `EditorState::footage_panel`); +//! the Play/Pause flag is local egui state. use crate::i18n::{tr, tr_args}; use effectcraft_engine::project::{FootageKind, ItemKind}; @@ -17,7 +18,7 @@ use crate::theme::Tokens; /// per item, time and session revision), a ruler with the in/out span and CTI that scrubs on click /// or drag, Play/Pause, set In/Out, and Ripple Insert / Overlay Edit into the active comp. A solid /// shows its colour, footage without video says so, and an empty panel explains how to open one. -/// Playback and time changes run `footage.*` commands, so the panel and agents share the state. +/// Time changes run `footage.*` commands; the panel's Play/Pause flag is local egui state. pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) { let t = app.tokens; let ctx = ui.ctx().clone();