Skip to content

Effects & Presets: drag animation presets onto a layer - #1317

Merged
h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
LloydNicholson:fix/drag-presets-onto-layers
Oct 18, 2026
Merged

h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
LloydNicholson:fix/drag-presets-onto-layers

Conversation

@LloydNicholson

@LloydNicholson LloydNicholson commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Animation presets in Effects & Presets (text presets, built-in Transitions and user .ecpreset files) can only be applied by double-click. Dragging one onto a layer does nothing: no drag ghost, no drop highlight, no undo entry. Effects already drag and drop fine, and After Effects lets you drag presets onto a layer.

The cause: preset_row used Sense::click() only and never set a DragPayload.

Fix

  • New DragPayload::Preset { preset: PresetRef, name }. PresetRef (Text / Builtin / File) maps a preset to its command (layer.applyTextPreset, anim.applyBuiltinPreset, anim.applyPreset), and apply_to(layer) adds the target (layer for text presets, layers for the others).
  • Preset rows are now click_and_drag and start that drag. The existing drag ghost shows the preset's name.
  • The Timeline (name column and time graph), Composition viewer (layer under the pointer, outlined) and Effect Controls apply a dropped preset to that layer, the same way they already handle effects.
  • Double-click still applies to the selected layers, now through the same PresetRef::command().

Testing

  • New unit test: preset_drops_target_the_layer_with_each_commands_param.
  • Headless snapshot runs with ui.drag on the demo project:
    • Typewriter onto a Timeline layer row: applied ("Undo Apply Text Preset Typewriter").
    • Typewriter onto a layer's time bar: applied.
    • Fade In (Transitions) onto a Timeline layer: applied.
    • Fade In onto a layer in the Composition viewer: applied.
    • Blur In onto Effect Controls: applied.
  • cargo fmt --check and cargo clippy -p effectcraft-ui-egui --all-targets -D warnings are clean, and the ui-egui tests pass. I did not run the full cargo xtask ci.

🤖 Generated with Claude Code

Preset rows (text, built-in and user .ecpreset) were click-only, so dragging
one onto a layer did nothing. They now start a DragPayload::Preset drag with
a ghost, and the Timeline, Composition viewer and Effect Controls apply the
preset to the layer it is dropped on, as they already do for effects and as
After Effects does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@echelon

echelon commented Oct 18, 2026

Copy link
Copy Markdown
Member

Thank you for this contribution! It's been reviewed and landed on main as part of today's community batch (merged together with other PRs, built and tested as a whole).

If you haven't already, please come join us on Discord: https://discord.gg/artcraft. It's the best place to coordinate on what's next, and we'd love to have you there.

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.

3 participants