From d559a4624efb3cf5688a3df03a77f90999c42233 Mon Sep 17 00:00:00 2001
From: 简律纯 <i@jyunko.cn>
Date: Wed, 14 Jan 2026 13:50:25 +0800
Subject: feat: Consider incorporating totalDownloadedBytes into the
 calculation for a smoother progress indicator

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---
 ui/src/lib/DownloadMonitor.svelte | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'ui/src/lib/DownloadMonitor.svelte')

diff --git a/ui/src/lib/DownloadMonitor.svelte b/ui/src/lib/DownloadMonitor.svelte
index e4920ad..5dc8269 100644
--- a/ui/src/lib/DownloadMonitor.svelte
+++ b/ui/src/lib/DownloadMonitor.svelte
@@ -72,7 +72,9 @@
         completedFiles = payload.completed_files;
         totalFiles = payload.total_files;
         if (totalFiles > 0) {
-          totalProgress = (completedFiles / totalFiles) * 100;
+          const currentFileFraction =
+            payload.total > 0 ? payload.downloaded / payload.total : 0;
+          totalProgress = ((completedFiles + currentFileFraction) / totalFiles) * 100;
         }
 
         // Calculate download speed (using moving average)
-- 
cgit v1.2.3-70-g09d2

