Skip to content

feat: Reset the property to the default value on labels' Ctrl+click#36

Merged
ronak-create merged 1 commit into
ronak-create:mainfrom
PlkMarudny:insp-label-reset
Jul 19, 2026
Merged

feat: Reset the property to the default value on labels' Ctrl+click#36
ronak-create merged 1 commit into
ronak-create:mainfrom
PlkMarudny:insp-label-reset

Conversation

@PlkMarudny

@PlkMarudny PlkMarudny commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Reset a property value on Ctrl+click in the inspector.

Type of change

  • Bug fix
  • New feature (UI enhancement)
  • 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 Ctrl/Cmd-click support on inspector labels to reset supported properties to their defaults.
    • Resetting a property also clears related keyframes and transition settings.
    • Added hover styling to indicate reset-capable inspector labels.
  • Documentation

    • Documented the new property reset shortcut in the editing features guide.

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Inspector labels now support Ctrl/Cmd-click resets for eligible clip properties. Resets restore defaults, clear transition settings and matching keyframes, schedule saving, and re-render the inspector. README and CSS document and style the interaction.

Changes

Inspector property reset

Layer / File(s) Summary
Reset-capable inspector labels
app.js, style.css, README.md
Inspector controls across crop, chroma key, transitions, text, font, and styling expose reset labels, with matching hover styling and README documentation.
Property and keyframe reset
app.js
Reset clicks restore defaults, clear transition objects, remove matching keyframe curves, schedule saving, and re-render the inspector.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: xusnitdinov

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant InspectorLabel
  participant renderInspector
  participant ClipProperties
  participant SaveScheduler
  User->>InspectorLabel: Ctrl/Cmd-click reset label
  InspectorLabel->>renderInspector: Dispatch reset click
  renderInspector->>ClipProperties: Restore defaults and clear matching state
  renderInspector->>SaveScheduler: Schedule save
  renderInspector->>InspectorLabel: Re-render inspector
Loading
🚥 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 describes the main change: Ctrl/Cmd-clicking inspector labels resets properties to defaults.
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.

@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: 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 `@app.js`:
- Line 2024: Update the textarea content interpolation in the row rendering to
HTML-escape p.text before it is passed to row and assigned through innerHTML,
ensuring characters such as <, >, &, and quotes cannot break out of the textarea
element while preserving the displayed text.
🪄 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: 692974a7-44a9-46b7-aa18-5f303c7c7b42

📥 Commits

Reviewing files that changed from the base of the PR and between d0780a5 and 837b41c.

📒 Files selected for processing (3)
  • README.md
  • app.js
  • style.css

Comment thread app.js
const known = [...SYSTEM_FONTS, ...runtime.customFonts, ...GOOGLE_FONTS, ...runtime.googleLoaded];
html += `<div class="insp-section"><h3>Text</h3>
${row("Content", `<textarea data-k="text">${p.text}</textarea>`)}
${row("Content", `<textarea data-k="text">${p.text}</textarea>`, "", "text")}

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 | 🔴 Critical | ⚡ Quick win

Escape the textarea content to prevent Cross-Site Scripting (XSS).

Directly interpolating p.text into the <textarea> allows a malicious payload (e.g., </textarea><script>alert(1)</script>) to break out of the tag and execute arbitrary JavaScript when the string is assigned to innerHTML below.

🐛 Proposed fix
-      ${row("Content", `<textarea data-k="text">${p.text}</textarea>`, "", "text")}
+      ${row("Content", `<textarea data-k="text">${String(p.text).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;")}</textarea>`, "", "text")}
📝 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
${row("Content", `<textarea data-k="text">${p.text}</textarea>`, "", "text")}
${row("Content", `<textarea data-k="text">${String(p.text).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;")}</textarea>`, "", "text")}
🤖 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` at line 2024, Update the textarea content interpolation in the row
rendering to HTML-escape p.text before it is passed to row and assigned through
innerHTML, ensuring characters such as <, >, &, and quotes cannot break out of
the textarea element while preserving the displayed text.

@ronak-create
ronak-create merged commit 06c84d3 into ronak-create:main Jul 19, 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