Skip to content

fix(cli): preserve authored clip length when moving - #5315

Open
rudycelekli wants to merge 1 commit into
heygen-com:mainfrom
rudycelekli:fix/timeline-move-authored-duration
Open

rudycelekli wants to merge 1 commit into
heygen-com:mainfrom
rudycelekli:fix/timeline-move-authored-duration

Conversation

@rudycelekli

Copy link
Copy Markdown

What

Preserve an end-authored clip's resolved length when moving it with the timeline CLI.

Why

The timeline reader supports older clips with data-start and data-end. The move command checked bounds and overlaps using the original length but only changed the start attribute. A two-second clip at 1–3 seconds moved to 2 seconds became one second long; moving a two-second clip at 4–6 seconds to 1 second made it five seconds long. The same incorrect result appeared in --plan.

Related work

This is a small correction to the existing timeline move command introduced in #4221. Open #5279 concerns atomic batch undo receipts; its implementation is independent, although both PRs append CLI regressions to the same test file.

How

For a clip with an authored duration, write its already resolved duration and remove the derived/legacy end attribute alongside the new start. This follows the existing canonical timing writer's contract. Clips whose duration comes from natural media length or an image default retain their unauthored duration.

Test plan

  • Eight public CLI regressions added: forward/backward end-authored moves and duration-authored/default-image controls, each in applied and planned modes. Four assertions fail before the fix; all 49 timeline cases pass afterward. Applied results are reinspected from persisted source, and planned source bytes remain unchanged.
  • Built package CLI under Node 22.19.0: four independent forward/backward applied/planned cases reproduce the original duration change and preserve two seconds afterward.
  • Frozen Bun 1.4.2 install, full workspace build, CLI rebuild/typecheck, formatting/lint, test reachability, comment checks, and normal signed commit hooks pass. No comments were added.
  • Documentation: the existing canonical timing contract remains applicable.

The full CLI suite reports 4594 passed, 6 failed, 49 skipped out of 4649 collected tests. An unchanged-production comparison with the same tests and environment reports 4590 passed, 10 failed, 49 skipped, including the four timing regressions. Five exact failures match between runs: the history held-lock test, the atomic file watcher test, and three Sherpa installation tests. The sixth failure is in the unchanged real-filesystem watcher module: the new-directory case fails after the fix, while the manifest-write case fails in the comparison. That module has no dependency on the changed timeline helper. The full CLI suite is not reported as passing.

Validation covers CLI timing and persistence on macOS. Hosted upstream CI and maintainer review remain outstanding.

Signed-off-by: Rudy Celekli <rudy@gradiahq.com>

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