Repository navigation
Burn the current title in as the hook on re-render - #183
Conversation
With --hook and --copy the AI title is the hook in the first seconds of the clip, but a re-render reused the hook it was first rendered with, so a rewritten title never reached the video. rerender_clip now uses the clip's title when it has one (clip_hook) and saves it as the hook. The review page says when a clip's hook is out of date and offers a re-render over its current range.
A21-devs
left a comment
There was a problem hiding this comment.
Checked:
clip_hookfollows the same rule asrun(): the title when there is one, else the stored hook. A run without--hookpassesNoneregardless of the title (the test covers it). The cover gets the same hook, so #173's cover title updates too.- A same-range re-render keeps
editedas it was (movedis false), so the score note doesn't flip just because the hook was refreshed. - Moving the old Re-render body into
renderWithchanged nothing for the main button: it still validates the length and builds the body witheditBodyfirst, and the error path restores the label of whichever button was pressed.
One real problem with the new button, inline.
| @@ -418,6 +425,16 @@ <h1>clipwright</h1> | |||
| } | |||
There was a problem hiding this comment.
This always sends the saved range, {start: clip.start, end: clip.end}, but the card can have unsaved nudges or a layout change waiting in pending (the times line says "edited"). Press -1s on start, then this Re-render: the clip is rendered over the old range, renderWith does pending.delete(key), the cards are rebuilt, and the trim is gone without a word. Both buttons say "Re-render", so a user would expect this one to render what the card shows. It should send editBody(clip, start, end, layout, saved) ?? { start: clip.start, end: clip.end } (with the same 1 s length check), so pending edits go along and an untouched card still re-renders as it is.
There was a problem hiding this comment.
Correction: this comment landed on the wrong line. It is about line 434, const again = button("Re-render", () => renderWith({ start: clip.start, end: clip.end }, again));, in showHookNote.
|
Fixed in 35cf6a2. The note's Re-render now sends Verified with the same headless Edge run as in the description (stub backend that counts titles,
On the previous commit the same steps would have rendered 107-127 and dropped the trim. The page check in |
A21-devs
left a comment
There was a problem hiding this comment.
Second pass over 35cf6a2. Fixed: the note's button builds its body from the card's start/end/layout like the main Re-render, and falls back to the saved range only when nothing is pending. start, end and layout are the same let variables the nudge buttons change, so it reads them at click time, not when the note was drawn. A layout-only change goes as {layout}, which the server's relayout path renders over the clip's range with clip_hook too. The real run in the reply shows the trim kept (106-127, 21.0 s) and the new title burned in. Clean.
The note's Re-render always sent the saved range, so a trim or layout change waiting on the card was rendered over and then dropped.
Closes #114.
What
With
--hookand--copy, the AI title is also the hook text burned into the first 3 seconds of the clip (and drawn on the cover since #173). Rewrite title only updated the manifest and the .txt, andrerender_clipreusedentry["hook"], so the video kept showing the old title even after a re-render.pipeline.clip_hook(entry): the clip'scopy.titlewhen it has one, otherwise the hook it was rendered with. That's the same rulerun()uses (title if there is one, elsehook_textfrom the transcript). It's used for the .ass and the cover when the run hasrender.hookon, and saved back as the clip'shook. Clips without a title keep their transcript hook. A run without--hookstill has no hook.render.hookand a clip'shookdiffers from its title, the card shows "the hook in the video is out of date" with a Re-render button that renders the clip's current range (layout and trim unchanged). It's checked when the card is built and again after Write title, so a rewrite shows it right away. The Re-render code is shared with the existing Re-render button (renderWith), so busy state, releasing the video and errors work the same.rerender_cliptoo, so it picks up the current title the same way.Testing
uv run ruff check src tests,uv run mypy,uv run pytest -q tests/test_rerender.py tests/test_write_title.py: 52 passed.build_assand to the cover and saves it ashook. A clip without a title keeps its transcript hook. A run without--hookgets no hook even with a title.clip_hookcovers a title, no copy andcopy: null. A check on index.html that the note is only forrender.hookruns whenclip.hook !== clip.copy.title, re-renders{start, end}of the clip as it is, and is refreshed after Write title.clipwright servewith a local stub backend that answers "Title number N" with a counter, job on a 240 s synthetic video (TTS speech over Roblox gameplay) withhook: true, copy: "openai", 2 clips. Driven in headless Edge over the DevTools protocol:hook=copy.title= "Title number 3", clip 2 unchangedtalk_clip01.mp4: "Title number 1" before, "Title number 3" after