Skip to content

feat(timeline): the playhead can follow a trimmed edge, so the monitor shows the frame the cut lands on - #194

Merged
jub0t merged 2 commits into
jub0t:mainfrom
raphaelbgr:feat/trim-follow
Sep 25, 2026
Merged

jub0t merged 2 commits into
jub0t:mainfrom
raphaelbgr:feat/trim-follow

Conversation

@raphaelbgr

@raphaelbgr raphaelbgr commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

What

A new toggle in the timeline tray, right after the hand (pan) tool: Player follows the resize.

With it on, dragging a clip's edge moves the playhead along with the edge, so the monitor shows the exact frame the cut will land on while you are still dragging. Instagram Edits and CapCut work the same way, and it makes trimming to a precise frame much faster than trim, scrub, trim again.

The new toggle (lit, circled) right after the hand tool

Behaviour

  • Head (left edge): the playhead sits on the clip's new first frame.
  • Tail (right edge): the playhead sits on the new last frame, one frame inside the edge. At the edge itself the clip has already ended, and the monitor would show whatever comes after it.
  • Magnetic timeline on: a head trim slides the clip back into the gap on release, and the playhead moves with it, so it stays on the clip's first frame.
  • Snapping works the same as before, since the playhead follows the snapped edge.
  • Off by default. It is remembered in the preferences file as trimFollow, the same way magnetic is.

The monitor already draws from the echo during a gesture, so no rendering changes were needed. The change is a seek in the Gesture::Trim branch of clip_dragged, plus one more in clip_released for the magnetic case.

Changes

  • prefs.rs: trim_follow: bool (serde default, so older settings files load unchanged)
  • studio.rs: the seeks described above, and set_trim_follow pushed to the window next to set_magnetic
  • panes/timeline.rs, lib.rs: TrimFollowChanged message and callback, wired like the magnetic toggle
  • editor.slint, seat.slint, timeline-pane.slint, tray.slint: property and callback plumbing, and the tray button
  • icons.slint: a new trim-follow glyph (a playhead with an arrow on each side)
  • Locales: the tooltip string added with scripts/locales.py. Translated into all 13 shipped languages, reusing each file's existing word for trimming (the one its Magnetic timeline tooltip already uses).

Checks

Run on Windows 11 x86_64 (MSVC, FFmpeg 8.1):

cargo fmt --check clean
cargo clippy --all-targets -- -D warnings clean
cargo test -p concat 44 passed, 0 failed
python scripts/locales.py --check 13 locales, 0 missing, 0 stale

Also built and launched on top of the 0.2.3 release.

…r shows the frame the cut lands on

A tray toggle beside the hand tool. With it on, dragging a clip's head puts the playhead on the new first frame, and dragging its tail puts it one frame inside the new end. A magnetic head trim takes the playhead with the clip when it slides back on release. Off by default, remembered as trimFollow.

Signed-off-by: Raphael Bernardo <6786682+raphaelbgr@users.noreply.github.com>
Signed-off-by: Raphael Bernardo <6786682+raphaelbgr@users.noreply.github.com>
@jub0t jub0t added the feature request Requesting a functionality or feature. label Sep 25, 2026
@jub0t
jub0t merged commit 5c30d5b into jub0t:main Sep 25, 2026
1 check passed
@jub0t

jub0t commented Sep 25, 2026

Copy link
Copy Markdown
Owner

Awesome work. Your contributions are appreciated.

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

Labels

feature request Requesting a functionality or feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants