Skip to content

fix: 'zoom to timeline' now scales the timeline to 95% of the viewport - #47

Merged
ronak-create merged 1 commit into
ronak-create:mainfrom
PlkMarudny:zoom-to-timeline-fix
Aug 4, 2026
Merged

fix: 'zoom to timeline' now scales the timeline to 95% of the viewport#47
ronak-create merged 1 commit into
ronak-create:mainfrom
PlkMarudny:zoom-to-timeline-fix

Conversation

@PlkMarudny

@PlkMarudny PlkMarudny commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

'Zoom to timeline' ( shortcut Z) feature now scales the timeline so that it it fits within 95% of the available space.

Type of change

  • Bug fix
  • New feature (transition / preset / text anim / effect / API)
  • Docs
  • Refactor / internal

How was it verified?

  • node --check server.js && node --check app.js && node --check mcp-server.js passes
  • Opened the editor and confirmed the change in preview
  • Confirmed the change in an export (fast or realtime), if it affects rendering
  • Updated CLAUDE.md / README.md if the schema, props, or API changed

Checklist

  • No new runtime dependencies added
  • Preview and export render identically (single compositor)
  • Commits are focused and messages are descriptive

Summary by CodeRabbit

  • Bug Fixes
    • Timeline zoom-to-fit now fills approximately 95% of the visible timeline width for a more consistent view.
    • Removed unnecessary trailing space from zoom-to-fit calculations.
    • Timeline duration no longer expands incorrectly when clips reference unavailable tracks.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c27fe263-a3d3-4998-b11a-92bde01b128a

📥 Commits

Reviewing files that changed from the base of the PR and between 6ec153e and 4664b70.

📒 Files selected for processing (1)
  • app.js

📝 Walkthrough

Walkthrough

Changes

Timeline fit behavior

Layer / File(s) Summary
Valid clip duration calculation
app.js
projDur() ignores clips referencing unknown tracks and excludes non-finite clip end times when calculating the timeline duration.
Viewport-based zoom fitting
app.js
zoomToFit() uses the project duration without trailing padding, scales content to 95% of the viewport, and scrolls to the timeline start.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: xusnitdinov

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the primary change to Zoom to timeline behavior and the 95% viewport fit.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ronak-create ronak-create left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Approving — small, correct, and the comments explain the reasoning.

Two notes for the record rather than changes:

  • Dropping TIMELINE_PAD_SEC from the fit span is the right call, but since contentWidth() still adds it, a horizontal scrollbar will now always be present after a Fit. That matches how Fit behaves in other NLEs, so I read it as intended — just flagging it since the old comment explicitly promised "no horizontal overflow".
  • The projDur() hardening (skipping clips whose track is not in TRACKS, guarding non-finite ends) goes a little beyond the title. It is a safe improvement — projDur() also feeds the export duration, and a clip on a nonexistent track is not rendered anyway — so no objection, it just deserves a mention in the description.

Conflicts with none of the other open PRs, so this one goes in first.

@ronak-create
ronak-create merged commit dee7caa into ronak-create:main Aug 4, 2026
2 checks passed
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