fix: comprehensive Windows support, event system fix, and UX improvements#457
Open
BruceChenZebra wants to merge 1 commit intowinfunc:mainfrom
Open
fix: comprehensive Windows support, event system fix, and UX improvements#457BruceChenZebra wants to merge 1 commit intowinfunc:mainfrom
BruceChenZebra wants to merge 1 commit intowinfunc:mainfrom
Conversation
## Windows Platform Fixes - Fix Tauri event system: replace `require()` with ES `import` for `@tauri-apps/api/event` — `require()` fails silently in Vite ESM builds, causing all Tauri IPC events to fall back to DOM listeners that never receive backend messages. This was the root cause of the chat "spinning forever" bug on all platforms using production builds. - Add `withGlobalTauri: true` to tauri.conf.json for reliable `window.__TAURI__` availability. - Add `CREATE_NO_WINDOW` (0x08000000) flag to all subprocess spawns on Windows to prevent console windows from flashing when launching claude, `where.exe`, or other CLI tools. Introduces `hidden_command()` helper in claude_binary.rs. - Set `stdin(Stdio::null())` on Claude subprocess to prevent 3-second stdin wait timeout. - Disable transparent window rendering (`transparent: false`) which causes severe performance issues with WebView2 on Windows. - Add `nsis` and `msi` to bundle targets for Windows installer generation. ## Image Support - Add image sending support via `--input-format stream-json` with stdin pipe. When prompts contain `@"data:image/..."` references, automatically switch from `-p` flag to stdin-based content blocks with proper base64 image data. - Works across all entry points: execute, continue, and resume commands. ## UX Improvements - Show `[Image #N]` placeholder + thumbnail in input box instead of raw base64. - Collapse long pasted text (>10 lines) as `[Pasted text +XX lines]` with expandable preview in message display. - Remove duplicate content in result messages — "Execution Complete" card now only shows metadata (cost, duration, tokens) since the assistant message above already displays the response text. - Suppress console.log/debug output in production builds to reduce overhead. - Wrap all Rust `println!` in web_server.rs with `trace_log!` macro that only prints in debug builds. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
This PR fixes critical issues that prevent opcode from working properly on Windows, along with several UX improvements.
Critical Fixes
require("@tauri-apps/api/event")with ESimport—require()fails silently in Vite ESM production builds, causing ALL Tauri IPC events to fall back to DOM listeners that never receive backend messages. This is the root cause of the chat "spinning forever" bug.withGlobalTauri: truetotauri.conf.jsonfor reliablewindow.__TAURI__availability.CREATE_NO_WINDOWflag to all subprocess spawns (where.exe,claude --version, chat sessions, agents, process management). Introduceshidden_command()helper.stdin(Stdio::null())on Claude subprocess to prevent 3-second stdin timeout.transparent: falsefixes severe WebView2 rendering performance issues on Windows.nsisandmsifor proper Windows installer generation.New Features
--input-format stream-jsonwith stdin pipe. Automatically detects@"data:image/..."references and constructs proper base64 content blocks. Works across execute, continue, and resume commands.[Image #N]+ thumbnail in text input instead of raw base64 data.▶ [Pasted text +XX lines]with expandable preview.UX Improvements
console.logsuppressed in prod builds; Rustprintln!wrapped intrace_log!macro (debug-only).Test plan
[Image #N]in input box🤖 Generated with Claude Code