feat: UI/UE enhancement — streaming, sticky header, hover actions, calendar tokens #13
Loading…
Reference in New Issue
No description provided.
Delete Branch "feat/ui-ue-enhancement"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
为 agentkit 聊天界面引入流式 token 输出、粘性模式头部、消息悬停操作与日历配色重设计。专家团队讨论/综合过程现在逐 token 流式呈现,PhaseIndicator 保持独立显示,用户气泡支持 hover 复制/删除/重填。修复了两项 P0 流式 bug(WS 事件白名单缺失、final_answer 双重累积)。
Changes
U1 — ThinkingBlock 流式光标
U2 — StickyModeHeader
U3 — 后端流式事件转发
_execute_phase_stream,调用execute_stream()并转发token/thinking/final_answer事件emit_team_event广播expert_result_chunk/expert_result_chunk_reset给前端U4 — 前端 chatStream token 累积
expert_result_chunk/team_synthesis_chunk事件,逐 token 拼接到 streaming 消息[...messages].reverse().find()重构为findLastMessagehelper,避免 per-token 热路径的数组分配U5 — AssistantText 路由标签
U6 — UserBubble 悬停操作
U7 — CalendarGrid 配色重设计
Review fixes (ce-code-review)
应用 3 项 review 修复:
_VALID_TEAM_EVENT_TYPES白名单新增expert_result_chunk/expert_result_chunk_reset/team_synthesis_chunk3 个流式事件类型 — 否则emit_team_event静默丢弃,整个 U3/U4 功能失效final_answer不再accumulated.append(output)— ReActEngine 先发 token(增量)再发 final_answer(全文),双重累积导致前端内容翻倍。token 已累积时 final_answer 仅作完成信号;无 token 时(如_wrap_sync_as_streamfallback)用 output 兜底except (RuntimeError, asyncio.TimeoutError, ConnectionError)扩展为except Exception— 否则LLMProviderError/ConfigValidationError等穿透导致前端 streaming 卡死。asyncio.CancelledError(Python 3.8+ 继承 BaseException)已被上方 except 捕获Simplification (ce-simplify-code)
_concat_results静态方法消除 2 处重复_handle_*_streamfallback 方法合并为 1 个通用_wrap_sync_as_stream[...messages].reverse().find()→findLastMessagehelperTest plan
test_final_answer_fallback_when_no_tokens/test_final_answer_not_forwarded_as_chunk验证 ReActEngine 流式合约Validation
无 running server 可用,浏览器测试改用 vitest 组件测试替代。手动验证范围:
_phase_executor流式事件序列通过 pytest mock 验证:token → final_answer → expert_result_chunk 广播顺序符合合约emit_team_event对 3 个新事件类型不再静默丢弃findLastMessage等价于原[...].reverse().find()语义(5 处替换 + vitest 126/127 通过)Known residuals
未应用的 review findings 记录在 docs/residual-review-findings/feat-ui-ue-enhancement.md,含 4 项 actionable(P1 expert_step payload / P2 CancellationToken / P2 synthesis 孤儿线程 / P2 synthesis 占位匹配)和 9 项 advisory。建议在后续 PR 处理。
Related