Skip to content

Sketch background colour picker; build as GUI app (no console)#15

Merged
vecnode merged 1 commit into
mainfrom
sketch-bg-picker-and-no-console
Jun 29, 2026
Merged

Sketch background colour picker; build as GUI app (no console)#15
vecnode merged 1 commit into
mainfrom
sketch-bg-picker-and-no-console

Conversation

@vecnode

@vecnode vecnode commented Jun 29, 2026

Copy link
Copy Markdown
Owner

What & why

1. Sketch background colour picker

New Sketch section in the right side panel with a colour picker (default white). It sets the background shown behind the sketch canvas — the area around it when the canvas is smaller than the preview, and the fullscreen letterbox.

  • The colour is baked into the sketch iframe's <body> background when a sketch runs.
  • Changing it pushes the colour to a running sketch live via postMessage({type:'set-bg'}) (handled by the capture controller already injected in the iframe) — no restart.
  • Drives a --sketch-bg CSS variable so the :fullscreen preview letterbox matches.

2. No console window

On Windows the target is now built as a GUI app: WIN32_EXECUTABLE TRUE plus /ENTRY:mainCRTStartup (MSVC) so the standard int main() stays the entry point. Launching the .exe — dev build or the distributed one — no longer pops a console window.

Trade-off: std::cerr/std::cout logging is no longer visible from a console (attach a debugger if needed during development). Noted in AGENTS.md.

Reviewer notes

  • node --check passes; reconfigured + Debug build links cleanly.
  • Verified the PE subsystem flipped from WINDOWS_CUI (3) to WINDOWS_GUI (2), and the app still launches and binds loopback.
  • The live colour change in WebView2 is worth an eyeball: open the panel, run a sketch whose canvas is smaller than the preview, and change the colour — the margin around the canvas should update immediately.

🤖 Generated with Claude Code

1) New "Sketch" section in the side panel with a colour picker (default
   white) controlling the background behind the sketch canvas — the area
   around it (and the fullscreen letterbox). Baked into the iframe on run
   and pushed live to a running sketch via postMessage ('set-bg').
2) Windows: build the target as a GUI app (WIN32_EXECUTABLE +
   /ENTRY:mainCRTStartup so int main() stays the entry point), so no
   console window opens when the .exe is launched (dev or distributed).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vecnode vecnode merged commit c5737cc into main Jun 29, 2026
@vecnode vecnode deleted the sketch-bg-picker-and-no-console branch June 29, 2026 13:12
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