From ae254bf47015bd8843c1141f613ec051305a49dd Mon Sep 17 00:00:00 2001
From: t8y2 <1156263951@qq.com>
Date: Sat, 9 May 2026 18:08:12 +0800
Subject: [PATCH] fix(ai): make conversation history toggleable
---
src/components/editor/AiAssistant.vue | 79 +++++++++++++++------------
1 file changed, 45 insertions(+), 34 deletions(-)
diff --git a/src/components/editor/AiAssistant.vue b/src/components/editor/AiAssistant.vue
index 8ed7a9b91a..e0bb72843c 100644
--- a/src/components/editor/AiAssistant.vue
+++ b/src/components/editor/AiAssistant.vue
@@ -35,6 +35,7 @@ import {
DropdownMenuItem,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
+import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { ScrollArea } from "@/components/ui/scroll-area";
@@ -368,9 +369,9 @@ async function persistConversation() {
}).catch(() => {});
}
-async function loadConversationList() {
- conversations.value = await loadAiConversations().catch(() => []);
- showConversationList.value = true;
+async function setConversationListOpen(open: boolean) {
+ showConversationList.value = open;
+ if (open) conversations.value = await loadAiConversations().catch(() => []);
}
function selectConversation(conv: AiConversation) {
@@ -467,16 +468,47 @@ function formatInlineText(text: string): string {
-
+