Files
cc-web/.planning/history-message-recall/findings.md
2026-09-11 09:29:53 +08:00

15 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 历史消息回看发现
## 初始状态
- 用户看到提示:“历史消息过多,cc-web 已只保留最近 45 条用于本地展示,省略 50 条旧消息。”
- 用户明确要求:旧消息可以默认隐藏,但必须有办法查看前面的内容。
## 代码证据
- `server.js:sanitizeMessagesForPersist` 生成用户看到的中文裁剪提示;它只影响持久化快照的展示内容。
- `server.js:handleLoadSession` 已将历史拆成最近窗口和 `olderChunks`,并发送 `historyTotal/historyCursor/historyTruncated/historyPending` 元数据。
- `server.js:handleLoadHistoryPage` 已存在按 `before` 和 `HISTORY_CHUNK_SIZE` 读取历史页的 WebSocket 入口,但当前固定返回 `remaining: 0`,需要确认前端是否能继续请求及服务端是否正确维护游标。
- `public/app.js` 已存在 `prependHistoryMessages`,说明“前置插入旧消息”的渲染能力已有;还需要核对 `session_history_chunk` 处理、入口文案和重复/边界状态。
- 计划审查指出验收必须明确:默认仍只渲染最近窗口、入口可操作、可连续查看旧消息、顺序和角色正确,并覆盖失败/重复点击/并发新消息等边界。