feat(ai): add panel shortcut and conversation restore

This commit is contained in:
二丫讲梵 authored and GitHub committed 2026-09-08 22:34:26 +08:00
1 parent b70d4153a4
commit 798733fd29
23 files changed
+165 -2

No files matched your search

@@ -396,6 +396,13 @@ describe("AI assistant uses platform-specific conversation lifecycle", () => {
expect(syncBody).toContain("conversations.value.sort(");
});
it("reorders recovered conversations before restoring the most recent one", () => {
const recoveryBody = bodyOf("async function persistPendingInputRecovery(");
expect(recoveryBody).toContain(".then(() => syncPersistedConversation(snapshot))");
const mountedBody = bodyOf("onMounted(async () => {");
expect(mountedBody.indexOf("initialConversationStateLoaded = true;")).toBeLessThan(mountedBody.indexOf("restoreInitialConversation();"));
});
it("does not replace an in-memory desktop run when the AI panel remounts", () => {
const mountedBody = bodyOf("onMounted(async () => {");
expect(mountedBody).toContain("const liveRun = desktopAiRun<ChatMessage>(persistedRun.conversationId);");