Fix NaN% in sidecar download progress
All checks were successful
Tests / Python Backend Tests (push) Successful in 6s
Tests / Frontend Tests (push) Successful in 8s
Tests / Rust Sidecar Tests (push) Successful in 2m4s

The Rust backend emits {downloaded, total, phase, message} but the
Svelte component was reading event.payload.progress which doesn't
exist, resulting in NaN. Now calculates percentage from downloaded/total.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Developer
2026-04-08 09:06:39 -07:00
parent ec8922672c
commit d8b7811153

View File

@@ -36,11 +36,12 @@
try { try {
// Listen for progress events from the Tauri backend // Listen for progress events from the Tauri backend
unlisten = await listen<{ progress: number; message: string }>( unlisten = await listen<{ downloaded: number; total: number; phase: string; message: string }>(
"sidecar-download-progress", "sidecar-download-progress",
(event) => { (event) => {
progress = event.payload.progress; const { downloaded, total, message } = event.payload;
progressMessage = event.payload.message; progress = total > 0 ? (downloaded / total) * 100 : 0;
progressMessage = message;
} }
); );