Skip to content

fix: smooth scrubber end seeking#386

Merged
miguel-heygen merged 6 commits intomainfrom
fix/timeline-autoscroll-video-starter
Apr 21, 2026
Merged

fix: smooth scrubber end seeking#386
miguel-heygen merged 6 commits intomainfrom
fix/timeline-autoscroll-video-starter

Conversation

@miguel-heygen
Copy link
Copy Markdown
Collaborator

@miguel-heygen miguel-heygen commented Apr 21, 2026

Summary

Make end-of-timeline scrubbing settle cleanly instead of landing a few pixels short and visually jumping.

Root Cause

Near the right edge, the scrubber math could stop just short of the exact end of the seek bar. That left the thumb and time text to settle after the drag, which read as a jump.

Fix

  • add an edge snap zone for scrubber seeking
  • cover the behavior with focused tests
  • keep the player seek path honoring the exact safe duration

Verification

  • bun test packages/studio/src/player/components/PlayerControls.test.ts
  • bun run --filter @hyperframes/studio typecheck
  • bunx oxlint packages/core/src/runtime/player.test.ts packages/studio/src/player/components/PlayerControls.tsx packages/studio/src/player/components/PlayerControls.test.ts
  • bunx oxfmt --check packages/core/src/runtime/player.test.ts packages/studio/src/player/components/PlayerControls.tsx packages/studio/src/player/components/PlayerControls.test.ts

Browser Proof

  • verified near-end scrub behavior in Studio with agent-browser
  • the thumb now settles at the exact end state instead of snapping after release

Stack

@miguel-heygen miguel-heygen marked this pull request as ready for review April 21, 2026 18:27
@miguel-heygen miguel-heygen force-pushed the fix/timeline-autoscroll-video-starter branch from f636dbb to 40ed430 Compare April 21, 2026 19:51
@miguel-heygen miguel-heygen changed the title feat: improve studio timeline editing fix: smooth scrubber end seeking Apr 21, 2026
@miguel-heygen miguel-heygen changed the base branch from main to feat/studio-timeline-editing April 21, 2026 19:52
@miguel-heygen miguel-heygen force-pushed the feat/studio-timeline-editing branch from 3136f38 to 524ebd2 Compare April 21, 2026 19:55
@miguel-heygen miguel-heygen force-pushed the fix/timeline-autoscroll-video-starter branch from 40ed430 to f2b7277 Compare April 21, 2026 19:55
Copy link
Copy Markdown
Collaborator Author

miguel-heygen commented Apr 21, 2026

@miguel-heygen
Copy link
Copy Markdown
Collaborator Author

Pushed 9025928a to address the remaining Fit scrubber-end jump.

What changed:

  • Timeline no longer auto-scrolls to follow the playhead when zoom mode is fit
  • the same guard also blocks playhead-drag edge auto-scroll in fit
  • added a focused regression test for the fit/manual auto-scroll rule

Browser verification on #project/product-teaser-starter:

  • scrubbed to the end state
  • UI settled at 0:08/0:08
  • timeline scrollLeft stayed 0 in Fit
  • screenshot: /tmp/hf-scrubber-fit/fit-end-no-scroll.png

Comment thread packages/studio/src/player/components/Timeline.tsx
@miguel-heygen
Copy link
Copy Markdown
Collaborator Author

Pushed ff5671d3 to switch the timeline from px/s-based manual zoom to true percentage-based zoom.

What changed:

  • manual timeline zoom is now stored as a percent relative to the current Fit width
  • the toolbar shows true percentages instead of raw px/s
  • Timeline derives effective px/s from fit width + manual percent, so zoom stays proportional across viewport/project changes

Sweep on #project/product-teaser-starter:

  • initial: 100%
  • after one -: 80%
  • min clamp: 10%
  • first + from min: 13%
  • max clamp: 2000%
  • back to Fit: 100%
  • returning to Fit restored hidden horizontal overflow with scrollLeft = 0

Checks:

  • bun test packages/studio/src/player/store/playerStore.test.ts packages/studio/src/player/components/timelineZoom.test.ts
  • bun run --filter @hyperframes/studio typecheck
  • bunx oxlint ...
  • bunx oxfmt --check ...

@miguel-heygen miguel-heygen force-pushed the feat/studio-timeline-editing branch from 32b280b to 01490dc Compare April 21, 2026 22:22
@miguel-heygen miguel-heygen force-pushed the fix/timeline-autoscroll-video-starter branch from ff5671d to d8b86c5 Compare April 21, 2026 22:25
@miguel-heygen miguel-heygen force-pushed the feat/studio-timeline-editing branch from 01490dc to 51543f3 Compare April 21, 2026 22:55
@miguel-heygen miguel-heygen force-pushed the fix/timeline-autoscroll-video-starter branch from a663ef6 to ae1dadb Compare April 21, 2026 22:57
@miguel-heygen miguel-heygen force-pushed the feat/studio-timeline-editing branch from 51543f3 to 3c945a9 Compare April 21, 2026 23:04
@miguel-heygen miguel-heygen force-pushed the fix/timeline-autoscroll-video-starter branch from ae1dadb to b05d52b Compare April 21, 2026 23:05
@miguel-heygen miguel-heygen force-pushed the feat/studio-timeline-editing branch from 3c945a9 to d383e94 Compare April 21, 2026 23:07
@miguel-heygen miguel-heygen force-pushed the fix/timeline-autoscroll-video-starter branch from b05d52b to 612b92a Compare April 21, 2026 23:07
Copy link
Copy Markdown
Collaborator

@jrusso1020 jrusso1020 left a comment

Choose a reason for hiding this comment

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

Focused fix, clean. Edge-snap math in resolveSeekPercent is well-bounded (Math.min(0.5, 8/width) prevents snap zones from overlapping on tiny bars) and the tests cover the cases that actually matter (invalid width, left-edge, right-edge, mid-range). Core player.test.ts pins the "seek to safe duration without snapping back a frame" behavior, which is the real root cause.

One non-blocking thing to eyeball in Studio if you haven't already: NLELayout.tsx flips the tracks container from overflow-y-auto to overflow-hidden. That's fine as long as vertical track scrolling happens at a different parent now (looks like it does, based on the new outer container), but worth a quick sanity check with many tracks.

Approved for alpha.

Rames Jusso

@miguel-heygen miguel-heygen force-pushed the feat/studio-timeline-editing branch 2 times, most recently from cb7f3dd to 5590cdc Compare April 21, 2026 23:43
@miguel-heygen miguel-heygen force-pushed the fix/timeline-autoscroll-video-starter branch from 99313b8 to 4fc0758 Compare April 21, 2026 23:43
@miguel-heygen miguel-heygen changed the base branch from feat/studio-timeline-editing to graphite-base/386 April 21, 2026 23:48
@miguel-heygen miguel-heygen force-pushed the fix/timeline-autoscroll-video-starter branch from 4fc0758 to 8dcb732 Compare April 21, 2026 23:48
@graphite-app graphite-app Bot changed the base branch from graphite-base/386 to main April 21, 2026 23:49
@miguel-heygen miguel-heygen force-pushed the fix/timeline-autoscroll-video-starter branch from 8dcb732 to 8763cb8 Compare April 21, 2026 23:49
@miguel-heygen miguel-heygen merged commit 1aea141 into main Apr 21, 2026
25 checks passed
@miguel-heygen miguel-heygen deleted the fix/timeline-autoscroll-video-starter branch April 21, 2026 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants