Skip to content

Add Windows voice dictation support and authentication fixes#1637

Open
Johannes5 wants to merge 5 commits into
BuilderIO:mainfrom
Johannes5:fix/windows-desktop-auth
Open

Add Windows voice dictation support and authentication fixes#1637
Johannes5 wants to merge 5 commits into
BuilderIO:mainfrom
Johannes5:fix/windows-desktop-auth

Conversation

@Johannes5

Copy link
Copy Markdown
Contributor
### Summary

This pull request introduces several improvements:

- **Windows Voice Dictation**: 
  - Implements support for voice dictation text delivery on Windows.
  - Adds a configurable 'Text delivery' setting (paste+copy / copy-only / type-only).
  - Updates desktop app version to 0.2.0 for local testing.

- **Authentication Fixes**:
  - Corrects email/password login behavior by allowing the Windows Tauri webview origin for desktop authentication tokens.
  - Fixes issue where failed login attempts could incorrectly report an invalid email address.

- **Additional Changes**:
  - Updates `.gitignore` to exclude JetBrains `.idea` folder.
  - Includes minor chore for Windows-specific desktop authentication.

### Checklist

- [ ] Tests have been added or updated where necessary.
- [ ] Documentation has been updated to reflect the changes.
- [ ] New configurations have been properly implemented and tested.
- [ ] Code changes follow best practices and coding standards.

Johannes5 and others added 5 commits June 28, 2026 08:50
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>
@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

Visual recap — skipped

The visual recap job did not run for this pull request. This is informational only and does not block the PR.

Recap skipped for 0ea4413: external fork PR requires a maintainer to apply the recap label to the current head SHA.

@builder-io-integration builder-io-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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-only mode can silently lose dictated text because it skips the clipboard fallback but still reports success before the async input synthesis actually succeeds.
  • 🔵 LOW: copy-only still 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),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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.

Fix in Builder

@steve8708

Copy link
Copy Markdown
Contributor

Thanks @Johannes5! One comment above looks useful to fix, and just need lint to pass too

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