]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
ui: export full message tree instead of active path only (#25501)
authorPascal <redacted>
Fri, 10 Jul 2026 07:10:45 +0000 (09:10 +0200)
committerGitHub <redacted>
Fri, 10 Jul 2026 07:10:45 +0000 (09:10 +0200)
downloadConversation serialized activeMessages, the root -> currNode
path, so exporting a conversation with edited or regenerated messages
dropped every alternate version and kept only the selected one.

Fetch the whole message tree via getConversationMessages so the export
carries all message versions, matching the multi-conversation export
path which already did this. Keep the active conversation as the header
source to preserve an up-to-date currNode.

Forks are separate conversations, each with its own convId, and are
exported on their own.

tools/ui/src/lib/stores/conversations.svelte.ts

index b29a900fe329144df3dc457701365ba72a1f18e9..47d2f060dd3e7e499a366a2785dcdd083c76789e 100644 (file)
@@ -1115,21 +1115,18 @@ class ConversationsStore {
        }
 
        /**
-        * Downloads a conversation as JSON file.
+        * Downloads a single conversation as a JSONL file, serializing the full message tree.
         * @param convId - The conversation ID to download
         */
        async downloadConversation(convId: string): Promise<void> {
-               let conversation: DatabaseConversation | null;
-               let messages: DatabaseMessage[];
+               const conversation =
+                       this.activeConversation?.id === convId
+                               ? this.activeConversation
+                               : await DatabaseService.getConversation(convId);
 
-               if (this.activeConversation?.id === convId) {
-                       conversation = this.activeConversation;
-                       messages = this.activeMessages;
-               } else {
-                       conversation = await DatabaseService.getConversation(convId);
-                       if (!conversation) return;
-                       messages = await DatabaseService.getConversationMessages(convId);
-               }
+               if (!conversation) return;
+
+               const messages = await DatabaseService.getConversationMessages(convId);
 
                this.downloadConversationFile({ conv: conversation, messages });
        }