Repository navigation
feat(transport): contextual I/O hotkeys + stale-drag fix - #22
Merged
Merged
Conversation
I/O were master-trim-only regardless of selection. Now they route
contextually so the user can sculpt per-clip in/out without leaving
the keyboard:
- Loop active → loop boundaries (unchanged)
- Video selected → trimInS / trimOutS at playhead, clamped to
[0, sourceDurationS] by setVideoClipTrim
- Image selected → master-pill edges (mirrors the move-mode
drag handles' image-resize semantics)
- Else → master trim (unchanged)
Routing logic + source-time/anchor math live in a new pure module
io-points.ts with 18 unit tests; TransportBar imports the helpers.
aria-labels and shortcut hints reflect the active context.
To make the new hotkey usable, the timeline lanes are now selectable
on their full width — clicking anywhere in a clip's lane (not just
on the pill) selects that clip. Without this, parking the playhead
outside a pill and then selecting the clip was impossible — the
required click would always re-seek into the pill first.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
setPointerCapture should route pointerup to the captured element regardless of cursor position, but the up event can be lost when the cursor leaves the browser window or the OS swallows it. The drag state stays armed and the next pointermove over the surface snaps the trim/clip/knot back to the cursor as if the button were still held — visible to the user as "the element keeps following the mouse after a drag-and-release-outside". Two defensive layers, applied to every drag surface known to exhibit the symptom: - e.buttons === 0 guard at the top of onPointerMove. If we have an armed drag but no button is pressed, the up was missed — clear and treat the event as hover. - window-level pointerup / pointercancel / blur listener as belt-and-suspenders for releases that happen outside the document entirely. Surfaces patched: - Timeline canvas (trim, clip-move, loop, scrollbar drags) - FxHardwarePanel ADSR knots - FxHardwarePanel encoder knobs Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
I/Oset itstrimInS/trimOutSat the playhead (clamped to[0, sourceDurationS]). When an image clip is selected, they move the pill's left/right edge to the playhead — same semantics as the move-mode trim handles. Loop-mode behavior is unchanged; with no clip selected they continue to set the master export trim.pointerupwas lost off-window,dragRef/startRef/draggingstayed armed and the next move snapped the element back to the cursor as if the user were still holding the button. Two defensive layers: ane.buttons === 0guard at the top of everyonPointerMove, andwindow-levelpointerup/pointercancel/blurlisteners. Applied to Timeline (trim/clip-move/loop/scrollbar), ADSR knots, and FX encoder knobs.The routing + math for the new I/O behavior live in a pure
io-points.tsmodule with 18 unit tests covering the type-discriminator, anchor-relative source-time conversion (with/without sync offsets and trim), and the image-edge geometry.Test plan
npm run lintcleannpm run test— 728/728 pass (18 new forio-points)I/Omove master-trim markers (regression check).I/Oset trim handles to playhead. Playhead before clip →Iclamps to source 0. Playhead past source-end →Oclamps tosourceDurationS.Imoves left pill edge to playhead (right fixed);Omoves right edge (left fixed); 0.1 s min-pill enforced.I/Oeditieren weiter Loop-Grenzen unabhängig von Selektion.🤖 Generated with Claude Code