mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-12 23:02:35 +00:00
refac
This commit is contained in:
parent
b1e8c7d2aa
commit
0ad397c048
2 changed files with 11 additions and 2 deletions
|
|
@ -1242,7 +1242,7 @@
|
|||
<!-- Task list display -->
|
||||
{#if chatTasks.length > 0}
|
||||
<div class="mx-1">
|
||||
<TaskList tasks={chatTasks} />
|
||||
<TaskList tasks={chatTasks} done={!generating} />
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,12 +8,21 @@
|
|||
const i18n = getContext('i18n');
|
||||
|
||||
export let tasks: Array<{ id: string; content: string; status: string }> = [];
|
||||
export let done = false;
|
||||
|
||||
let collapsed = false;
|
||||
|
||||
$: completedCount = tasks.filter((t) => t.status === 'completed').length;
|
||||
$: totalCount = tasks.length;
|
||||
$: hasActive = tasks.some((t) => t.status === 'pending' || t.status === 'in_progress');
|
||||
$: inProgressCount = tasks.filter((t) => t.status === 'in_progress').length;
|
||||
$: pendingCount = tasks.filter((t) => t.status === 'pending').length;
|
||||
|
||||
// Hide once all work is effectively done:
|
||||
// - no active tasks at all, OR
|
||||
// - message is done and the only remaining active tasks are in_progress (no pending)
|
||||
$: hasActive =
|
||||
tasks.some((t) => t.status === 'pending' || t.status === 'in_progress') &&
|
||||
!(done && pendingCount === 0 && inProgressCount > 0);
|
||||
</script>
|
||||
|
||||
{#if tasks.length > 0 && hasActive}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue