From e358123b228e4ccb94a942076763ff9c34dcadd4 Mon Sep 17 00:00:00 2001 From: Levi Date: Mon, 14 Sep 2026 10:02:19 +0800 Subject: [PATCH] fix(flutter): keep waiting task progress static --- ui/flutter/lib/features/tasks/domain/task_record.dart | 2 +- .../tasks/presentation/widgets/task_card/task_card_desktop.dart | 2 +- .../tasks/presentation/widgets/task_card/task_card_mobile.dart | 2 +- .../lib/features/tasks/presentation/widgets/task_file_tree.dart | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/flutter/lib/features/tasks/domain/task_record.dart b/ui/flutter/lib/features/tasks/domain/task_record.dart index 47aa0cd4..45486a91 100644 --- a/ui/flutter/lib/features/tasks/domain/task_record.dart +++ b/ui/flutter/lib/features/tasks/domain/task_record.dart @@ -110,7 +110,7 @@ class TaskRecord { bool get canUpdateUrl => protocol == api_task.Protocol.http && (status == TaskStatus.paused || status == TaskStatus.failed); - bool get isIndeterminate => status == TaskStatus.downloading && total == null; + bool get isIndeterminate => status == TaskStatus.downloading && !waiting && total == null; TaskAssetType get assetType => _assetType(name, isFolder: isFolder, protocol: protocol); diff --git a/ui/flutter/lib/features/tasks/presentation/widgets/task_card/task_card_desktop.dart b/ui/flutter/lib/features/tasks/presentation/widgets/task_card/task_card_desktop.dart index 480531ee..004092bd 100644 --- a/ui/flutter/lib/features/tasks/presentation/widgets/task_card/task_card_desktop.dart +++ b/ui/flutter/lib/features/tasks/presentation/widgets/task_card/task_card_desktop.dart @@ -225,7 +225,7 @@ class _ProgressContent extends StatelessWidget { fillColor: fillColor, highlightStartColor: fillColor, highlightEndColor: fillColor, - shimmer: task.status == TaskStatus.downloading, + shimmer: task.status == TaskStatus.downloading && !task.waiting, ), const SizedBox(height: 6), TaskCardFooter(task: task, isError: isError), diff --git a/ui/flutter/lib/features/tasks/presentation/widgets/task_card/task_card_mobile.dart b/ui/flutter/lib/features/tasks/presentation/widgets/task_card/task_card_mobile.dart index 59af346f..8724f0d0 100644 --- a/ui/flutter/lib/features/tasks/presentation/widgets/task_card/task_card_mobile.dart +++ b/ui/flutter/lib/features/tasks/presentation/widgets/task_card/task_card_mobile.dart @@ -149,7 +149,7 @@ class _TaskCardMobileState extends State { fillColor: fillColor, highlightStartColor: fillColor, highlightEndColor: fillColor, - shimmer: task.status == TaskStatus.downloading, + shimmer: task.status == TaskStatus.downloading && !task.waiting, ), const SizedBox(height: 6), TaskCardFooter(task: task, isError: task.status == TaskStatus.failed), diff --git a/ui/flutter/lib/features/tasks/presentation/widgets/task_file_tree.dart b/ui/flutter/lib/features/tasks/presentation/widgets/task_file_tree.dart index 88745fc6..9953f394 100644 --- a/ui/flutter/lib/features/tasks/presentation/widgets/task_file_tree.dart +++ b/ui/flutter/lib/features/tasks/presentation/widgets/task_file_tree.dart @@ -145,7 +145,7 @@ class _TaskDownloadProgress extends StatelessWidget { key: const ValueKey('task-files-total-progress'), value: progress, indeterminate: runtime == null && task.isIndeterminate, - shimmer: task.status == TaskStatus.downloading, + shimmer: task.status == TaskStatus.downloading && !task.waiting, height: 4, trackColor: palette.progressTrack, fillColor: palette.brandProgress,