recorder: playback scopes — segment tap plays one clip, ▶ plays through - #170
Merged
Merged
Conversation
A tapped segment now plays only itself and parks at its end instead of
auto-advancing through every following clip. The center ▶ / surface tap
becomes the play-through control: it resumes from wherever the playhead
is and walks clip to clip to the draft's end — continuing into the next
clip when parked at a clip's end, and wrapping to the first clip when
parked at the draft's very end.
- new playback scope ref ('single' | 'all'): tap-open and thumb taps
narrow to 'single'; togglePlay and bar scrubs widen to 'all'
- playToEnd parks 1ms shy of the out-point in 'single' scope so the bar
knob rests inside the played clip — at exactly outMs the global
position is the boundary, which msToPx resolves to the NEXT thumb's
left edge
- clip boundaries still advance only on the native playToEnd event, so
no path truncates playback
Closes #166, closes #165
…ean ordinals Preview-adjacent polish that fell out of exercising the playback scopes: - glass segment bar: GlassPill as a passive absolute-fill background LAYER (pointerEvents none) behind the existing hierarchy — the Sortable grid, ScrollView, playhead, and drag-to-trash portal are untouched, so no gesture or reorder behavior can change - stable bar size: the scrub lane is reserved permanently instead of added with the cursor, which grew the bar and bumped it upward on every preview open; the → button gets a matching margin to stay on the thumbs' centerline - centered + slimmer: the lane is mirrored as top padding (thumbs land dead-center) and trimmed 16→12 — the knob only overhangs ~4pt, the rest is hitSlop headroom - playhead line no longer strikes through the ordinal pills: the cursor is a sibling drawn OVER the ScrollView (zIndex can't cross that boundary), so the line now starts below the pill's dip into the thumb; BADGE_SIZE moves into track-metrics so bar and cursor share it
Collaborator
Author
|
Added a second commit with segment-bar polish that fell out of exercising the playback scopes on device:
|
This was referenced Aug 14, 2026
There was a problem hiding this comment.
Pull request overview
Updates the in-recorder preview playback behavior so segment thumbnail taps play only the selected clip, while the center ▶ / surface tap plays through the draft from the current playhead position.
Changes:
- Add a
'single' | 'all'playback scope ref inusePreview, switching scope based on gesture (thumb tap vs ▶/surface tap vs scrub). - In
'single'scope, park playback at the clip end (1ms shy ofoutMs) instead of auto-advancing; in'all'scope, continue across clip boundaries and wrap/replay from the end. - Adjust recorder segment bar visuals/geometry (glass background layer + scrub/badge metrics) to keep layout stable while previewing.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/features/recorder/use-preview.ts | Introduces playback scopes and changes end-of-clip handling + ▶ behavior to support single-clip vs play-through. |
| src/features/recorder/track-metrics.ts | Tweaks track constants (SCRUB_LANE) and centralizes BADGE_SIZE for shared geometry. |
| src/features/recorder/segment-bar.tsx | Adds a GlassPill background layer and updates padding/viewport behavior for a stable scrub lane. |
| src/features/recorder/playhead-cursor.tsx | Updates cursor line start/height to account for the badge pill geometry (BADGE_SIZE). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
SarkarShubhdeep
approved these changes
Aug 25, 2026
SarkarShubhdeep
left a comment
Collaborator
There was a problem hiding this comment.
Everything looks good.
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.
Closes #166. Closes #165.
Stacked on #169. Two commits:
use-preview.ts(the behavior change)segment-bar.tsx,playhead-cursor.tsx,track-metrics.ts)Commit 1 — playback scopes
Previously, tapping a segment thumbnail auto-advanced through every following clip, and there was no way to hear just one clip. This splits playback into two scopes with no new UI:
singleallall▶ edge cases: parked at a clip's end → continues into the next playable clip; parked at the draft's very end → wraps to clip 1 (replay); single-clip draft → restarts in place.
#165 originally proposed a dedicated play-all button — during design this landed on reusing the existing center ▶ instead: no segment-bar space consumed, one obvious control, and "play through from here" covers the full-playthrough case.
Implementation notes
'single' | 'all') — playback events read it, nothing renders from itplayToEndinsinglescope parks 1ms shy of the out-point: at exactlyoutMsthe draft-global position is the clip boundary, whichmsToPx/indexAtGlobalMsresolve to the next segment at fraction 0 — the bar knob visibly hopped onto the next thumbplayToEndevent — no epsilon-based advancing, so no path truncates a clip or the timelineCommit 2 — segment-bar polish (found while testing commit 1)
BADGE_SIZEmoves intotrack-metricsso bar and cursor share it. Directly caused by commit 1: single-clip playback parks the playhead ON a clip, making the strike-through constantly visibleGlassPillas a passive absolute-fill background layer (pointerEvents="none") behind the existing hierarchy; Sortable grid, ScrollView, playhead, and drag-to-trash portal untouched. Resolves the ui: extend Liquid Glass to all chrome floating over video #168 segment-bar item (perf-verified on device: scrub, reorder, playhead-follow all smooth)Testing
tsc --noEmit, ESLint, and the jest suite (126 passing) clean