feat(studio): select rightward takes crossing clips, and a host can keep only Select and Split - #4755
Merged
Merged
Conversation
miguel-heygen
marked this pull request as ready for review
September 30, 2026 07:45
somanshreddy
approved these changes
Sep 30, 2026
Merged
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.
What
Two changes to the timeline's select-around-the-playhead tools.
1. Select rightward now includes clips crossing the playhead. This changes OSS Studio's default behaviour. Select rightward (and
]) takes every clip still running at the playhead or later: a clip is picked when it ends after the playhead. Before, it picked only clips that start at or after the playhead, so a clip already playing under the playhead was skipped, and in the middle of a film it often selected nothing. Select leftward (and[) is unchanged: it already took every clip that started before the playhead, crossing clips included. A clip starting exactly at the playhead still goes to rightward and not leftward. The]hint in the shortcuts panel now reads "Select clips running at or after the playhead".2. A host can hide the two rows.
TimelineToolbargetsshowSelectAroundPlayhead?: boolean(defaulttrue). Withfalse, the timeline tool menu lists only Select and Split; Select leftward and Select rightward are not shown. The[and]shortcuts keep working either way. Studio's own app passes nothing, so it is unchanged.Why
"Select rightward" reads as "everything from here on". Skipping the clip under the playhead made it look broken mid-film, and it did not mirror leftward, which already included that clip.
A host app that embeds Studio wants a shorter tool menu with just the two tools, while keeping the keyboard shortcuts for people who know them. Today it cannot hide those rows without CSS reaching into Studio internals.
Related work
Same host-prop pattern as
showHistory(#4739) andshowKeyframes(#4680). The menu rows came in with #4714.How
selectAroundPlayheadinplayerStore.tsnow passes the whole clip to its predicate. Leftward keepsstart < playhead; rightward isstart + duration > playhead. The menu rows and the[/]keys both call these store actions, so both pick up the change.TimelineToolbarthreads the prop toTimelineToolPicker, which appends the two rows only when it istrue.selectAroundPlayheadinplayerStore.ts.appHotkeysDispatch.tsand call the store directly, not the menu, so hiding the rows leaves the keys alone.Test plan
useAppHotkeys.test.ts, "select leftward / rightward": the fixture now has a clip crossing the playhead, one entirely before it, one starting exactly at it, and one entirely after.[selects the crossing clip and the clip entirely before it. It does not select the clip starting exactly at the playhead or the one after it. This already passed before the change, because leftward already included crossing clips.]selects the crossing clip, the clip starting exactly at the playhead and the clip entirely after it. It does not select the clip entirely before. Run againstmain's store, this test fails:expected [ 'at', 'late' ] to deeply equal [ 'at', 'early', 'late' ].TimelineToolbar.test.tsx, "TimelineToolbar tool menu":showSelectAroundPlayhead: falseit lists Select and Split. Run againstmain's picker, this test fails:expected [ 'Select', 'Split', …(2) ] to deeply equal [ 'Select', 'Split' ].[and]at the playhead select the same clips. With the[/]branch taken out ofappHotkeysDispatch.ts, both cases fail:expected [] to deeply equal [ 'c0' ].Also run, one file per command:
playerStore.test.ts,ShortcutsPanel.test.tsx,TimelineHistoryButtons.dom.test.tsx,timelineChromeExports.test.tsx,pointerTargetSize.test.tsx,useAppHotkeys.test.ts,ui/Menu.test.tsx. Plus Studiotsc --noEmit,oxfmt --checkandoxlinton the changed files.In a browser, using Studio's dev app with a three-clip test composition (Title 0-4 s, Card 2-6 s, Outro 5-9 s):
main, Select rightward selected only Outro. On this branch, it selected Title, Card and Outro (Title and Card cross the playhead).[selected Title and Card on both.false: the menu showed only Select and Split,]selected Card and Outro, and[selected Title.Before
Studio on
main, three-clip test composition, 1440x900, headless Chrome.Select rightward with the playhead at 3 s selects only Outro. Title and Card are still playing under the playhead and are skipped.
The tool menu lists Select, Split, Select leftward and Select rightward.
After
This branch, same composition. Select rightward with the playhead at 3 s selects Title, Card and Outro.
This branch, with the toolbar given
showSelectAroundPlayhead={false}the way a host would pass it (for the capture only; Studio's own app passes nothing and still shows four rows). The menu lists Select and Split.