feat(preview): add loop toggle for timeline playback#795
Conversation
|
@avillagran is attempting to deploy a commit to the OpenCut OSS Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughAdds an optional project ChangesPlayback Looping: Schema, Logic, and UI
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
8cd0fe9 to
5f0f5e5
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/web/src/preview/components/toolbar.tsx`:
- Around line 158-160: The Button used as the loop toggle in the toolbar
component (the JSX element with props variant={loop ? "secondary" : "text"} and
size="icon") lacks an explicit type, which can cause unintended form
submissions; update that Button element to include type="button" so it won't act
as a submit button when rendered inside a form (locate the loop toggle JSX in
the toolbar component and add the type prop).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: fa52ff3c-a220-4d44-b2cb-33f0dba3e95e
📒 Files selected for processing (3)
apps/web/src/core/managers/playback-manager.tsapps/web/src/preview/components/toolbar.tsxapps/web/src/project/types.ts
Adds a loop button next to the play/pause control in the preview toolbar. When enabled, preview playback wraps back to the start of the timeline instead of pausing on reaching the end. The state is persisted as a per-project setting and defaults to off. - Add optional \`loop: boolean\` field to \`TProjectSettings\` - Add \`LoopToggleButton\` in the preview toolbar, wired through \`UpdateProjectSettingsCommand\` so toggling is undoable - In \`PlaybackManager.updateTime\`, when the playhead reaches the end and the project's \`loop\` setting is on, reset to time zero and continue scheduling animation frames instead of pausing. The audio manager picks up the seek-to-zero through the existing \`onSeek\` listener, so audio restarts in sync with video.
5f0f5e5 to
2cdf007
Compare
|
Thanks @coderabbitai. Pushed a force-update that adds |
|
Tip For best results, initiate chat on the files or code changes.
|
Summary
Adds a loop toggle button next to the play/pause control in the preview toolbar. When enabled, preview playback wraps back to the start of the timeline instead of pausing once the playhead reaches the end. The state is persisted as a per-project setting (`TProjectSettings.loop`) so it survives reloads and is remembered per project. Defaults to off.
What changed
Test plan
Notes
Summary by CodeRabbit