From 52e7684ff4da566b77712b7a97834c06e1b4f3f2 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Mon, 22 Jan 2024 04:14:07 -0800 Subject: [PATCH] fix: code block unmount issue --- .../components/chat/Messages/CodeBlock.svelte | 26 +- .../chat/Messages/ResponseMessage.svelte | 630 +++++++++--------- 2 files changed, 330 insertions(+), 326 deletions(-) diff --git a/src/lib/components/chat/Messages/CodeBlock.svelte b/src/lib/components/chat/Messages/CodeBlock.svelte index c93485c4..c5290547 100644 --- a/src/lib/components/chat/Messages/CodeBlock.svelte +++ b/src/lib/components/chat/Messages/CodeBlock.svelte @@ -20,17 +20,19 @@ $: highlightedCode = code ? hljs.highlightAuto(code, hljs.getLanguage(lang)?.aliases).value : ''; -
-
-
{lang}
- +
-
+
{@html lang}
+ +
-
{@html highlightedCode || code}
-
+
{@html highlightedCode || code}
+ +{/if} diff --git a/src/lib/components/chat/Messages/ResponseMessage.svelte b/src/lib/components/chat/Messages/ResponseMessage.svelte index 21dafed5..ef88207f 100644 --- a/src/lib/components/chat/Messages/ResponseMessage.svelte +++ b/src/lib/components/chat/Messages/ResponseMessage.svelte @@ -154,328 +154,164 @@ }); -
- +{#key message.id} +
+ -
- - {#if message.model in modelfiles} - {modelfiles[message.model]?.title} +
+ + {#if message.model in modelfiles} + {modelfiles[message.model]?.title} + {:else} + Ollama {message.model ? ` ${message.model}` : ''} + {/if} + + {#if message.timestamp} + + {/if} + + + {#if message.content === ''} + {:else} - Ollama {message.model ? ` ${message.model}` : ''} - {/if} - - {#if message.timestamp} - - {/if} - - - {#if message.content === ''} - - {:else} -
-
- {#if edit === true} -
-