Skip to content

feat(windows): add build config and stub dictation#114

Merged
Dimillian merged 6 commits intoDimillian:mainfrom
blueberrycongee:win-compat
Jan 19, 2026
Merged

feat(windows): add build config and stub dictation#114
Dimillian merged 6 commits intoDimillian:mainfrom
blueberrycongee:win-compat

Conversation

@blueberrycongee
Copy link
Contributor

Summary

This PR adds opt-in Windows build support while keeping existing macOS behavior unchanged. Default scripts (npm run tauri:dev, npm run tauri:build) and src-tauri/tauri.conf.json remain unchanged; Windows uses a separate config + scripts.

Motivation

On Windows, the app currently fails to build/package due to:

  • macOS-specific window settings (overlay/transparent/effects) not mapping cleanly to Windows/WebView2
  • whisper-rs pulling in bindgen which requires libclang (not present by default on Windows toolchains)

This PR makes Windows builds possible without adding new requirements like LLVM/Clang.

What changed

  • Windows-only Tauri config override: src-tauri/tauri.windows.conf.json
    • Disables macOS-only window effects/overlay/transparent
    • Sets bundle.createUpdaterArtifacts=false for Windows config to avoid failing local builds due to missing TAURI_SIGNING_PRIVATE_KEY
  • Windows-only build entrypoints (additive; macOS scripts unchanged): package.json
    • doctor:win
    • tauri:dev:win
    • tauri:build:win
  • Dictation is disabled on Windows builds (compile-time only)
    • whisper-rs, cpal, sha2 dependencies are now non-Windows target deps in src-tauri/Cargo.toml
    • src-tauri/src/dictation_stub.rs implements the same command surface but returns a clear “not supported on Windows” error
    • src-tauri/src/lib.rs selects real dictation vs stub via cfg(target_os="windows")

How to test

Windows

  • npm install
  • npm run tauri:build:win (or npm run tauri:dev:win)

macOS (no behavior change expected)

  • npm install
  • npm run tauri:build (or npm run tauri:dev)

Notes / limitations

  • Dictation/Whisper is not available on Windows in this PR (avoids requiring libclang/LLVM). If we want Windows dictation later, we can revisit with a dedicated feature flag or prebuilt bindings.
  • This PR is intentionally scoped to “make native Windows packaging possible”. It does not implement remote backend mode (RFC: Optional remote backend mode (WSL2 daemon / native Windows UI) #54), but it helps establish a baseline for native Windows UI work.

Files changed

  • package.json
  • scripts/doctor.mjs
  • src-tauri/tauri.windows.conf.json
  • src-tauri/Cargo.toml
  • src-tauri/src/lib.rs
  • src-tauri/src/dictation_stub.rs

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 589db7b47d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@blueberrycongee
Copy link
Contributor Author

  • macOS private APIs: tauri is now target-gated in src-tauri/Cargo.toml (macOS enables macos-private-api, non-macOS keeps features empty) so app.macOSPrivateApi: true remains supported without impacting Windows.
  • Windows dictation stub: added a safety wrapper in src/features/dictation/hooks/useHoldToDictate.ts to avoid unhandled promise rejections when dictation calls reject (Windows stub or runtime failures). Errors are still surfaced via dictation events.
  • Docs: added opt-in Windows build instructions + artifact locations and noted that dictation is currently disabled on Windows to avoid requiring LLVM/libclang for whisper-rs/bindgen (README.md).

@Dimillian
Copy link
Owner

Some CI failure

error: failed to run custom build command for `codex-monitor v0.1.0 (/Users/runner/work/CodexMonitor/CodexMonitor/src-tauri)`

Caused by:
  process didn't exit successfully: `/Users/runner/work/CodexMonitor/CodexMonitor/src-tauri/target/debug/build/codex-monitor-10d23dad12e35e1f/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-env-changed=TAURI_CONFIG
  cargo:rustc-check-cfg=cfg(desktop)
  cargo:rustc-cfg=desktop
  cargo:rustc-check-cfg=cfg(mobile)
  cargo:rerun-if-changed=/Users/runner/work/CodexMonitor/CodexMonitor/src-tauri/tauri.conf.json
  cargo:rustc-env=TAURI_ANDROID_PACKAGE_NAME_APP_NAME=codexmonitor
  cargo:rustc-env=TAURI_ANDROID_PACKAGE_NAME_PREFIX=com_dimillian
  cargo:rustc-check-cfg=cfg(dev)
  cargo:rustc-cfg=dev

        The `tauri` dependency features on the `Cargo.toml` file does not match the allowlist defined under `tauri.conf.json`.
        Please run `tauri dev` or `tauri build` or add the `macos-private-api` feature.
      
warning: build failed, waiting for other jobs to finish...
Error: Process completed with exit code 101.

@Dimillian
Copy link
Owner

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. 👍

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Dimillian Dimillian merged commit c67d2ea into Dimillian:main Jan 19, 2026
2 checks passed
gersmann pushed a commit to gersmann/codex-monitor-web that referenced this pull request Mar 10, 2026
Co-authored-by: Thomas Ricouard <ricouard77@gmail.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.

2 participants