Add Windows voice dictation support and authentication fixes#1637
Add Windows voice dictation support and authentication fixes#1637Johannes5 wants to merge 5 commits into
Conversation
Johannes5
commented
Jun 28, 2026
The desktop login endpoint only returns the session token in the response
body when the request Origin is in DESKTOP_AUTH_TOKEN_BODY_ORIGINS. That set
listed the macOS/Linux webview origin (tauri://localhost) and the vite dev
origin, but not the Windows WebView2 origin (http(s)://tauri.localhost). On
Windows the server replied { ok: true } with no token, so the app saved no
session and bounced straight back to the sign-in form.
Add http://tauri.localhost and https://tauri.localhost so email/password
login works from the Windows desktop app.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
isAuthEmailValidationMessage rewrote any auth error mentioning "email" plus
"invalid/input/required/format" into the friendly "Enter a valid email
address" message. Better Auth's credential-failure message ("Invalid email
or password") matches that heuristic, so every failed login with a valid
email was mislabeled as a malformed-email error.
Skip the rewrite when the message mentions password/credential, so genuine
format errors still get the friendly message while bad-credential failures
surface as "Invalid email or password".
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Voice dictation only delivered text on macOS; on Windows complete_voice_dictation errored and dropped the transcript. Implement the Windows path: write the transcript to the clipboard (arboard) and paste it via synthesized Ctrl+V (SendInput), plus a direct Unicode-typing path. Add a 'Text delivery' setting (paste+copy / copy-only / type-only) wired through voice-dictation.ts and the complete_voice_dictation command so users can choose whether dictation lands on the clipboard, the focused field, or both. Bump the desktop app to 0.2.0 so locally built/installed apps aren't replaced by the published auto-updater build during testing; CI sets the real release version. Co-authored-by: Cursor <cursoragent@cursor.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Visual recap — skippedThe visual recap job did not run for this pull request. This is informational only and does not block the PR. Recap skipped for |
There was a problem hiding this comment.
Builder reviewed your changes and found 1 potential issue 🟡
Review Details
This PR adds Windows support for Clips desktop voice dictation delivery, including a new user setting to choose paste+copy, copy-only, or type-only behavior, and updates the Tauri app versioning accordingly. It also fixes desktop email/password sign-in by allowing the Windows WebView2 origins in the desktop token exchange flow and stops rewriting wrong-password errors as malformed-email validation failures.
Overall the implementation is thoughtful and mostly backward-compatible: the auth allowlist change is narrowly scoped, the login error handling fix is appropriate, and the dictation delivery modes are wired cleanly through settings, frontend state, and the Tauri command surface. I’m classifying this as high risk because it touches authentication/session token delivery and OS-level text injection paths.
Key findings
- 🟡 MEDIUM: the new
type-onlymode can silently lose dictated text because it skips the clipboard fallback but still reports success before the async input synthesis actually succeeds. - 🔵 LOW:
copy-onlystill arms the post-paste vocabulary learner even though nothing was inserted into the focused field.
🧪 Browser testing: Will run after this review (PR touches UI code)
| match (mode, strategy) { | ||
| // Type-only never uses the clipboard, so always synthesize the | ||
| // text directly regardless of the per-app paste strategy. | ||
| (TextDeliveryMode::TypeOnly, _) => type_text_unicode(&trimmed, voice_target_bundle_id), |
There was a problem hiding this comment.
🟡 Type-only delivery can silently lose the transcript
In TypeOnly we skip write_clipboard() and still return success before the background CGEvent/SendInput path actually inserts anything. If synthetic input is blocked or focus does not settle in time, the helper only logs the failure, so the dictated text is dropped with no clipboard fallback for the user to recover.
|
Thanks @Johannes5! One comment above looks useful to fix, and just need lint to pass too |