Skip to content

Windows 11 app: Rust host + Tauri shell (draft, not a full rewrite) - #182

Draft
Zns-Nexus wants to merge 6 commits into
iterative-computer:mainfrom
screen-devs:windows-rust-host
Draft

Zns-Nexus wants to merge 6 commits into
iterative-computer:mainfrom
screen-devs:windows-rust-host

Conversation

@Zns-Nexus

Copy link
Copy Markdown

Not a full rewrite, and not ready to merge. This PR ports Electron's main process to Rust so Powermove runs on Windows 11. The editor itself, the Svelte renderer, is unchanged and shared with the Mac app. It's open so the team can see the approach and review it. Nothing here has been built or tested on macOS.

Summary

The renderer only reaches native code through the IPC contract in shared/ipc.ts. On Windows that contract runs over the WebSocket protocol powermove serve already uses (shared/wire.ts), with a Rust host on the other end.

flowchart LR
  R["Svelte renderer<br/>(unchanged, shared)"] -- "preload IPC" --> E["Electron main (TS)<br/>macOS"]
  R -- "web-bridge.ts over loopback WS" --> H["crates/powermove-host (Rust)<br/>Windows"]
  H --> T["crates/powermove-windows<br/>Tauri 2 + WebView2, NSIS installer"]
Loading
crates/
├── powermove-host/      # IPC channels in Rust: store, windows, dialogs, fonts,
│                        # .pmv save/open (PMV3/PMV4 compatible), ffmpeg proxies + export,
│                        # mod compiler (esbuild.exe + Svelte in QuickJS, no Node),
│                        # Codex/Claude/compatible agents with editor tools over MCP
└── powermove-windows/   # window, single instance, .pmv association, installer
scripts/windows/         # build.ps1 + resource staging

Renderer changes, one commit each:

Commit Reaches the Mac app?
Desktop mode in web-bridge.ts No. It's gated on hello.desktop, and the Mac app uses the Electron preload.
Ctrl shortcut labels and Ctrl modifiers Yes. Labels keep ⌘ on macOS, but see the selection issue below.
Tabbed panel groups Yes. This is a new feature for both platforms.
WebM export, value scrubbing and meter fixes Only as fallbacks. They run only when the direct path fails.
Alt + scroll wheel track height Yes. New feature (Option + scroll on the Mac).

Evidence

Tested on Windows 11:

  • Import, edit and export:
    • An MP4 imported, played, was edited and was saved through the native dialog. The export was a 10 s, 1080p H.264 file with AAC audio.
    • WebM, before: export failed with Failed to construct 'VideoFrame'. After: a 10 s, 1080p VP9 file with Opus audio.
  • Projects: .pmv save and open in place, with backups and incremental saves. Opening from a launch argument works.
  • Media after restart: before, media showed as offline after a restart. After, it survives, because the loopback origin is now stable.
  • Agents: a real Codex run added a text layer to the live editor. A Codex parent delegated to a Codex child. An agent wrote a tint mod, which was compiled, published and undone.
  • Mods: a sample mod dropped into the mods folder compiled without Node in 162 ms (cold) and loaded straight away.
  • Value scrubbing:
    • Before: numfield-pointer-lock.test.ts failed with "expected 100 to be 52".
    • After: it passes.
  • Tests:
    • cargo test -p powermove-host: 108 passed.
    • Focused Vitest suites for the changed areas pass.
    • svelte-check: 0 errors.
    • The full Vitest run on Windows still fails for Electron main and server tests that assume a POSIX shell (/bin/sh), plus a few timing-sensitive tests. None of these was caused by this PR.

Merge Danger

Door: two-way. The Rust crates and scripts are new and the Mac build doesn't use them. The renderer changes are split into separate commits that can be dropped one by one.

Blast Radius: renderer-wide

Known issues the macOS app will face if this merges as is:

  • Ctrl-drag in the timeline (behaviour change): box and click selection now treat Ctrl like ⌘ and Shift on every platform. On macOS, Ctrl-drag in the timeline and graph now adds to the selection, and Ctrl-click usually means right-click there. Before merging, check ctrlKey only off macOS in extensions/timeline/timeline.ts.
  • Tabbed panels (new layout code): about 500 lines in layout/ change docking, dragging and saved workspaces on the Mac too.
    • Old saves load unchanged.
    • An older build opening a new save drops the tab groups and stacks those panels vertically.
    • Dragging a group's header moves only its front tab.
  • Shortcut matching: extension cmd+ bindings and the formatter now branch on the platform. The Mac path is covered by tests but hasn't been run in the Mac app.
  • nativeEdit contract: ipc.ts now lets nativeEdit return false, meaning "not handled, let the key do its default". The Mac preload returns nothing, which is still treated as handled, so the Mac behaviour should be unchanged.
  • Drag limit: single locked pointer moves larger than a quarter of the window are now dropped on every platform. Real Mac drags move a few pixels per event, so it shouldn't trigger there, but very fast flicks on large external displays are worth checking.
  • Root Cargo workspace: adding Cargo.toml at the repo root does nothing to the Mac build, but any CI that globs for Cargo.toml will now find one.
  • Not ported to Windows yet:
    • Mods: store trust levels and vars setup for mods.
    • Agents: the remote runs reattach path (web:runs-attach) and attachExternal.
    • Other: transcription, the Store and cloud sign-in, Blender and auto-update.
    • Fonts: new text layers still default to "SF Pro Display", a Mac font.

Before merging, run bun run test, bun run typecheck and bun run dist:mac on a Mac. Then try tab groups, shortcut labels, MP4 and WebM export, and paste in the agent composer.

Zns-Nexus and others added 6 commits October 14, 2026 05:01
The renderer reaches native code only through the IPC contract in
shared/ipc.ts, so on Windows that contract runs over a loopback WebSocket
(shared/wire.ts framing) to crates/powermove-host instead of Electron's
main process. crates/powermove-windows shows the editor in WebView2 and
builds a per-user NSIS installer. The Mac app does not use either crate.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The Rust host answers web:hello with desktop: true. The bridge then uses native dialogs and the user's own files for open and save, incremental project saves, native fonts and links, and lets Ctrl+V fall through to WebView2's paste so text and images reach the page. The Mac preload and powermove serve keep their behaviour.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
formatShortcut turns Mac glyph labels into Ctrl+Shift+S style labels off macOS; Mac labels are unchanged. Extension cmd+ bindings and selection modifiers accept Ctrl on Windows and Linux.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Panels that share a group key render as tabs in one slot. Drag a header onto another to stack, drag a tab out to split, reorder by dragging. Groups persist with workspaces; saves without group keys load unchanged.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
WebView2 refuses a VideoFrame made from the WebGL canvas, so the exporter falls back to an RGBA copy. Chromium on Windows reports bogus half-window movements right after pointer lock, which sent scrubbed values to their limits; single locked moves larger than a quarter of the window are dropped. The mixer keeps its previous colours when a hidden panel computes none.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Alt+wheel (Option+wheel on Mac) scales every row and track within fixed bounds, keeping the row under the cursor in place. The height is saved per project with the timeline session. Selection gestures also accept Ctrl.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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