Skip to content

feat: 'add frames per second' <select /> per project - #50

Open
PlkMarudny wants to merge 1 commit into
ronak-create:mainfrom
PlkMarudny:project-fps
Open

feat: 'add frames per second' <select /> per project#50
PlkMarudny wants to merge 1 commit into
ronak-create:mainfrom
PlkMarudny:project-fps

Conversation

@PlkMarudny

@PlkMarudny PlkMarudny commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Allows to set a fps value per project

image

fps can be set per project; only the resolution was settable before

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

  • New Features
    • Added a Project FPS selector to the Program Monitor header.
    • Choose from preset frame rates: 24, 25, 30, 50, or 60 FPS.
    • Non-preset frame rates are displayed as Custom.
    • Selected FPS values are saved with the project and applied to timeline previews, timecode, and exports.
  • Documentation
    • Updated project and feature documentation to describe FPS settings and behavior.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The Program Monitor now provides a project FPS dropdown with preset and Custom options. Changes update project.fps, synchronize loaded projects, seek paused media, mark the timeline dirty, and schedule persistence. Documentation and changelog entries describe the behavior.

Changes

Project FPS selection

Layer / File(s) Summary
FPS selector UI wiring
app.js, index.html, style.css
Adds the FPS dropdown, preset definitions, DOM binding, removal of the old monitor status label, and targeted selector sizing.
FPS synchronization and persistence
app.js, CLAUDE.md, README.md, CHANGELOG.md
Synchronizes preset or Custom values during project loading and selection changes, updates project state, seeks paused media, schedules saving, and documents the feature.

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

Sequence Diagram(s)

sequenceDiagram
  participant fpsSel
  participant syncFpsSel
  participant project
  participant MediaTimeline
  fpsSel->>project: update project.fps
  project->>syncFpsSel: synchronize preset or Custom option
  syncFpsSel->>MediaTimeline: seek paused media
  project->>project: mark timeline dirty and schedule saving
Loading

Possibly related PRs

Suggested reviewers: xusnitdinov

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding a per-project FPS select control.
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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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 `@app.js`:
- Around line 5573-5578: Update syncAspectSel so option labels are assigned
through textContent rather than interpolating project.width and project.height
into innerHTML. Build the ASPECT_PRESETS options and the custom option as DOM
option elements, preserving selection behavior and the existing custom label.

In `@style.css`:
- Line 923: Update the `#fpsSel.head-select` styling so custom FPS values such as
“Custom · 29.97 fps” remain fully readable, either by increasing max-width to
accommodate common values or by using a shorter selected-value label while
preserving the existing selector behavior.
🪄 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 Plus

Run ID: 48504a05-62b9-4422-ab61-8506b1d5a28b

📥 Commits

Reviewing files that changed from the base of the PR and between 4b7d8f5 and 8de4462.

📒 Files selected for processing (6)
  • CHANGELOG.md
  • CLAUDE.md
  • README.md
  • app.js
  • index.html
  • style.css

Comment thread app.js
Comment on lines 5573 to 5578
function syncAspectSel() {
if (!els.aspectSel) return;
const i = ASPECT_PRESETS.findIndex((a) => a.w === project.width && a.h === project.height);
els.aspectSel.innerHTML =
ASPECT_PRESETS.map((a, j) => `<option value="${j}" ${j === i ? "selected" : ""}>${a.label}</option>`).join("") +
(i < 0 ? `<option value="custom" selected>Custom · ${project.width}×${project.height}</option>` : "");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Avoid interpolating project dimensions into innerHTML.

project.width and project.height come from loaded project data and are inserted directly into the custom option label. Build <option> elements and assign textContent instead; this avoids malformed or imported project data being interpreted as markup.

Proposed fix
 function syncAspectSel() {
   if (!els.aspectSel) return;
   const i = ASPECT_PRESETS.findIndex((a) => a.w === project.width && a.h === project.height);
-  els.aspectSel.innerHTML =
-    ASPECT_PRESETS.map((a, j) => `<option value="${j}" ${j === i ? "selected" : ""}>${a.label}</option>`).join("") +
-    (i < 0 ? `<option value="custom" selected>Custom · ${project.width}×${project.height}</option>` : "");
+  const options = ASPECT_PRESETS.map((a, j) => {
+    const option = document.createElement("option");
+    option.value = String(j);
+    option.textContent = a.label;
+    option.selected = j === i;
+    return option;
+  });
+  if (i < 0) {
+    const option = document.createElement("option");
+    option.value = "custom";
+    option.textContent = `Custom · ${project.width}×${project.height}`;
+    option.selected = true;
+    options.push(option);
+  }
+  els.aspectSel.replaceChildren(...options);
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
function syncAspectSel() {
if (!els.aspectSel) return;
const i = ASPECT_PRESETS.findIndex((a) => a.w === project.width && a.h === project.height);
els.aspectSel.innerHTML =
ASPECT_PRESETS.map((a, j) => `<option value="${j}" ${j === i ? "selected" : ""}>${a.label}</option>`).join("") +
(i < 0 ? `<option value="custom" selected>Custom · ${project.width}×${project.height}</option>` : "");
function syncAspectSel() {
if (!els.aspectSel) return;
const i = ASPECT_PRESETS.findIndex((a) => a.w === project.width && a.h === project.height);
const options = ASPECT_PRESETS.map((a, j) => {
const option = document.createElement("option");
option.value = String(j);
option.textContent = a.label;
option.selected = j === i;
return option;
});
if (i < 0) {
const option = document.createElement("option");
option.value = "custom";
option.textContent = `Custom · ${project.width}×${project.height}`;
option.selected = true;
options.push(option);
}
els.aspectSel.replaceChildren(...options);
}
🧰 Tools
🪛 ast-grep (0.45.0)

[warning] 5575-5577: Avoid assigning untrusted data to innerHTML/outerHTML or document.write
Context: els.aspectSel.innerHTML =
ASPECT_PRESETS.map((a, j) => <option value="${j}" ${j === i ? "selected" : ""}>${a.label}</option>).join("") +
(i < 0 ? <option value="custom" selected>Custom · ${project.width}×${project.height}</option> : "")
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

(inner-outer-html)

🤖 Prompt for 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.

In `@app.js` around lines 5573 - 5578, Update syncAspectSel so option labels are
assigned through textContent rather than interpolating project.width and
project.height into innerHTML. Build the ASPECT_PRESETS options and the custom
option as DOM option elements, preserving selection behavior and the existing
custom label.

Source: Linters/SAST tools

Comment thread style.css
font: 12px "Segoe UI", sans-serif;
max-width: 170px;
}
#fpsSel.head-select { max-width: 88px; }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Keep custom FPS values readable.

Custom · 29.97 fps is wider than the 88px limit, so the selected value can be clipped and hide the actual project rate. Use a shorter display label or allow enough width for common custom values.

🤖 Prompt for 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.

In `@style.css` at line 923, Update the `#fpsSel.head-select` styling so custom FPS
values such as “Custom · 29.97 fps” remain fully readable, either by increasing
max-width to accommodate common values or by using a shorter selected-value
label while preserving the existing selector behavior.

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.

1 participant