Skip to content

Commit 2b53dcf

Browse files
committed
fix: add custom loading icon for reasoning ui
1 parent 7579437 commit 2b53dcf

File tree

1 file changed

+23
-21
lines changed

1 file changed

+23
-21
lines changed

src/lib/components/chat/OpenReasoningResults.svelte

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<script lang="ts">
2-
import IconThought from "~icons/carbon/circle-packing";
32
import MarkdownRenderer from "./MarkdownRenderer.svelte";
43
54
export let summary: string;
@@ -16,27 +15,30 @@
1615
<div
1716
class="relative grid aspect-square place-content-center overflow-hidden rounded-lg bg-gray-100 dark:bg-gray-800"
1817
>
19-
<svg
20-
class="absolute inset-0 text-gray-300 transition-opacity dark:text-gray-700 {loading
21-
? 'opacity-100'
22-
: 'opacity-0'}"
23-
width="40"
24-
height="40"
25-
viewBox="0 0 38 38"
26-
fill="none"
27-
xmlns="http://www.w3.org/2000/svg"
28-
>
29-
<path
30-
class="loading-path"
31-
d="M8 2.5H30C30 2.5 35.5 2.5 35.5 8V30C35.5 30 35.5 35.5 30 35.5H8C8 35.5 2.5 35.5 2.5 30V8C2.5 8 2.5 2.5 8 2.5Z"
32-
stroke="currentColor"
33-
stroke-width="1"
34-
stroke-linecap="round"
35-
id="shape"
36-
/>
37-
</svg>
18+
<div class="grid h-dvh place-items-center">
19+
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
20+
<path
21+
class="stroke-gray-600 dark:stroke-gray-400"
22+
style="stroke-width: 1.9; fill: none; stroke-linecap: round; stroke-linejoin: round;"
23+
d="M16 6v3.33M16 6c0-2.65 3.25-4.3 5.4-2.62 1.2.95 1.6 2.65.95 4.04a3.63 3.63 0 0 1 4.61.16 3.45 3.45 0 0 1 .46 4.37 5.32 5.32 0 0 1 1.87 4.75c-.22 1.66-1.39 3.6-3.07 4.14M16 6c0-2.65-3.25-4.3-5.4-2.62a3.37 3.37 0 0 0-.95 4.04 3.65 3.65 0 0 0-4.6.16 3.37 3.37 0 0 0-.49 4.27 5.57 5.57 0 0 0-1.85 4.85 5.3 5.3 0 0 0 3.07 4.15M16 9.33v17.34m0-17.34c0 2.18 1.82 4 4 4m6.22 7.5c.67 1.3.56 2.91-.27 4.11a4.05 4.05 0 0 1-4.62 1.5c0 1.53-1.05 2.9-2.66 2.9A2.7 2.7 0 0 1 16 26.66m10.22-5.83a4.05 4.05 0 0 0-3.55-2.17m-16.9 2.18a4.05 4.05 0 0 0 .28 4.1c1 1.44 2.92 2.09 4.59 1.5 0 1.52 1.12 2.88 2.7 2.88A2.7 2.7 0 0 0 16 26.67M5.78 20.85a4.04 4.04 0 0 1 3.55-2.18"
24+
/>
3825

39-
<IconThought class="text-[1rem]" />
26+
{#if loading}
27+
<path
28+
class="animate-pulse stroke-purple-700"
29+
style="stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 50;"
30+
d="M16 6v3.33M16 6c0-2.65 3.25-4.3 5.4-2.62 1.2.95 1.6 2.65.95 4.04a3.63 3.63 0 0 1 4.61.16 3.45 3.45 0 0 1 .46 4.37 5.32 5.32 0 0 1 1.87 4.75c-.22 1.66-1.39 3.6-3.07 4.14M16 6c0-2.65-3.25-4.3-5.4-2.62a3.37 3.37 0 0 0-.95 4.04 3.65 3.65 0 0 0-4.6.16 3.37 3.37 0 0 0-.49 4.27 5.57 5.57 0 0 0-1.85 4.85 5.3 5.3 0 0 0 3.07 4.15M16 9.33v17.34m0-17.34c0 2.18 1.82 4 4 4m6.22 7.5c.67 1.3.56 2.91-.27 4.11a4.05 4.05 0 0 1-4.62 1.5c0 1.53-1.05 2.9-2.66 2.9A2.7 2.7 0 0 1 16 26.66m10.22-5.83a4.05 4.05 0 0 0-3.55-2.17m-16.9 2.18a4.05 4.05 0 0 0 .28 4.1c1 1.44 2.92 2.09 4.59 1.5 0 1.52 1.12 2.88 2.7 2.88A2.7 2.7 0 0 0 16 26.67M5.78 20.85a4.04 4.04 0 0 1 3.55-2.18"
31+
>
32+
<animate
33+
attributeName="stroke-dashoffset"
34+
values="0;500"
35+
dur="12s"
36+
repeatCount="indefinite"
37+
/>
38+
</path>
39+
{/if}
40+
</svg>
41+
</div>
4042
</div>
4143
<dl class="leading-4">
4244
<dd class="text-sm">Reasoning</dd>

0 commit comments

Comments
 (0)