Skip to content

Timeline: trim all selected layers together - #950

Merged
h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
Themolx:trim-selected-layers
Oct 12, 2026
Merged

h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
Themolx:trim-selected-layers

Conversation

@Themolx

@Themolx Themolx commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #965.

What

In the Timeline, dragging the in- or out-point edge of a layer bar while several layers are selected now trims all selected layers by the same amount, each from its own in/out point (After Effects behaviour). Before this change, only the dragged layer was trimmed. Moving a bar already acted on the whole selection.

How

  • layer.timing gains relative inDelta / outDelta params (seconds, snapped to frames), applied per layer:
    • in-point stops at the comp start (0) and at out − 1 frame;
    • out-point stops at the comp end and at in + 1 frame;
    • a point that is already outside the comp trims from where it is and does not jump onto the edge.
  • The timeline bar drag (panels/timeline.rs) sends inDelta/outDelta for the selection (or for just the dragged layer if it isn't selected). It keeps the existing merge key, so a whole drag is one undo step.
  • Updated the command params doc, docs/agents.md and docs/architecture.md.

Manual testing

I'm a long-time After Effects power user, and this now matches how AE behaves. I tested it by hand in the desktop app: with several layers selected, dragging the in or out edge of one of them trims all selected layers together, each from its own edge.

Environment

Developed and tested on macOS 13.7.8 (Ventura), Apple M1 (arm64), Rust 1.97.1 (Homebrew).

Tests

  • New engine test relative_trim_moves_every_selected_layer_by_the_same_delta: two layers with different in/out points trim by the same delta; a merged drag is one undo step and undoes as one; clamping at the comp start/end and at one frame of layer; no jump for a point outside the comp.
  • cargo fmt, clippy (-D warnings), xtask layers and xtask assets pass.
  • cargo test --workspace --release --no-fail-fast on my Mac: the only failures are environment-only and unrelated to this change:
    • effects golden hashes (gen_golden, sim_golden, particle_golden);
    • ffmpeg-oracle VP9/AV1 tests (crates/export, crates/media);
    • the system-font fallback test (crates/text);
    • image_sequences_roundtrip (a shared build-dir race with other local worktrees).
      xtask wasm can't run locally because there is no wasm32 target in Homebrew Rust. Other tests that failed in the parallel run pass in isolation.

🤖 Generated with Claude Code

Dragging the in or out edge of a selected layer's bar now trims every
selected layer by the same delta from its own in/out point, as in After
Effects. layer.timing gains relative inDelta/outDelta params (seconds,
frame-snapped), clamped to the comp start/end and to one frame of layer;
the drag stays one undo step via the merge key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Themolx
Themolx marked this pull request as ready for review October 12, 2026 06:27
@h-a-n-a-s-h-i
h-a-n-a-s-h-i merged commit 8e6c3e0 into storytold:main Oct 12, 2026
@echelon

echelon commented Oct 12, 2026

Copy link
Copy Markdown
Member

Merged. Thank you for the contribution, @Themolx!

If you haven't already, come join us on Discord: https://discord.gg/artcraft. It's the best place to discuss what you're working on next and to coordinate with other contributors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature/Bug] Drag-trimming multiple selected layers only affects a single layer

3 participants