Spaces:
Running
Running
improve think ui
Browse files
src/lib/components/chat/markdown/Think.svelte
CHANGED
|
@@ -5,15 +5,15 @@
|
|
| 5 |
|
| 6 |
import Spinner from '$lib/components/loading/Spinner.svelte';
|
| 7 |
|
| 8 |
-
import Paragraph from './Paragraph.svelte';
|
| 9 |
-
import Heading from './Heading.svelte';
|
| 10 |
-
import Code from './Code.svelte';
|
| 11 |
-
import Codespan from './Codespan.svelte';
|
| 12 |
-
import Blockquote from './Blockquote.svelte';
|
| 13 |
-
import List from './List.svelte';
|
| 14 |
-
import ListItem from './ListItem.svelte';
|
| 15 |
-
import Link from './Link.svelte';
|
| 16 |
-
import Hr from './Hr.svelte';
|
| 17 |
|
| 18 |
let { isThinking, content }: { isThinking?: boolean; content?: string } = $props();
|
| 19 |
|
|
@@ -46,19 +46,19 @@
|
|
| 46 |
class="mb-4 overflow-hidden rounded-xl border border-border bg-accent text-xs dark:bg-accent/30"
|
| 47 |
>
|
| 48 |
<button
|
| 49 |
-
class="flex w-full cursor-pointer items-center gap-2.5 p-
|
| 50 |
onclick={toggleCollapse}
|
| 51 |
>
|
| 52 |
<div
|
| 53 |
-
class="flex size-
|
| 54 |
'animate-pulse'}"
|
| 55 |
>
|
| 56 |
-
<Brain class="size-3
|
| 57 |
</div>
|
| 58 |
{#if !isThinking}
|
| 59 |
-
<Spinner className="text-muted-foreground text-
|
| 60 |
{:else}
|
| 61 |
-
<span class="font-medium text-muted-foreground">Thought process</span>
|
| 62 |
{/if}
|
| 63 |
<ChevronDown
|
| 64 |
class="ml-auto size-3.5 text-muted-foreground/60 transition-transform duration-300 {isCollapsed
|
|
|
|
| 5 |
|
| 6 |
import Spinner from '$lib/components/loading/Spinner.svelte';
|
| 7 |
|
| 8 |
+
import Paragraph from './think/Paragraph.svelte';
|
| 9 |
+
import Heading from './think/Heading.svelte';
|
| 10 |
+
import Code from './think/Code.svelte';
|
| 11 |
+
import Codespan from './think/Codespan.svelte';
|
| 12 |
+
import Blockquote from './think/Blockquote.svelte';
|
| 13 |
+
import List from './think/List.svelte';
|
| 14 |
+
import ListItem from './think/ListItem.svelte';
|
| 15 |
+
import Link from './think/Link.svelte';
|
| 16 |
+
import Hr from './think/Hr.svelte';
|
| 17 |
|
| 18 |
let { isThinking, content }: { isThinking?: boolean; content?: string } = $props();
|
| 19 |
|
|
|
|
| 46 |
class="mb-4 overflow-hidden rounded-xl border border-border bg-accent text-xs dark:bg-accent/30"
|
| 47 |
>
|
| 48 |
<button
|
| 49 |
+
class="flex w-full cursor-pointer items-center gap-2.5 p-2 text-left transition-colors hover:bg-accent/80 dark:hover:bg-accent/30"
|
| 50 |
onclick={toggleCollapse}
|
| 51 |
>
|
| 52 |
<div
|
| 53 |
+
class="flex size-5 min-h-5 min-w-5 items-center justify-center rounded-lg bg-linear-to-br from-primary/20 to-primary/5 {!isThinking &&
|
| 54 |
'animate-pulse'}"
|
| 55 |
>
|
| 56 |
+
<Brain class="size-3 text-muted-foreground" />
|
| 57 |
</div>
|
| 58 |
{#if !isThinking}
|
| 59 |
+
<Spinner className="text-muted-foreground text-[11px] font-medium">Thinking...</Spinner>
|
| 60 |
{:else}
|
| 61 |
+
<span class="text-[11px] font-medium text-muted-foreground">Thought process</span>
|
| 62 |
{/if}
|
| 63 |
<ChevronDown
|
| 64 |
class="ml-auto size-3.5 text-muted-foreground/60 transition-transform duration-300 {isCollapsed
|
src/lib/components/chat/markdown/think/Paragraph.svelte
CHANGED
|
@@ -3,4 +3,4 @@
|
|
| 3 |
let { children }: { children?: Snippet } = $props();
|
| 4 |
</script>
|
| 5 |
|
| 6 |
-
<p class="mb-2 leading-relaxed text-foreground/75 last:mb-0">{@render children?.()}</p>
|
|
|
|
| 3 |
let { children }: { children?: Snippet } = $props();
|
| 4 |
</script>
|
| 5 |
|
| 6 |
+
<p class="mb-2 text-[11px]! leading-relaxed text-foreground/75 last:mb-0">{@render children?.()}</p>
|