Repository navigation
@remotion/studio: Follow active caption in inspector - #11965
Conversation
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Selecting a captioned sequence now scrolls the matching caption row into view in the inspector, based on the sequence-local playhead frame rather than the composition frame.
TSequence.getCurrentFrame— new optional getter for the committed sequence-local clock, registered bySequencefrom a ref synced in auseLayoutEffect.InlineCaptionInspector.onCaptionsRendered— notifies the parent after draft caption rows commit while the section is expanded, so the reveal can wait for runtime captions that arrive after mount.InspectorSequenceSectionreveal logic — resolves the active caption from the sequence frame (getter first, then the existing timeline formula withsequenceFrameOffset), expands the Captions section, and consumes the scroll once per selection so seeking, playback, and caption edits keep the user's scroll position.SequenceSelectionInspector— threadstrack.sequenceFrameOffsetinto the section.
The reveal guards, effect ordering, and reference-equality consumption all check out against the surrounding code: selectedItems is a stable snapshot, the caption inputs render independently of the transforms group's collapsed state, and the handledCaptionSelection/pendingCaptionScroll refs make the reveal idempotent and self-clearing.
ℹ️ Scope of the new core surface
The behavior is Studio-only, but the support for it lives in packages/core: getCurrentFrame is added to the exported TSequence (via Internals) and Sequence runs a useLayoutEffect on every render in every environment, including headless rendering. This is mergeable as-is — just flagging the core/render-time surface expansion in case you'd prefer the getter and its ref sync scoped to the Studio environment.
deepseek-v4.1-flash | 𝕏
@remotion/studio: Scroll active caption into view when selecting a sequence
@remotion/studio: Scroll active caption into view when selecting a sequence@remotion/studio: Follow active caption in inspector
|
Thanks! |

Selecting a caption sequence at a later frame leaves the active caption off screen in the inspector. Center that caption on selection, opening the Captions section if needed, then highlight and follow the active token while scrubbing or playing.
Following uses
nearestso visible captions stay in place and offscreen captions require only minimal scrolling. Manual inspector scrolling or caption editing pauses following until the next seek or sequence selection; the highlight continues to update. Use the committed sequence-local clock for nested playback rates, trim offsets, freezes, and loops, and wait for committed draft rows when captions arrive after the inspector mounts.Keep frame updates in a small component beside the memoized caption editor. Update the highlight and scroll position imperatively when the active caption changes or following resumes, without adding React state or frame subscriptions to the list.
Fixes #11897.
Validation:
bun run build: 81 tasks passed.bun run stylecheck.No test files were added or changed.