feat(windows): add Windows cross-platform support#401
Draft
rodrigoluizs wants to merge 21 commits intomainfrom
Draft
feat(windows): add Windows cross-platform support#401rodrigoluizs wants to merge 21 commits intomainfrom
rodrigoluizs wants to merge 21 commits intomainfrom
Conversation
1c42f7a to
3d86011
Compare
Contributor
CI Summary
|
Contributor
✅MegaLinter analysis: Success
See detailed reports in MegaLinter artifacts
|
- app.ts, ipc.ts, shortcuts/manager.ts now import from platform/ - Removed darwin-only guard from launch-at-login - Deleted src/main/input/paster.ts (replaced by platform modules) - Platform loader uses lazy Proxy to avoid test-time require issues
Dynamic template-string require (`./\${os}/paster`) can't be resolved
by Vite/Rollup in bundled builds. Use conditional static string paths
so the bundler includes both platform modules in the bundle.
Replace dynamic require() with static ES imports so Vite/Rollup can resolve both platform modules at build time. Both modules defer native library loads to function call time, making it safe to bundle both.
- Add electron-builder win/nsis config to package.json - Add build-windows job on windows-latest runner - Generate icon.ico from logo.png via ImageMagick in CI - Update release job to download and publish both platforms - Windows code signing via CSC_LINK/CSC_KEY_PASSWORD (optional)
MinGW GCC 15.2 generates AVX code with incorrect stack alignment on Windows, causing segfaults during whisper inference. The official MSVC-compiled release binaries handle AVX correctly. - Add cross-platform postinstall script that downloads pre-built whisper.cpp v1.8.3 binary on Windows (macOS still compiles from source) - Update whisper.ts to use whisper-cli.exe on Windows (the v1.8.3 binary name) - Add scripts/ to ESLint ignores (CJS postinstall script) Performance: 7.4s for 11s audio (vs 200s without AVX, vs segfault with MinGW AVX)
On macOS Metal GPU handles compute so thread count is less critical. On Windows (CPU-only), whisper defaults to 4 threads which wastes available cores. Using 75% of available cores nearly halves inference time on a 16-core system (7.6s -> 4.0s for 11s of audio).
Whisper auto-detection runs the encoder twice (detect + transcribe), doubling latency on CPU. On macOS Metal GPU this is negligible but on Windows it adds ~3s to every transcription. When the user has speech languages configured, use the first one directly instead of auto-detect. The LLM correction layer handles any cross-language artifacts. Before: 13.3s (auto, 4t) → After: ~4s (fixed lang, 12t)
Replace the spawn-per-transcription approach (whisper-cli.exe) with a persistent whisper-server.exe process on non-macOS platforms. The server loads the model once at app launch and accepts audio via HTTP POST on localhost, eliminating the ~500ms model-loading overhead on every transcription. Additionally switches from beam-search decoding (--best-of 5 --beam-size 5) to greedy decoding, saving ~600ms per transcription. The LLM correction layer compensates for any quality difference. - Add WhisperServer class with lifecycle management and HTTP-based readiness polling - Server auto-restarts when the user changes whisper models - Falls back to CLI mode if the server fails to start - macOS keeps the existing CLI approach (Metal GPU makes cold-start negligible) Benchmark (JFK 11s audio, small model, 12 threads): Before: ~4,500ms (CLI + beam search) After: ~3,300ms (server + greedy)
…d default Prefix unused httpRequestHandler variable with underscore to satisfy ESLint no-unused-vars rule. Update win32 paster test to account for finishWithPeriod defaulting to true (period kept unless explicitly false).
a6c6607 to
14ef49d
Compare
Replace stale input/paster mock with platform module mock so tests pass on Linux CI where no platform-specific paster is available.
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
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.

Summary
src/main/platform/module (types, utils, dynamic loader)platform/darwin/user32.dllSendInput API via koffi FFIfinishWithPeriodsupport to platform PasteOptionstitleBarStyleand menu roles for Windows compatibility.exeextension)postinstall-whisper.jsscript to download pre-built whisper.cpp binary for Windowswhisper-serverprocess on non-macOS to eliminate cold-start latencyTest plan
npm run typecheck,npm run lint,npx vitest run