Skip to content

fix: keep unsaved work, render with the installed FFmpeg, and harden Windows launches - #19

Merged
nodemode-ai merged 11 commits into
mainfrom
fix/review-2026-11-28
Nov 29, 2026
Merged

nodemode-ai merged 11 commits into
mainfrom
fix/review-2026-11-28

Conversation

@gbarnai

@gbarnai gbarnai commented Nov 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Open, New, Close Project, Open Recent, templates and the demo project now ask Save / Don't Save / Cancel when the project has unsaved changes. Closing the desktop window, app.quit and Cmd+Q ask the same before the engine stops.
  • MCP: project, execute and batch refuse new, open, close, openRecent, demo and templates.create while the project has unsaved changes, unless discard: true is passed. A default render output gets a free name instead of replacing an earlier render.
  • H.264 and HEVC renders choose an encoder the installed FFmpeg lists: libx264/libx265 first, then VideoToolbox, Media Foundation, OpenH264, NVENC, QSV or AMF. If none is found, the render fails with a clear message. Encoder names are matched as whole words.
  • A render never writes over footage, sequence frames or proxies the project uses. Files are compared by file identity, so links, a change of case and .. steps lead to the same file. Image sequence frames are checked as each one is written.
  • Auto-save copies in a shared folder carry a tag taken from the project id, so projects with the same name and untitled projects stay apart. Recent lists are re-read before each change and written atomically. Live Link side engines add nothing to Open Recent.
  • Windows: an npm .cmd agent shim is followed to its node script or .exe and run without cmd.exe. Any other batch file, in any spelling, only takes words cmd.exe reads as one plain argument. If the batch file's own path needs quotes, no word may need quotes either. Edit Original opens footage through explorer with a quoted path and declines program and script files.
  • Tests: unsaved-changes refusals (window and MCP), encoder choice, render overwrite of footage and sequence frames, auto-save separation, recent lists across engines, Windows shim and batch argument handling, Edit Original file types.
  • Test plan: [ ] CI green on all jobs; [ ] manual check on Windows of an npm-installed agent tab and Chat; [ ] Windows Edit Original on a file name containing & or ^; [ ] H.264 render with an FFmpeg build that lacks libx264.
  • Windows: when a .cmd or .bat agent program still has to start through cmd.exe, any argument containing & | < > ^ ( ) ! % a quote mark or a control character is refused, whether or not it has spaces. The message says to pass long text through standard input or a file.
  • Windows: the program path may contain parentheses only when it is quoted, and then no argument may need quotes.
  • npm style .cmd shims still run their node script or program directly, with no command interpreter, and fall back to the strict checks when the target is missing.
  • Tests cover both Windows launch paths and run on any OS.

Tests

  • Each fix has a test that fails on the previous code where practical.
  • The repo CI commands were run locally on macOS. Every failure seen locally also fails on main in the same environment (missing local tools or platform-specific tests); none is introduced here.
  • Please rely on this PR's CI run for Linux and Windows.

For the owner

  • A few related items need an owner decision; they are listed separately, not here.

How to ship

  • Independent of other repos; merge in any order. No version bump; release as usual.

…loses

Open, New, Close Project, Open Recent, templates and the demo project now
offer Save, Don't Save or Cancel when the project has unsaved changes, as
the demo did already. Closing the desktop window and Quit ask the same
before the engine stops.
new, open, close and demo replace the project and clear its undo history,
so they now refuse while it has unsaved changes unless discard is true.
A default render output no longer replaces an earlier render of a
composition with the same name.
Movie renders pick libx264 or libx265 when present and otherwise a
platform encoder (VideoToolbox, Media Foundation, OpenH264, NVENC, QSV,
AMF), so the LGPL FFmpeg build renders the default format. Encoder names
match whole words. A render never writes over footage the project uses.
…nterpreter

Edit Original starts explorer with the quoted path, so a file name with
& or ^ stays one file name.
… and engines

Auto-save copies in a shared folder carry a tag from the project id, so
same-named and untitled projects no longer number or prune each other's
copies. Recent lists are re-read before each change and written in one
step, and Live Link engines no longer add to them.
An npm style shim is followed to the node script or program it starts.
Any other .cmd or .bat refuses words cmd.exe would misread: control
characters, percent signs, quote marks, and & | < > ^ ( ) ! in a word
that is not quoted. Shared finder 1.0.2.
…quoting intact

A .cmd or .bat named with another case, trailing dots or spaces, or a
stream suffix goes through the same checks. When the program's own path
needs quotes, cmd /c drops the outer quote marks, so then no word may
need quotes or carry a command interpreter character.
Commands that replace the open project, run through execute or inside a
batch, refuse while it has unsaved changes unless discard is true.
…it Original to media

A render output is matched against every footage, sequence frame and
proxy file the project uses by device and inode (by the resolved path,
ignoring case, on Windows), so a link, a case change or a .. step finds
the same file. Image sequence frames are checked as they are written.
Edit Original declines program and script files.
…e argument

When a .cmd or .bat still has to start through cmd.exe, any argument
with & | < > ^ ( ) ! % a quote mark or a control character is refused,
with or without spaces, and the message points to standard input or a
file for long text. The program path takes ( ) only when quoted. npm
style shims keep starting their script or program directly.
@gbarnai
gbarnai requested a review from nodemode-ai as a code owner November 29, 2026 18:20
@nodemode-ai
nodemode-ai merged commit 895307f into main Nov 29, 2026
6 checks passed
@nodemode-ai
nodemode-ai deleted the fix/review-2026-11-28 branch November 29, 2026 18:43
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