Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(bots): 主力电脑上的群任务实时卡不再显示发出时的旧状态行

Chrisc5f1685727dd
diff --git a/apps/desktop/src/renderer/features/bots/BotGroupTaskCard.tsx b/apps/desktop/src/renderer/features/bots/BotGroupTaskCard.tsx
index 0b607ad8a7..7142b40aca 100644
--- a/apps/desktop/src/renderer/features/bots/BotGroupTaskCard.tsx
+++ b/apps/desktop/src/renderer/features/bots/BotGroupTaskCard.tsx
@@ -28,14 +28,18 @@ export function BotGroupTaskCard({ task, owned, botId }: { task: BotGroupTaskCar
>
<ListTodo size={14} aria-hidden className="mt-[5px] shrink-0 text-[var(--text-tertiary)]" />
<div className="flex min-w-0 flex-1 flex-col gap-0.5">
+ {/* Live: the link's own status icon follows the task; the state the card was posted with
+ would go stale (still 「等你确认」 after the answer), so it shows only on a snapshot. */}
{live ? (
<BotSessionTaskLink card={task.meta} sessionId={task.meta.parentSessionId ?? undefined} />
) : (
- <span className="truncate text-14 leading-6 text-[var(--text-primary)]">{task.title}</span>
+ <>
+ <span className="truncate text-14 leading-6 text-[var(--text-primary)]">{task.title}</span>
+ <span className="min-w-0 break-words text-12 leading-5 text-[var(--text-tertiary)]">
+ {task.state === 'waiting' && task.summary ? `${state} · ${task.summary}` : state}
+ </span>
+ </>
)}
- <span className="min-w-0 break-words text-12 leading-5 text-[var(--text-tertiary)]">
- {task.state === 'waiting' && task.summary ? `${state} · ${task.summary}` : state}
- </span>
</div>
</div>
);
diff --git a/apps/desktop/src/renderer/features/bots/__tests__/BotGroupTaskCard.test.tsx b/apps/desktop/src/renderer/features/bots/__tests__/BotGroupTaskCard.test.tsx
index 9e7c0e97f7..e5b1257e33 100644
--- a/apps/desktop/src/renderer/features/bots/__tests__/BotGroupTaskCard.test.tsx
+++ b/apps/desktop/src/renderer/features/bots/__tests__/BotGroupTaskCard.test.tsx
@@ -50,9 +50,10 @@ describe('BotGroupTaskCard', () => {
});
it('shows my own teammate\'s task as the live link', () => {
- render(<BotGroupTaskCard task={task('started')} owned botId="bot-a" />);
+ render(<BotGroupTaskCard task={task('waiting', 'Which audience?')} owned botId="bot-a" />);
expect(screen.getByTestId('live-link')).toBeTruthy();
- expect(screen.getByTestId('bot-group-task').textContent).toContain('state:started');
+ // The posted state would go stale once the task moves on; the live link shows its own status.
+ expect(screen.getByTestId('bot-group-task').textContent).not.toContain('state:waiting');
});
it('shows my own teammate\'s task live on its home computer', () => {