Repository navigation
feat(ui): shorts in clip ui, and export every short - #86
Merged
Merged
Conversation
… all shorts Every /api/timeline route reads ?timeline= (default main): a malformed id answers 400 and a short that doesn't exist 404. GET /api/timelines lists them, DELETE /api/timelines/:id removes a short (main is refused), and POST /api/timelines/export renders every short through exportTimelines, which `clip timeline export --all <dir>` shares. The verbs route now returns make_short's warnings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ll shorts Tabs above the timeline list main and every short with its shape; the open one lives in the page URL and every fetch names it. A short's tab deletes it after a confirm, and a short deleted elsewhere falls back to main. Selecting words in a clip's transcript offers Make short (a name and the left-right position), which opens the new short and shows make_short's warnings. Export all shorts renders every one and lists each with its loudness. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Also logs the clip inspector getting no height on a short window as a backlog note; it predates the tabs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o its timeline The export-all route now resolves each short's files through confinedMediaMap, so a registered file swapped for a link out of the workspace is refused instead of rendered. useTimeline remembers which timeline answered 404, so switching to another short right after a fallback doesn't bounce back to main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🎉 This PR is included in version 0.5.2 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Slice 4 of 4 toward v0.5.2 (long recording → vertical shorts). Targets the integration branch
feat/shorts; merging it releases nothing. Layout B from the mock: tabs above the timeline.Docs: README before · after (one command line and one paragraph at the end of the section); SKILL.md before · after (the "To cut vertical shorts" paragraph);
llms.txt(the shorts bullet).What
Server (
src/ui/server.ts)/api/timeline*route reads?timeline=(defaultmain).app.onError. The per-route catch blocks passNoTimelineErrorandTimelineIdErroron to it instead of turning them into 500 or 503.GET /api/timelineslists main and every short with its size, length and rev.DELETE /api/timelines/:idremoves a short and its undo history. Main gives 400, a missing short 404.POST /api/timelines/exportrenders every short intoshorts-<hex>/<id>.mp4in the workspace. Each one is logged to the session, so it shows in Outputs. A short that can't render is reported with its error, and the rest still render. With no shorts it answers 422.warnings(make_short's mid-sentence and no-pause edges).timelinein its op args.Core and CLI
exportTimelines(ids, dir)insrc/timeline/run-plan.ts(exported from the package):<dir>/<id>.mp4;clip timeline export --all <dir>renders every short except main.{ exported: [...] }and exits 1 if any short failed.--timelineand project formats, which export one timeline.Web app (
src/ui/web/src/)TimelineTabs: a tab per timeline with its shape (16:9,9:16…), shown once a short exists.confirm.The open timeline is kept in the page URL (
?timeline=best-1), so a reload keeps it. Every fetch passes it:useTimelineonly returns a document that belongs to the open timeline, and the viewer remounts per timeline, so a switch never shows or renders the last timeline's clips.If the open short is deleted elsewhere (the agent, the CLI), the 404 sends the page back to main.
Make short in the transcript panel appears once words are selected. It has:
short-Nand checked against the id rule;x).It runs
make_shorton the new timeline with the open one as its source, opens the short and shows its warnings under the tabs. Errors such as "already holds a short" show in the inspector.Slideris now exported fromFramingSectionfor reuse.Why
The finish line includes the UI: picking a moment from the transcript, seeing the 9:16 short with its captions, and exporting every short, without the CLI.
How to test
Checks
pnpm lint: no errors. The 7 warnings are intests/speed.test.tsandtests/transition.test.ts, which this PR doesn't touch.pnpm type-check: clean.pnpm test: 965 passed, 34 skipped.pnpm build: OK.New unit tests:
tests/ui-timelines.test.ts(8):?timeline=reads, edits, undoes and reports history per timeline; 400 and 404 on every route; list, delete and export-all through the real server, with no FFmpeg; export-all refuses a short whose media was swapped for a link out of the workspace.tests/timeline-export-all.test.ts(4):exportTimelinesreports a failure and goes on;--allusage and refusals; exit code 1.New integration test,
tests/integration/timeline-export-all.test.ts: two shorts (9:16 and 1:1) render at their own sizes, ~2 s each, and between -15 and -13 LUFS. An empty short is reported and sets exit code 1.CI=truerun of the export-all, shorts, caption safe zone and frame window integration tests: 5 passed.Browser check (Vite dev against a scratch API server, synthetic 83 s recording, whisper base.en):
best-1from 10 selected words opened its tab (?timeline=best-1). The viewer showed a 720×1280 frame with the caption above the bottom quarter.short-1worked too.best-1.mp4at 1 s, the caption box ends at y≈960 of 1280.short-1emptied it, with redo enabled. Main stayed at rev 2 throughout.short-1asked first and fell back to main.?timeline=best-1.best-1from the CLI sent the page back to main on the next poll.Codex review (
codex exec, high effort, inline diff), 2 findings, both fixed in 4bb87a6:confinedMediaMap, so that short is reported with the boundary error and the rest still render. The new test fails without the fix.useTimeline'smissingleaked across switches. Opening another short right after a fallback to main could bounce back to main. It's now tied to the timeline that answered 404. There's no automated test, because the web app has no React test setup.Notes
docs/backlog/confine-render-media.md. The older single-timeline mp4 export, the frame preview and the MCP mp4 export also take the registry's paths unchecked, as they did before this PR. This PR confines only the new route.docs/backlog/ui-inspector-height.md. On a 1000 px tall window the clip inspector gets 0 px, because the viewer fills.main. That was so before this PR; the tabs bar takes about 30 px more once a short exists.