Skip to content

VideoPress caption manager: preview the cue being edited#50428

Open
obenland wants to merge 1 commit into
trunkfrom
worktree-videopress-subtitle-live-preview
Open

VideoPress caption manager: preview the cue being edited#50428
obenland wants to merge 1 commit into
trunkfrom
worktree-videopress-subtitle-live-preview

Conversation

@obenland

@obenland obenland commented Jul 10, 2026

Copy link
Copy Markdown
Member

Fixes #

Proposed changes

  • Fix the VideoPress caption manager so the subtitle preview shows the cue you're currently editing. Previously the overlay was purely time-gated — it only rendered a cue when the playhead fell inside that cue's [start, end) window. A cue created at the playhead spans just two seconds, so while the video played the playhead left that window before you could type, and the new cue never previewed (it appeared only when the video was stopped inside the range).
  • While a cue field holds focus, the preview overlays that cue's live text (updating as you type) in place of the playhead cue, regardless of playback position or play/pause state. This works whether the video is playing or paused, including with "Pause while typing" enabled.
  • When focus leaves the cue editor (clicking away / playing for review), the overlay reverts to the normal time-synced captions, so playback review is unchanged.
  • Added unit coverage on CaptionPreviewPlayer for the edited-cue override, the empty-cue case, live text updates, and the fallback to time-synced captions, plus a full-modal integration test that types a cue, moves the playhead past its window, asserts the overlay stays, then blurs and asserts it reverts.

Related product discussion/links

Does this pull request change what data or activity we track or use?

No.

Testing instructions

  • Edit a VideoPress video's subtitles: open the block editor, select a VideoPress block, and open the subtitle/caption manager (Add track, or edit an existing track).
  • With the preview video playing, add a subtitle cue (the C shortcut or the add-subtitle button) and start typing its text.
  • Confirm the text you type now appears overlaid on the preview video immediately, instead of only showing when the video is stopped/seeked into the cue's time range.
  • Confirm it also works with the Pause while typing checkbox enabled: typing pauses the preview and your cue text stays overlaid.
  • Click/tab out of the cue (or play the video for review) and confirm the overlay returns to showing captions in sync with the playhead.

https://claude.ai/code/session_01A7Ft9CRq2JHuEJoUFU3MMm

The preview overlay was purely time-gated, showing a cue only when the
playhead fell inside its [start, end) window. A cue created at the
playhead spans just two seconds, so while the video played the playhead
left that window before the author could type, and the new cue never
previewed (it only appeared once the video was stopped inside the range).

Overlay the focused cue's live text in place of the playhead cue while a
cue field holds focus, reverting to time-synced captions once focus
leaves the editor. This shows the cue you are editing whether the video
is playing or paused, including with "Pause while typing" enabled.

Claude-Session: https://claude.ai/code/session_01A7Ft9CRq2JHuEJoUFU3MMm
@obenland obenland added the [Status] Needs Review This PR is ready for review. label Jul 10, 2026
@obenland obenland requested a review from a team as a code owner July 10, 2026 23:26
Copilot AI review requested due to automatic review settings July 10, 2026 23:26
@obenland obenland self-assigned this Jul 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack), and enable the worktree-videopress-subtitle-live-preview branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack worktree-videopress-subtitle-live-preview

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!

@jp-launch-control

Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 2 files.

File Coverage Δ% Δ Uncovered
projects/packages/videopress/src/client/components/caption-manager-modal/manual-editor.tsx 128/137 (93.43%) 0.63% 0 💚
projects/packages/videopress/src/client/components/caption-manager-modal/caption-preview-player.tsx 112/136 (82.35%) 3.09% -4 💚

Full summary · PHP report · JS report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants