fix: reduce chat typing and cached conversation switching overhead
Keep unchanged history panes and task strips from rerendering during typing, and stabilize message callbacks across cached conversation switches. Preserve streaming updates, scroll positions, drafts, and asynchronous attachment ownership. Add App regressions for render isolation, warm switches, retry, and image recovery. Focused tests, typecheck, and lint passed; the full suite encountered unrelated settings failures. Release note: 减少任务运行时输入和切换已缓存长会话的重复渲染,保留实时输出、滚动位置和会话草稿。
This commit is contained in:
@@ -372,14 +372,24 @@ frame rate, heap measurements and 500KB/1MB scenarios remain unmeasured.
|
||||
|
||||
### PERF-10 Keep-alive 轻量优化
|
||||
|
||||
- **优先级 / 状态:** P2 / 待开始
|
||||
- **实施条件:** `PERF-09` 确认当前缓存不达标。
|
||||
- **优先级 / 状态:** P2 / 已完成输入与热切换渲染隔离,压力测试待完成
|
||||
- **实施依据:** 2026-09-30 的真实 App 组件回归确认输入和热切换会重复渲染缓存内容;
|
||||
`PERF-09` 的 Electron 内存与 GC 压力测试仍待执行。
|
||||
- **范围:**
|
||||
- 优先 memoize 隐藏 `ChatHistoryPane` 并稳定 props。
|
||||
- `ChatHistoryPane`、任务条和 Runtime 清单使用 memo,稳定快捷输入、重试、图片恢复、
|
||||
定时任务回调及任务条 JSX。异步草稿操作仍绑定发起时的会话。
|
||||
- 仍不达标时才调整缓存数量或一小时有效期。
|
||||
- 暂不引入完整虚拟化框架。
|
||||
- **验收:** 内存和 commit 指标改善,同时保留会话切换位置和快速恢复体验。
|
||||
|
||||
`App.test.tsx` 修复前回归记录:运行请求期间连续输入三次,历史面板、任务条、清单各
|
||||
渲染三次,会话迁移存储读取三次;两个已缓存会话往返一次,Markdown 渲染 324 次。
|
||||
长会话已展开 160 条消息,另一会话含一条消息,计数包含展开的推理正文。修复后上述
|
||||
计数均为零。最终用例还覆盖可见且展开的运行中任务条、实时文本与清单更新、停止、
|
||||
会话草稿、图片素材选择期间切换会话,以及滚动位置和推理展开状态保留。
|
||||
这些是 jsdom 中真实 App 的渲染次数,使用 mock preload;尚未测量 Electron 输入延迟、
|
||||
绘制耗时或内存。流式事件未延后,缓存容量和有效期未改变。
|
||||
|
||||
## 8. 体验与可访问性
|
||||
|
||||
### UX-01 统一 Ask/Execute 文案
|
||||
|
||||
Reference in New Issue
Block a user