Stop button, resizable terminal, grey Run, origin-checked APIs, distribute script#14
Merged
Merged
Conversation
1) build_and_distribute.bat: build Release and copy build\Release (exe, icons, runtime DLLs) to %USERPROFILE%\Desktop\neo-processing. 2) Run ">" button is now neutral grey instead of blue. 3) Terminal height is resizable via a new horizontal splitter (.h-splitter), mirroring the editor/preview width splitter; drag drives --bottom-panel-size on the layout grid. 4) New Stop "square" button beside Run: tears down the sketch iframe so it stops executing/rendering, and resets capture state. 5) Security: the write endpoints (/api/save-script, /api/save-media) now reject requests whose Origin isn't the app's own page origin. Sketch code runs in an opaque-origin sandbox (Origin: null) and is denied, closing the one channel by which it could drive the server. Documented in SECURITY.md/AGENTS.md, plus a note to treat webview binds as reachable by sketch code. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Five things from this round.
1.
build_and_distribute.batImplemented (was a stub). It sets up the MSVC environment, builds Release, then copies the
build\Releasefolder — executable,icons/, and any runtime DLLs — to%USERPROFILE%\Desktop\neo-processing(replacing it if present, viarobocopy).2. Grey Run button
The top-left
>(and the new Stop button) are now a neutral grey instead of blue.3. Resizable terminal
Added a horizontal splitter (
.h-splitter) between the preview area and the terminal, mirroring the existing editor/preview width splitter. Dragging it drives a--bottom-panel-sizecustom property on the layout grid (clamped 48px – 80% of the layout). The editor re-flows during the drag.4. Stop button
A new
■button beside Run. It removes the running sketch iframe so the sketch stops executing and rendering entirely, and resets capture state. (sketchFrameis cleared, so Record/Capture/Fullscreen then prompt "Run a sketch first".)5. Security — isolate sketch JS from the C++ app (the main ask)
Reviewed how user JS could reach the native side. The sketch already runs in a
sandbox="allow-scripts", opaque-origin iframe (no parent/DOM/storage access, can't read API responses). The one residual channel was a fire-and-forget request to the local write endpoints (whose response it can't read, but the side effect — writing tooutputs/— could still fire). Closed it:/api/save-scriptand/api/save-medianow reject any request whoseOriginheader isn't the app's own page origin (http://127.0.0.1:<port>). The editor UI's POSTs carry that origin; the sketch's opaque-origin requests carryOrigin: null→ 403.webview.bindas reachable by sketch code (the only bind,neoSetDesktopFullscreen, just toggles the window — reversible with Esc).Reviewer notes
node --checkpasses; Debug target builds and links.Origin: null→ 403, foreign origin → 403, app origin → 200.build_and_distribute.batwasn't auto-run here (it does a full Release build and writes a folder to the real Desktop) — run it when you want the distributable.🤖 Generated with Claude Code