Skip to content

fix(cli): timeline delete --start/--end removes only that range - #5867

Merged
miguel-heygen merged 2 commits into
mainfrom
fix/cli-timeline-delete-range
Oct 19, 2026
Merged

miguel-heygen merged 2 commits into
mainfrom
fix/cli-timeline-delete-range

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What a user sees

Before: hyperframes timeline delete <clip> --start 2 --end 3 accepted both flags, never read them, and removed the whole clip. --plan showed an empty after-list. Every edit verb shared one flag set, so split --start, delete --at, duplicate --overwrite and the like were accepted and silently ignored. An apply plan edit like {"verb": "delete", "ref": "#clip", "at": "2"} was the same.

After:

  • timeline delete <clip> --start a --end b removes only [a, b). The part before a and the part after b stay, exactly as split, split, delete would leave them (it reuses split, so a video's tail keeps its media in-point and a sub-composition keeps its place). With one bound it cuts to the clip's edge; with neither it removes the clip as before. A range that reaches outside the clip, or is empty, is refused.
  • Each verb accepts only the options it reads. A flag a verb does not use fails with Unknown flag: --x before anything is written, and an apply edit with a key its verb does not use is refused (delete does not use at). One table (MUTATION_FIELDS) is the single source for both the CLI flags and the plan keys.
verb options
move <time>, --overwrite, --snap
trim --start, --end, --duration, --overwrite, --snap
split <time>, --snap
delete --start, --end, --snap
set <field>=<value>, --volume, --rate, --track
duplicate --at, --snap

All also take --dir, --plan, --json.

Tests

packages/cli/src/timeline/timeline.e2e.test.ts: range delete on a video clip (plan and apply), out-of-clip range refusal, five verb/flag pairs refused without writing, and an apply key refusal. The range-delete and unused-flag tests fail on main (range delete returns an empty after-list there) and pass here. Timeline and flag-guard suites: 147 passed, 3 runs in a row.

timeline delete accepted --start and --end but never read them, so a range
delete removed the whole clip. It now cuts out only that range, the same way
split, split, delete would, and keeps the parts before and after.

Every edit verb shared one flag set, so a verb silently ignored flags it does
not use. Each verb now declares only the options it reads, from one table that
also checks apply-plan keys, so an unused flag or key is refused before
anything is written.
@mintlify

mintlify Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
hyperframes 🟢 Ready View Preview Oct 19, 2026, 1:10 AM

💡 Tip: Enable Automations to automatically generate PRs for you.

@somanshreddy somanshreddy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving at 9bbfc128, the delta from my reviewed head 4daac817. It's one commit that renames MUTATION_FIELDS to FIELDS_READ_BY_VERB at every site that uses it (commands/timeline.ts, a2Commands.ts, a2Shared.ts) and drops two comments. There's no behaviour change. My review at 4daac817 stands, including the should-fix: the docs still show delete --start/--end without a "Since 0.8.174" note, while released CLIs up to 0.8.173 remove the whole clip.

— Somu

@miguel-heygen
miguel-heygen added this pull request to the merge queue Oct 19, 2026
Merged via the queue into main with commit d2b8ea7 Oct 19, 2026
66 checks passed
@miguel-heygen
miguel-heygen deleted the fix/cli-timeline-delete-range branch October 19, 2026 01:39
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.

2 participants