diff --git a/Components/ChatArea.svelte b/Components/ChatArea.svelte index 4ffe9ba..286e02a 100644 --- a/Components/ChatArea.svelte +++ b/Components/ChatArea.svelte @@ -11,6 +11,7 @@ import type AIAgentPlugin from "main"; import { Copy } from "Enums/Copy"; import { Selector } from "Enums/Selector"; + import { fade } from "svelte/transition"; export let messages: ConversationContent[] = []; export let currentThought: string | null = null; @@ -409,27 +410,4 @@ transform: translateY(0); } } - - /* Welcome text animation */ - .typing-in { - overflow: hidden; - white-space: nowrap; - animation: reveal-center 1.5s ease-in-out forwards; - max-width: 0; - margin: 0 auto; - padding: 5px; - } - - @keyframes reveal-center { - 0% { - max-width: 0; - opacity: 0; - filter: blur(1px); - } - 100% { - max-width: 100%; - opacity: 1; - filter: blur(0px); - } - } \ No newline at end of file diff --git a/Components/ChatWindow.svelte b/Components/ChatWindow.svelte index cabb9bb..8d67ec8 100644 --- a/Components/ChatWindow.svelte +++ b/Components/ChatWindow.svelte @@ -169,6 +169,7 @@ const { conversation: loadedConversation, filePath } = $conversationStore.conversationToLoad; conversation = loadedConversation; conversationService.setCurrentConversationPath(filePath); + chatService.onNameChanged?.(loadedConversation.title); conversationStore.clearLoadFlag(); scrollToBottom(); } diff --git a/Components/TopBar.svelte b/Components/TopBar.svelte index 01a7ee8..462bb2b 100644 --- a/Components/TopBar.svelte +++ b/Components/TopBar.svelte @@ -8,25 +8,36 @@ import type { ConversationHistoryModal } from 'Modals/ConversationHistoryModal'; import { openPluginSettings } from 'Helpers/Helpers'; import type { ChatService } from 'Services/ChatService'; + import { tick } from 'svelte'; + import { fade } from 'svelte/transition'; export let leaf: WorkspaceLeaf; export let onNewConversation: (() => void) | undefined = undefined; const plugin = Resolve(Services.AIAgentPlugin); - const conversationService = Resolve(Services.ConversationFileSystemService); + const conversationFileSystemService = Resolve(Services.ConversationFileSystemService); const chatService: ChatService = Resolve(Services.ChatService); + let conversationTitle: string = "" + + chatService.onNameChanged = (name: string) => { + conversationTitle = ""; + tick().then(() => conversationTitle = name); + }; + function startNewConversation() { - conversationService.resetCurrentConversation(); + conversationFileSystemService.resetCurrentConversation(); conversationStore.reset(); onNewConversation?.(); + conversationTitle = ""; } async function deleteCurrentConversation() { chatService.stop(); - await conversationService.deleteCurrentConversation(); + await conversationFileSystemService.deleteCurrentConversation(); conversationStore.reset(); onNewConversation?.(); + conversationTitle = ""; } function openConversationHistory() { @@ -89,7 +100,7 @@ on:click={() => openConversationHistory()} aria-label="Conversation History" > -
+
+ {#if conversationTitle !== ""} +
+
{conversationTitle}
+ {/if}