Skip to content

Fix Remotion Studio bundling; add caption translation and RTL support#1

Merged
neutral-Stage merged 4 commits into
mainfrom
cursor/solidify-remotion-rtl-translate-ebbd
Apr 23, 2026
Merged

Fix Remotion Studio bundling; add caption translation and RTL support#1
neutral-Stage merged 4 commits into
mainfrom
cursor/solidify-remotion-rtl-translate-ebbd

Conversation

@neutral-Stage
Copy link
Copy Markdown
Owner

@neutral-Stage neutral-Stage commented Apr 23, 2026

Summary

  • Fixes npm start / Remotion Studio: remotion.config.ts + src/remotion-entry.tsx.
  • OpenAI caption translation: translateCaptionData(), captioneer translate, optional textDirection on AnimatedCaptions.
  • Hardening (bot review): assertValidTargetLanguageTag() (strict safe BCP-47 subset for prompts), assertCaptionDataShape() for parsed JSON, 120s default fetch timeout (timeoutMs option), 25-segment batching per API call, CLI JSON parse + validation + error handling.
  • CI: Pages deploy only on push to main.

Testing

  • npm run build
  • npx tsc --noEmit
  • npx remotion compositions
  • npx captioneer --help

Notes

  • Translation requires OPENAI_API_KEY (or --api-key).
  • Target language must match ^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$ (e.g. es, fr-CA, zh-Hans).
Open in Web Open in Cursor 

- Add remotion.config.ts with webpack extensionAlias so .js imports resolve to TS sources
- Register Remotion root via src/remotion-entry.tsx
- Export translateCaptionData and captioneer translate CLI (OpenAI, preserves timings)
- AnimatedCaptions supports textDirection for RTL; mark roadmap item done
- package type module removes Node ESM warning; CLI version reads from package.json
- Bump scaffold remotion-captioneer dependency to ^0.9.0

Co-authored-by: Shuvo Anirban Roy <anirbanroy691@gmail.com>
@neutral-Stage neutral-Stage marked this pull request as ready for review April 23, 2026 15:14
Comment thread src/translate.ts Outdated
Comment thread src/translate.ts Outdated
Comment thread src/translate.ts Outdated
Comment thread src/cli.ts Outdated
@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented Apr 23, 2026

Code Review Roast 🔥

Verdict: No Issues Found | Recommendation: Merge

Oh wait, this PR is actually clean. I need to sit down. I had my flamethrower warmed up and everything.

All 5 previously flagged issues have been fixed:

Previous Issue Fix
⚠️ Prompt injection via targetLanguage assertValidTargetLanguageTag() with strict regex validation
💡 fetch() with no timeout fetchOpenAIChat() with AbortController + 120s default
💡 No chunking for large files ✅ Batching with SEGMENT_BATCH_SIZE = 25
💡 Zero JSON validation in CLI assertCaptionDataShape() validates full structure
💡 Missing try-catch in translate CLI ✅ Full try/catch with typed error handling

🏆 Best part: You didn't just paper over the issues — you actually extracted assertValidTargetLanguageTag and assertCaptionDataShape as exported utility functions so library consumers get the same protection. That's the kind of defensive API design that makes me think someone's been burned before. The timeoutMs option with a sensible default, the batch-size constant, and the AbortController pattern in fetchOpenAIChat are all textbook. I'm almost suspicious — who are you and what have you done with the developer who wrote the first version?

📊 Overall: Like watching someone clean up after a party — the place was a disaster, but now it's spotless. All previous findings addressed with quality fixes. Ship it.

Files Reviewed (8 files)
  • src/translate.ts - was 3 issues, now clean ✅
  • src/cli.ts - was 2 issues, now clean ✅
  • src/index.ts - clean ✅
  • src/components/AnimatedCaptions.tsx - clean
  • src/types.ts - clean
  • src/remotion-entry.tsx - clean
  • remotion.config.ts - clean
  • .github/workflows/ci.yml - clean

Reviewed by glm-5 · 465,767 tokens

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 5c341a6. Configure here.

Comment thread src/cli.ts
cursoragent and others added 3 commits April 23, 2026 15:18
PR merge refs are blocked by Pages environment rules; skip deploy job for pull_request.

Co-authored-by: Shuvo Anirban Roy <anirbanroy691@gmail.com>
- assertValidTargetLanguageTag: strict alphanumeric BCP-47 subset for prompts
- assertCaptionDataShape + export for library/CLI consumers
- OpenAI fetch via AbortController (default 120s, optional timeoutMs)
- Batch segments (25) per request to reduce truncation risk
- CLI: JSON parse + shape validation + translate try/catch with clear errors

Co-authored-by: Shuvo Anirban Roy <anirbanroy691@gmail.com>
Use ❌ Error: prefix for all failures (JSON, shape, OpenAI, write).

Co-authored-by: Shuvo Anirban Roy <anirbanroy691@gmail.com>
@neutral-Stage neutral-Stage merged commit a72ce48 into main Apr 23, 2026
8 checks passed
@neutral-Stage neutral-Stage deleted the cursor/solidify-remotion-rtl-translate-ebbd branch April 23, 2026 15:31
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