【已审核】fix(agent): 后台任务运行时显示视觉提示#1025
Open
climashscape wants to merge 1 commit into
Open
Conversation
backgroundWaiting 状态下用户无法区分 Agent 是彻底完成还是在后台跑任务, 容易误切走或发新消息打断进度。 - agent-atoms.ts: agentSessionIndicatorMapAtom 纳入 backgroundWaiting, 映射为 'running',侧边栏指示点显示蓝色脉冲(与 running 同态) - tab-atoms.ts: tabStreamingMapAtom 改派生自 indicator map, Tab 标题通过 showAgentSpinner 显示 spinner - AgentView.tsx: 输入区 trailing 在 backgroundWaiting 且无输入文本时 显示 '后台任务运行中' 蓝色徽标;用户开始输入后让出位置给 Send 按钮, 保证后台任务期间可正常发新消息(走注入通道) - 清理死代码:删除 agentRunningSessionIdsAtom(改用 indicator map 后无消费者) 改动文件: - apps/electron/src/renderer/atoms/agent-atoms.ts - apps/electron/src/renderer/atoms/tab-atoms.ts - apps/electron/src/renderer/components/agent/AgentView.tsx (+24/-14 行)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
修复 Agent 后台任务(backgroundWaiting)运行期间 UI 显示为"已完成"状态的问题。原实现中
agentSessionIndicatorMapAtom未覆盖backgroundWaiting,导致侧边栏指示点变灰、Tab 标题无 spinner、输入区显示 Send 按钮——与 Agent 彻底跑完后无法区分,用户易误切走或发新消息打断后台进度。改动
apps/electron/src/renderer/atoms/agent-atoms.ts(+9/-6)agentSessionIndicatorMapAtom纳入backgroundWaiting,映射为'running',侧边栏指示点显示蓝色脉冲(与 running 同态)agentRunningSessionIdsAtom(改用 indicator map 后无消费者)apps/electron/src/renderer/atoms/tab-atoms.ts(+3/-3)tabStreamingMapAtom改派生自 indicator map,Tab 标题通过showAgentSpinner显示 spinnerapps/electron/src/renderer/components/agent/AgentView.tsx(+16/-1)backgroundWaiting且无输入文本时显示"后台任务运行中"蓝色徽标测试
bun run typecheck通过bun run dev启动应用紧急度
中
备注
Closes #1013