Port the Windows build: complete the hotkey surface, real pill controls - #1
Merged
Merged
Conversation
The Windows layer (cfg(target_os=windows), never compiled until now) was missing the symbols lib.rs calls via hotkey::. Add them mirroring the macOS surface: - models_dir/model_path with language-aware model selection (honours Settings.whisper_model, otherwise picks .en variants for English and multilingual ggml-*.bin otherwise) - read_openai_key/read_anthropic_key via env var or keyring - real ui_start/ui_stop/ui_cancel/trigger_hands_free wired to the hook thread's on_ptt_* handlers (no more empty stubs) - LAST_BAR + last_bar remembered in emit_bar - make rebuild_asr pub - fix the Windows re-export to match the macOS export list Verified: cargo check --target x86_64-pc-windows-gnu -j1 (in src-tauri), cargo check --workspace -j1, cargo test --workspace -j1. The Cargo.lock is synced to the 1.0.0 version bump from ed09182.
Windows CI modeled on build-macos.yml: builds the whimpr-llm-worker sidecar for x86_64-pc-windows-msvc, stages it into src-tauri/binaries, runs cargo check/test across the workspace, and builds the frontend so the Tauri app bundles. Runs on pull_request to gate the Windows port.
icon_as_template(true) is macOS-only in Tauri v2 and would panic at startup on Windows. Apply the template only on macOS; other platforms just set the full-color icon. Runtime fix identified in Phase 3.
The macOS-only PushToTalkKey concept (Fn / Globe, Right Command, Right Option) leaked into the Windows settings UI: the default is 'fn', but the Windows keyboard hook only implements Right Control (PTT_VK). The setting was ignored on Windows, so the app advertised a key that did nothing while only Right Control worked. Normalize push_to_talk_key to RightControl on load and on save so every reader (settings pane, onboarding, FlowBar, history) shows the key the hook actually responds to. Fix found during the Phase 3 Windows runtime pass (issue #7).
skibkitty
marked this pull request as ready for review
September 7, 2026 22:52
Owner
|
Thanks for this — merged with one small fix on top (the default PTT fallback in FlowBar was hardcoded to Solid work all around. The |
Author
|
preem, glad to see it! |
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
The Windows platform layer (
src-tauri/src/win.rs,cfg(target_os = "windows")) has never compiled — it was written on macOS and was missing the symbolslib.rscalls viahotkey::. This PR makes the Windows build compile, matching the macOS surface.This is the README-described "Windows built but untested" state (see
CHANGELOG-FORK.md: "the Windows layer in src-tauri/src/win.rs has not been updated and will need the same functions added before it compiles again"). It compiles now; runtime correctness on a real Windows machine is the follow-up.Changes
src-tauri/src/win.rs— added the missing symbol surface, mirroring the macOShotkey.rs::impimplementations:models_dir()/model_path()— language-aware model selection: honoursSettings.whisper_modelfirst, otherwise picks the best installed model for the configured language (.envariants for English, multilingualggml-*.binotherwise) — previously non-English users silently got an English-only modelread_openai_key()/read_anthropic_key()— env var or OS keyring (sameread_keyhelper as macOS)rebuild_asr→pub(was private, not re-exported)ui_start/ui_stop/ui_cancel/trigger_hands_free— real handlers wired to the keyboard-hook thread'son_ptt_down/on_ptt_up/abort path. The pill's Start / ■ / ✕ / hands-free hotkey now actually do something instead of being empty stubsLAST_BARstatic +last_bar()recorded inemit_bar, sosync_pill_visibilitycan restore the right pill statesrc-tauri/src/hotkey.rs— the Windows re-export now matches the macOS export list exactly (previously it exported deadstop_dictation/cancel_dictationstubs and missedlast_bar,models_dir,model_path, the two key reads,rebuild_asr, and the pill controls).Cargo.lock— synced the workspace crates to the1.0.0version bump already onmain(ed09182), which the lockfile hadn't picked up.Verification
cargo check --target x86_64-pc-windows-gnu -j1insrc-tauri/— passes (first compile of this module)cargo check --workspace -j1(Linux) — passescargo test --workspace -j1— all passFollow-up (not in this PR)
.icon_as_template(true)call (lib.rs:1327) is macOS-only in Tauri v2 and will need a cfg guard; push-to-talk, paste, pill controls, whisper download/load under%APPDATA%\WhimprFlowChecked on this machine: local pip/Windows cross-check only. CI is the authoritative Windows gate.