Repository navigation
feat(history): 全部会话导出成一个文件,导入时不重复(#7) - #38
Merged
Merged
Conversation
… kind Issue #7 asked for moving many conversations from one computer to another; only one conversation at a time could be exported and imported. - ConversationStore.exportAllThreads/exportAllThreadsToFile write every conversation with messages into one .frx-chats.json bundle (format firefox-reverse-conversations, schemaVersion 1, newest first), with the same per-conversation shape as the single-conversation file. Empty conversations are left out; one that cannot be exported is skipped and reported instead of failing the whole bundle. - importConversations/importFromFile accept a single-conversation file or a bundle. Every entry is validated before anything is written, so one bad entry rejects the file and the error names its position. Entries whose source conversation and source updatedAt match a thread already here (the original, or an earlier import, even if it was continued locally) are skipped; a conversation updated at the source comes in as a new one. The original order is kept, and a failed save rolls back. - History drawer: a new "全部导出" button, and "导入" now takes both kinds of file and reports how many were imported or already there. The header wraps on narrow sidebars. - selftest-conversations covers the store; selftest-history-transfer drives both buttons in jsdom with the real store and a fake file picker. Refs #7 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Merged
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.
背景
#7第一条:办公电脑上有很多会话,希望回家后在另一台电脑上也能看到。v0.23.0做了单会话导出导入,但会话一多就得一个一个导,而且同一个会话导两次会变成两份。
改动(按提交)
feat(history)全部会话导出成一个文件,导入两种文件都认(f92f8e7):ConversationStore.exportAllThreads/exportAllThreadsToFile把有消息的会话按最近更新排序,写成一个.frx-chats.json:firefox-reverse-conversations,schemaVersion 1;conversation相同,同样不带工作目录、环境绑定、运行状态、投影和Usage;importConversations/importFromFile认单会话文件和全部会话文件:importThread、importThreadFromFile、exportThreadToFile行为不变。docs(readme)(6dc041d):开头的历史抽屉介绍,以及“main(尚未发布)”里的一条。验证
bash scripts/selftest-agent-tools.sh通过,共46步。selftest-conversations新增存储层用例,覆盖:selftest-history-transfer:用jsdom渲染真实的AgentPanel,配真的ConversationStore和一个假文件选择器,点按钮走完整流程,覆盖:ConversationStore,临时profile、无头启动,经marionette用真实落盘的存储做了一遍:.tmp;没验证的
已知问题(本pr未处理)
🤖 Generated with Claude Code