Skip to content

Commit d151691

Browse files
chore: revert loading ball to old loading indicator (#1910)
Signed-off-by: Ryan Hopper-Lowe <[email protected]>
1 parent 773c25a commit d151691

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

ui/user/src/lib/components/messages/Message.svelte

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import { popover } from '$lib/actions';
1111
import { fly } from 'svelte/transition';
1212
import { waitingOnModelMessage } from '$lib/services/chat/messages';
13+
import Loading from '$lib/icons/Loading.svelte';
1314
1415
interface Props {
1516
msg: Message;
@@ -77,7 +78,7 @@
7778
7879
$effect(() => {
7980
// this is a hack to ensure the effect is run each time animatedText updates
80-
void markdownText;
81+
void animatedText;
8182
8283
const blocks = document.querySelectorAll('.message-content pre > code');
8384
blocks.forEach((block) => {
@@ -145,19 +146,6 @@
145146
return true;
146147
});
147148
}
148-
149-
let markdownText = $derived.by(() => {
150-
let text = animatedText;
151-
152-
// Count the number of code tags in the text
153-
const codeOpenTagCount = (text.match(/```/g) || []).length;
154-
// If there's an odd number of code tags, add a closing code tag
155-
if (codeOpenTagCount % 2 !== 0) {
156-
text += '\n```\n';
157-
}
158-
159-
return text + '\n<span data-end-indicator></span>';
160-
});
161149
</script>
162150

163151
{#snippet time()}
@@ -315,8 +303,14 @@
315303
{/each}
316304
{@render explain()}
317305
{:else}
318-
<div class:loading-container={!msg.done || animating}>
319-
{@html toHTMLFromMarkdown(markdownText)}
306+
<div>
307+
{@html toHTMLFromMarkdown(animatedText)}
308+
309+
{#if !msg.done || animating}
310+
<p class="flex items-center gap-2 text-sm text-gray-500">
311+
<Loading /> Loading...
312+
</p>
313+
{/if}
320314
</div>
321315
{/if}
322316
{/snippet}

0 commit comments

Comments
 (0)