feat: v0.7.0 四阶段全量迭代 — 修复面收口 · 安全纵深 · 架构还债 · 能力演进
P1 修复面收口: v0.6.3 截断自愈推全量(Anthropic/Ollama/非流式/引擎兜底); SSE 上游错误帧检测进重试通道; clearMessages 摘要游标根治; truncateResult 内联图片白名单统一; 前端四 bug(确认弹窗锁死/MemoryViewer/ Virtuoso Footer/abort 尾部过滤) + reasoning 缓冲跨迭代污染; 托盘通知过滤与新建会话死链接线 P2 安全纵深: MCP 审批闭环(ConfirmationHook×PolicyEngine 联动+重名拒注册); SSRF 收敛 ssrf-guard 共享模块 (web_fetch 双通道校验+重定向终态复检); Electron 加固(preload CJS 化→sandbox:true/CSP/权限白名单/will-navigate); run_command cmd.exe 白名单通道元字符守门; diff_viewer 10MB 预检; Anthropic thinking 预算下限; Agnes 思考显式关闭 P3 架构还债: OpenAICompatibleAdapter 中间基类收敛四家样板; 错误分类单轨化(删 mapError/getFetchSignal, 超时显式 ETIMEDOUT); PRAGMA user_version 迁移版本化; 死代码清理专项(cn.ts/SHORTCUTS/ContextMenu 分支/ getWindowState/modifiedArgs/sandbox 空壳); i18next 引入; a11y 第一轮; SearXNG 页批量草稿模型统一 P4 能力演进: Ollama pull 可取消/capabilities 探测/num_ctx 实测缓存; UpdateService feed 比对式自动更新 (app:updateCheck IPC + StatusBar 入口); MiMo providerOptions(web_search 服务端工具/strict JSON); web_fetch extract_mode=markdown(turndown); network.proxyUrl 全局代理(Chromium sessions+undici dispatcher) 测试: 264 → 507 用例(Electron ABI 全绿零跳过), 覆盖引擎压缩管线/重试竞速/MEMORY.md 闸门/file_editor 五操作/ filesystem 七工具实体夹具/git 真实仓库/SSE 错误帧/全线截断自愈/Provider 请求形态矩阵/SSRF 表测/钩子分级矩阵/ OutputValidator 全量/SLO 指标/MCP 安全纯函数/task_manager 链路/渲染层纯域/i18n 桥契约
This commit is contained in:
@@ -18,6 +18,18 @@ import { useAgentStore } from '@renderer/stores/agent-store';
|
||||
import { MessageItem } from './MessageItem';
|
||||
import { StreamingIndicator } from './StreamingIndicator';
|
||||
|
||||
/**
|
||||
* v0.6.4 修复: Virtuoso components.Footer 必须是稳定引用 —— 原实现每次 render
|
||||
* 都传入新的内联匿名组件,react-virtuoso 按组件类型做 reconciliation,类型变化
|
||||
* 导致 Footer(内含 StreamingIndicator)被整体卸载重建、动画状态反复重置。
|
||||
* 提升为模块级常量组件后引用恒定,Footer 仅挂载一次。
|
||||
*/
|
||||
const ListFooter = (): React.JSX.Element => (
|
||||
<Box sx={{ maxWidth: 768, mx: 'auto', px: 2, pb: 3 }}>
|
||||
<StreamingIndicator />
|
||||
</Box>
|
||||
);
|
||||
|
||||
export function MessageList(): React.JSX.Element {
|
||||
const messages = useAgentStore((s) => s.messages);
|
||||
const isStreaming = useAgentStore((s) => s.isStreaming);
|
||||
@@ -65,7 +77,16 @@ export function MessageList(): React.JSX.Element {
|
||||
}
|
||||
|
||||
return (
|
||||
<Virtuoso
|
||||
<Box
|
||||
// v0.6.4 P3-6 a11y: 消息区声明为 live region —— 屏幕阅读器可感知流式增量
|
||||
// 与新消息到达(此前流式输出对辅助技术完全静默)。role="log" 表明追加语义。
|
||||
component="section"
|
||||
role="log"
|
||||
aria-live="polite"
|
||||
aria-label="聊天消息列表"
|
||||
sx={{ height: '100%', display: 'flex', flexDirection: 'column', minHeight: 0 }}
|
||||
>
|
||||
<Virtuoso
|
||||
ref={virtuosoRef}
|
||||
// key=sessionId: 切换会话时强制重新挂载,使 initialTopMostItemIndex 重新生效
|
||||
// (定位到新会话的最后一条消息;同会话内 messages 变化不触发 remount)
|
||||
@@ -90,12 +111,9 @@ export function MessageList(): React.JSX.Element {
|
||||
</Box>
|
||||
)}
|
||||
components={{
|
||||
Footer: () => (
|
||||
<Box sx={{ maxWidth: 768, mx: 'auto', px: 2, pb: 3 }}>
|
||||
<StreamingIndicator />
|
||||
</Box>
|
||||
),
|
||||
Footer: ListFooter,
|
||||
}}
|
||||
/>
|
||||
/>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user