Repository navigation
fix(export): 保持增量 HTML 导出的联系人顺序 - #179
Merged
2977094657 merged 1 commit intoOct 7, 2026
Merged
2977094657 merged 1 commit into
2977094657 merged 1 commit into
Conversation
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.
增量导出 HTML 后,内页联系人列表和首页目录会发生重排:更新既有会话时先删除再追加,且基线 JSON 使用
sort_keys=True保存,下一轮读取时会按会话哈希键排列。本次修改保留既有联系人的位置,新增联系人追加到末尾;用基线中的
conversationOrder数组独立保存展示顺序,使反向选择、只更新部分联系人和追加消息都不会改变既有顺序。隐私模式同时保留已分配的匿名会话名称。桌面端和浏览器端会从旧目录的
assets/chat-sessions.js恢复当前可见顺序,并在没有新增消息时也保存排序迁移。目录脚本按 JSON 读取,不执行 JavaScript;无法读取旧目录脚本时仍可继续导出。已经丢失的首次顺序无法仅凭旧版哈希排序基线还原。验证:
test_chat_incremental_export.py、test_chat_export_index_updates.py、test_chat_export_targets.py、test_chat_export_cancel_responsiveness.py、test_chat_export_panel_frontend.py,38 passed,12 subtests passed。覆盖正常/隐私导出、实际追加消息、反向选择、部分更新、新联系人追加、旧目录迁移及浏览器增量补丁。cd frontend && npm test:76 项 Node 测试和 390 项 Vitest 测试全部通过。cd frontend && npm run build:生产构建通过。git diff --check通过。