Extract shared captions utility
Objective
Create a single shared captions builder used by all caption-related overlays.
Why this matters
Caption-building logic is duplicated and can drift.
Centralization improves correctness and later editor reuse.
Parallelization metadata
Track
remotion
Depends on
Safe to run in parallel with
- pipeline issues
- shared typing issues
Merge risk
Files in scope
Primary:
Likely touch:
HookOverlay.tsx
CaptionOverlay.tsx
Required implementation
1. Extract shared builder
Move buildCaptions() into shared utility.
2. Extract token helpers
Move token classification helpers if duplicated.
3. Replace local implementations
Consumers should import from shared utility.
Constraints
- preserve rendering output
Handoff contract
All future caption logic should use remotion/lib/captions.ts.
Acceptance criteria
Functional
Regression checks
Verification commands
Search for local caption builders.
Expected result:
- only shared utility remains
Explicitly out of scope
- transcript validation
- overlay architecture cleanup
Suggested branch
refactor/s6-captions
Suggested commit slug
phase-5-step-2-captions
Extract shared captions utility
Objective
Create a single shared captions builder used by all caption-related overlays.
Why this matters
Caption-building logic is duplicated and can drift.
Centralization improves correctness and later editor reuse.
Parallelization metadata
Track
remotionDepends on
Safe to run in parallel with
Merge risk
Files in scope
Primary:
remotion/lib/captions.tsLikely touch:
HookOverlay.tsxCaptionOverlay.tsxRequired implementation
1. Extract shared builder
Move
buildCaptions()into shared utility.2. Extract token helpers
Move token classification helpers if duplicated.
3. Replace local implementations
Consumers should import from shared utility.
Constraints
Handoff contract
All future caption logic should use
remotion/lib/captions.ts.Acceptance criteria
Functional
Regression checks
Verification commands
Search for local caption builders.
Expected result:
Explicitly out of scope
Suggested branch
refactor/s6-captionsSuggested commit slug
phase-5-step-2-captions