Skip to content

fix(studio): keep layer selection seek within clip range#793

Open
Jefsky wants to merge 1 commit into
heygen-com:mainfrom
Jefsky:fix/layer-selection-seek
Open

fix(studio): keep layer selection seek within clip range#793
Jefsky wants to merge 1 commit into
heygen-com:mainfrom
Jefsky:fix/layer-selection-seek

Conversation

@Jefsky
Copy link
Copy Markdown

@Jefsky Jefsky commented May 13, 2026

Summary

Clicking a layer in the Layers panel was always seeking to the clip midpoint, even when the playback head was already inside that clip. This caused unwanted preview jumps during playback.

What changed

packages/studio/src/components/editor/LayersPanel.tsxseekToLayer now reads currentTime from the player store and only calls requestSeek when the current time falls outside the selected clip's [start, start+duration] range.

Closes #792

Only seek when the current playback time is outside the selected clip's
range. When the user clicks a layer whose clip already contains the
current time, the seek is skipped — avoiding unwanted preview jumps
during playback.

Fixes heygen-com#792
Copy link
Copy Markdown
Collaborator

@vanceingalls vanceingalls left a comment

Choose a reason for hiding this comment

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

First review at efea6497.

Blocker — LayersPanel.tsx is added as a NEW FILE but the file already exists

gh pr files 793 --repo heygen-com/hyperframes shows:

{"file":"packages/studio/src/components/editor/LayersPanel.tsx","status":"added","additions":295}

status: "added" against an existing file means the PR was authored against a base where the file didn't exist — likely a branch from before the LayersPanel landed on main. As soon as this rebases against current main, you'll either:

  • get a merge conflict (the file already has 295 different lines), or
  • silently overwrite the existing component, losing every change committed to LayersPanel since the branch point.

The CI shape ("no checks reported on the 'fix/layer-selection-seek' branch") suggests the branch hasn't been refreshed in a while and the merge state is stale.

Blocker — superseded by #792

#792 (func25) addresses the same bug — "Keep Layers panel selection seek within clip range" — but does it correctly:

  • Modifies the existing LayersPanel.tsx (status: modified, +15/-5) instead of recreating it
  • Extracts the clamp logic into a pure helper resolveTimelineSelectionSeekTime in packages/studio/src/utils/studioHelpers.ts
  • Adds unit tests for the helper covering all four branches (inside-range / before / after / NaN-input)
  • CI fully green

#792 is also the PR your branch description says you closed (Closes #792). That's reversed — your PR is the duplicate, not #792's.

Recommendation

Close this PR; #792 ships the same fix safely. Worth noting that #794 (caption JSON.stringify, same author) and #795 (ObjectURL revoke + tsconfig, same author) ALSO add LayersPanel.tsx as a new file — same issue. They should each drop the LayersPanel addition and keep only the file each PR's title describes.

Verdict

Verdict: REQUEST CHANGES
Reasoning: The PR would clobber the existing LayersPanel.tsx on merge (re-adds an already-existing file as new). #792 ships the same fix correctly with extracted helper + tests. Recommend closing this PR.

— Vai

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