Refactor AI chat collection process and enhance documentation#478
Merged
Conversation
本次重构全面增强了 AI 聊天记录的采集鲁棒性和一致性,并优化了后台资源管理。 主要改进点包括: 1. 增强了 ChatGPT 收集器,引入了多传次采集缓存机制,支持无缝处理用户滚动和手动回溯等场景。 2. 优化了 DOM 遍历逻辑,使用纯净的、不影响视口的操作获取稳定节点标识。 3. 更新 AI 自动保存规则,将 ChatGPT 和 Google AI Studio 排除在自动保存范围之外(仅支持手动捕获)。 4. 清除了内容控制器的 Deep Research 轮询和水合逻辑,简化了后台资源管理。
更新了 `AGENTS.md`、`README.md` 和 `docs/overview.md`,明确了 ChatGPT 和 Google AI Studio 等使用虚拟化渲染的站点,不适合自动增量采集。 核心调整包括: 1. 官方约定所有此类站点采用“手动保存优先”策略,避免自动采集丢失离屏轮次。 2. 全量历史应通过 collector 的 `prepareManualCapture()` 滚动扫描水合 + 跨扫描收割恢复。 3. 更新了相关的底层配置和代码文档,如 `docs/GENERATION.md` 和 `docs/configuration.md` 的描述, 以保持信息一致性。
精简了消息回合(turn)的查找逻辑,移除了依赖旧 DOM 结构的回退机制,使网页采集更稳定。同时,改进了手动缓存(manual harvest)的键校验流程,确保数据读取的准确性和时时效性。
使用 `useMemo` 钩子缓存了组件中的计算值,包括阅读工具栏的特征计算和侧边大纲组件的渲染。这确保了只有当依赖项实际变化时,对应的值才会重 新计算,从而提升了组件的渲染性能。
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.
No description provided.