Skip to content

feat(content): a short video with its words on screen, and fixes from review - #666

Merged
5hirish merged 2 commits into
mainfrom
feat/captioned-short
Dec 2, 2026
Merged

5hirish merged 2 commits into
mainfrom
feat/captioned-short

Conversation

@5hirish

@5hirish 5hirish commented Dec 2, 2026 •

Copy link
Copy Markdown
Owner

What and why

Phase 3 of #657: a short video with its words on screen, saved as a new take.

flowchart LR
  A[Video post: hook + captions] --> B[shortRun.js maps them]
  B --> C[captioned-short template, a stage along time]
  C --> D[TimeStage: clip plays under the clear page]
  D --> E[Save with the words on it: MP4 recorded in the browser]
  E --> F[New take, becomes the cut]
Loading
Who What they see
A video post with words A "Text on screen" switch in the player: the hook at the top for its first seconds, then each caption low in the frame, all inside TikTok/Reels/Shorts margins
Saving The clip and its words recorded together as an MP4 the clip's length; it becomes the post's cut
A browser that can't record MP4 Told to use Chrome or the desktop app

Fixes from review of the stack

# Was Now PR it belongs to
1 A still with <template shadowrootmode> passed the still rules and loaded outside URLs in the app's document Refused before parsing; the browser still check tries three such stills (44/44 refused in both engines) #662
2 Against an older backend the agent's slide render failed Falls back to the old engine; sizes sent only when present #664
3 The agent's draft preview showed new carousels in the old engine The draft names its template #664
4 Instagram could get a 4:5 slide older than its 9:16 one Frames from one drawing share a render_id; only matching sets go #664
5 Collage previews missed pictures past the route's cap of 5 Asked a slide's worth at a time, missing ones asked again #664
6 An unreadable picture was saved and published as a placeholder The render fails and the agent is told #664
7 Changing the brand redrew existing posts Each post keeps its look (carousel_look, new column + migration) #665
8 Collage labels turned black on a light brand color Always white on their dark strip #665
9 A failed save leaked an audio context and threw twice Closed, one error this PR
10 Translators saw {0} {percent} this PR

Refs #657

Area

  • backend/ — FastAPI / Python
  • app/ — Next.js
  • desktop/ — Tauri shell / sidecar
  • site/ — static marketing site
  • CI / tooling / docs

Launch: changelog entry. Migration 7c41e2b9a5d3 adds a nullable JSON column; existing posts read NULL (the template's own look).

Verification

cd backend && poetry run ruff check server.py agents models routes service tests utils  # clean
poetry run pytest -q -m "not live" tests          # 3319 passed
cd app && npx vitest run                          # 62 files, 662 passed
npm run typecheck && npm run check:parity         # OK
npm run check:i18n                                # OK
npm run check:stills                              # chromium, webkit: 44/44 hostile refused, nothing left the page
make dump-prompts                                 # no prompt changed

Exports in WebKit and Chrome produced 1080×1920 H.264 + AAC MP4s with the words baked in. Not yet checked: fixes 5 and 8 in a rendered preview, and a real post on a phone.

  • I ran the checks for the areas I touched (see CONTRIBUTING.md)
  • I added or updated tests covering the behaviour that changed
  • I read the AGENTS.md for each directory I edited
  • I read my own diff back looking for the reason to reject it, and read it
    against the code around it (STYLE.md)
  • UI: ran the screen review checklist
    on the whole screen (not just the part I touched), and attached
    before and after shots at 390, 1100 and 1440

🤖 Generated with Claude Code

… review

The captioned-short template draws a video's words over its clip: the hook
at the top for its first seconds, then each caption low in the frame, all
inside the margins TikTok, Reels and Shorts draw over. Its stage runs along
time: the host plays the clip under the template's clear page and sends it
each moment (TimeStage). "Save with the words on it" records the clip and
the words together in the browser, as an MP4 of the clip's length, and
keeps it as a new take that becomes the post's cut.

Fixes from the review of this stack:
- A still holding a shadow root is refused before it is parsed: a walk of
  the document never enters one, so what it named loaded unchecked in the
  app's own document. The browser still check now tries three such stills.
- The agent's draft names its template, so its preview is the template's.
- A slide render against a backend older than templates falls back to the
  old engine, and sends other frames only when there are some.
- A slide's 4:5 render goes to Instagram only from the same drawing as its
  9:16 one; a slide redrawn at 9:16 alone sends the 9:16 set.
- The preview asks for pictures a slide's worth at a time, the route's cap,
  and asks again for any that did not come back.
- A render with a picture the server could not read fails, rather than
  saving and publishing the placeholder.
- A post keeps the brand look of the day it was made (carousel_look, new
  column), so "posts already made keep their look" is true.
- Collage labels stay white on their dark strip whatever the brand's ink.
- A failed video save closes its audio graph and raises one error, not two.
- "Recording… {percent}%" names its value for translators.

Refs #657

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added documentation Improvements or additions to documentation backend FastAPI service, models and migrations app Next.js app on Cloudflare Workers agents Agent instructions and skills labels Dec 2, 2026
The catalogues hold both new strings, the video player's "Position in the
video" and the search report's "Position", in the order extract writes
them. The backend's artifact bundle is rebuilt with the captioned short.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@5hirish
5hirish changed the base branch from feat/carousel-brand-versions to main December 2, 2026 23:22
@5hirish
5hirish marked this pull request as ready for review December 2, 2026 23:22
@5hirish 5hirish closed this Dec 2, 2026
@5hirish 5hirish reopened this Dec 2, 2026
@5hirish
5hirish merged commit f767069 into main Dec 2, 2026
28 of 31 checks passed
@5hirish
5hirish deleted the feat/captioned-short branch December 2, 2026 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent instructions and skills app Next.js app on Cloudflare Workers backend FastAPI service, models and migrations documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant