Fix IPC stdout corruption, dark window background, overlay timing
- Redirect sys.stdout to stderr in Python sidecar so library print() calls don't corrupt the JSON-line IPC stream - Save real stdout fd for exclusive IPC use via init_ipc() - Skip non-JSON lines in Rust reader instead of failing with parse error - Set Tauri window background color to match dark theme (#0a0a23) - Add inline dark background on html/body to prevent white flash - Use Svelte tick() to ensure progress overlay renders before invoke - Improve ProgressOverlay with spinner, better styling, z-index 9999 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -107,8 +107,9 @@ impl SidecarManager {
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
// Non-ready message: something is wrong
|
||||
break;
|
||||
// Non-JSON or non-ready line — skip and keep waiting
|
||||
eprintln!("[sidecar-rs] Skipping pre-ready line: {}", &trimmed[..trimmed.len().min(200)]);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
Err("Sidecar did not send ready message".to_string())
|
||||
@@ -160,8 +161,14 @@ impl SidecarManager {
|
||||
if trimmed.is_empty() {
|
||||
continue;
|
||||
}
|
||||
let response: IPCMessage = serde_json::from_str(trimmed)
|
||||
.map_err(|e| format!("Parse error: {e}"))?;
|
||||
// Skip non-JSON lines (library output that leaked to stdout)
|
||||
let response: IPCMessage = match serde_json::from_str(trimmed) {
|
||||
Ok(msg) => msg,
|
||||
Err(_) => {
|
||||
eprintln!("[sidecar-rs] Skipping non-JSON line: {}", &trimmed[..trimmed.len().min(200)]);
|
||||
continue;
|
||||
}
|
||||
};
|
||||
|
||||
if response.msg_type == "progress" {
|
||||
on_progress(&response);
|
||||
|
||||
Reference in New Issue
Block a user