Skip to content

Extract shared captions utility #44

@natashaannn

Description

@natashaannn

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

  • none

Safe to run in parallel with

  • pipeline issues
  • shared typing issues

Merge risk

  • medium

Files in scope

Primary:

  • remotion/lib/captions.ts

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

  • overlays render captions exactly as before

Regression checks

  • no duplicate caption builders remain

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions