Elements: Split timed captions element - #10060
Merged
Merged
Conversation
Contributor
Contributor
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — a clean split of the TimedCaptions element into three standalone Elements, each with its own component, schema, metadata, and docs page.
- Removed the combined
text/timed-captionsElement — oldindex.mdxdeleted, old entry dropped fromelement-definitions.tsandelements-sidebars.ts. - Added
TimedCaptionsBackground— stripped themodeprop and removed the highlight-color and scale-animation branches; kept the pill-background layout andinterpolate/springanimation for the sliding pill. - Added
TimedCaptionsHighlight— standalone variant with word-level color highlight only (no scale animation, no pill background). - Added
TimedCaptionsScale— standalone variant with word-level color change +spring/interpolatescale animation (getTokenScale), plusfps-awarefontSizethat accounts foractiveWordScale. - Updated element definitions — three new entries with correct preview URLs, dependency lists, display names, and slugs.
- Updated tests — converted the single-element OG video metadata test into a full loop over all definitions; added a timed-caption-specific test that asserts exactly three slugs exist, verifies each has a production filesystem entry, and confirms no stale
mode/TimedCaptionsMode/hardcoded translate markers remain.
All 123 element tests pass.
DeepSeek Pro (free via Pullfrog for OSS) (Claude Opus not used — the program covers this model; add its provider key to run your pick) | 𝕏
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Fixes #9826
This PR splits the existing timed captions Element into three standalone Elements:
text/timed-captions-highlighttext/timed-captions-scaletext/timed-captions-backgroundEach caption style now has its own public component, Element metadata entry, documentation page, and installable source file instead of being selected through a shared
modeprop.Changes
timed-captionsElement API.style.translatepositioning from the default example.Tradeoffs
The three Elements intentionally keep their implementation self-contained instead of sharing local helper files. This adds some duplication, but keeps each Element independently installable from the Elements library without requiring extra local source dependencies.
Testing
git diff --cached --checkelement-definitions.tsmodeAPI markerstranslate: '109.5px -36px'