Skip to content

fix(studio): undo that reloads the preview keeps the timeline clips on screen - #4790

Draft
miguel-heygen wants to merge 2 commits into
mainfrom
fix/studio-undo-keeps-timeline-clips
Draft

miguel-heygen wants to merge 2 commits into
mainfrom
fix/studio-undo-keeps-timeline-clips

Conversation

@miguel-heygen

@miguel-heygen miguel-heygen commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

What

Undo or redo of an edit inside a nested composition (and any other undo that reloads the preview) no longer blanks the timeline. Before, the timeline dropped to its empty "Drop media here" state and the player controls greyed out until the reloaded preview reported its clips.

Why

When an undo could not be applied in place, the undo path emptied the timeline store and marked it not ready before reloading the preview, and waited for the reload to fill it again. No other reload does that: a commit that reloads the preview keeps the clips on screen until the reloaded preview reports its own. The preview often reloads a nested composition in place now (a scene swap), so the store sat empty for the whole swap.

Repro: a root composition with a GSAP sub-composition. Move an element of the sub-composition, then undo. The timeline blanks, then comes back.

Related work

Found while verifying the undo stack (#4771 to #4783); main has it too.

How

  • The undo path keeps the timeline's clips and readiness when it reloads the preview, like every other reload. It still clears the selection, since the undone edit may have removed the selected element.
  • Deleted: the store clear and the readiness reset in the undo path.

Test plan

  • Unit test: an undo that reloads the preview leaves the store's clips and readiness as they were. It fails with the source reverted.
  • Manual testing performed: an undo walk on a generated fixture (root plus a GSAP sub-composition) sampled the timeline every frame after each key press. Moving a nested element, then undo, redo, undo: main drops to 0 clips on every step; this branch keeps all 6. The preview matched main on every element, with no half-state frame.
  • Documentation updated (if applicable)
  • Comments follow CONTRIBUTING.md "Comments"

Before

Right after undoing a nested move, the timeline shows the empty-project state.

Before: right after the undo the timeline is empty

before-undo.webm

After

The same undo: the timeline keeps its clips throughout.

After: right after the undo the timeline keeps its clips

after-undo.webm

@miguel-heygen
miguel-heygen force-pushed the fix/studio-undo-keeps-timeline-clips branch from 2a98129 to 0aa8b2b Compare September 30, 2026 23:43
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

Edit accuracy: 434 passing here, 434 on the base branch

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

This branch has not been deployed

No deployments
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.

1 participant