From 746c083a876fe08cd64c71a799185d5d5756596a Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 27 Jun 2026 11:56:31 +0000 Subject: [PATCH] ui: migrate chat playground and stats to shadcn - ChatInterface controls, settings, input use Button/Input/Textarea/Label - ExpandableTextarea and ModelSelector restyled on shadcn tokens - ActivityStats wrapped in Card; Tooltip uses shadcn tooltip Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01UmuGqwNBJNEAMaWsdCDqUC --- ui-svelte/src/components/ActivityStats.svelte | 53 +++++------ ui-svelte/src/components/Tooltip.svelte | 18 ++-- .../playground/ChatInterface.svelte | 92 ++++++++----------- .../playground/ExpandableTextarea.svelte | 67 ++++++-------- .../playground/ModelSelector.svelte | 2 +- 5 files changed, 101 insertions(+), 131 deletions(-) diff --git a/ui-svelte/src/components/ActivityStats.svelte b/ui-svelte/src/components/ActivityStats.svelte index eaced0d5..3d7b935b 100644 --- a/ui-svelte/src/components/ActivityStats.svelte +++ b/ui-svelte/src/components/ActivityStats.svelte @@ -3,6 +3,9 @@ import { persistentStore } from "../stores/persistent"; import { calculateHistogramData } from "../lib/histogram"; import TokenHistogram from "./TokenHistogram.svelte"; + import { ChevronDown, X } from "@lucide/svelte"; + import * as Card from "$lib/components/ui/card/index.js"; + import { Button } from "$lib/components/ui/button/index.js"; const nf = new Intl.NumberFormat(); const histogramCollapsed = persistentStore("activity-histogram-collapsed", false); @@ -35,26 +38,24 @@ }); -
- + {#if !$histogramCollapsed} -
-
-
Prompt Processing
+
+
+
Prompt Processing
{#if stats.promptHistogramData} {:else} -
No prompt speed data yet
+
No prompt speed data yet
{/if}
-
-
Token Generation
+
+
Token Generation
{#if stats.genHistogramData} {:else} -
No generation speed data yet
+
No generation speed data yet
{/if}
{/if}
-
Requests
-
Cached
-
Processed
-
Generated
-
+
Requests
+
Cached
+
Processed
+
Generated
+
{nf.format(stats.totalRequests)} completed, {nf.format(stats.inFlightRequests)} waiting
-
+
{nf.format(stats.totalCacheTokens)} tokens
-
+
{nf.format(stats.totalInputTokens)} tokens
-
+
{nf.format(stats.totalOutputTokens)} tokens
-
+ diff --git a/ui-svelte/src/components/Tooltip.svelte b/ui-svelte/src/components/Tooltip.svelte index 97c76c96..da8d6c99 100644 --- a/ui-svelte/src/components/Tooltip.svelte +++ b/ui-svelte/src/components/Tooltip.svelte @@ -1,4 +1,6 @@ -
- -
- {content} -
-
-
+ + + {content} + diff --git a/ui-svelte/src/components/playground/ChatInterface.svelte b/ui-svelte/src/components/playground/ChatInterface.svelte index 2e50358f..a915aee4 100644 --- a/ui-svelte/src/components/playground/ChatInterface.svelte +++ b/ui-svelte/src/components/playground/ChatInterface.svelte @@ -7,6 +7,11 @@ import ChatMessageComponent from "./ChatMessage.svelte"; import ModelSelector from "./ModelSelector.svelte"; import ExpandableTextarea from "./ExpandableTextarea.svelte"; + import { Settings, Paperclip } from "@lucide/svelte"; + import { Button } from "$lib/components/ui/button/index.js"; + import { Input } from "$lib/components/ui/input/index.js"; + import { Textarea } from "$lib/components/ui/textarea/index.js"; + import { Label } from "$lib/components/ui/label/index.js"; const selectedModelStore = persistentStore("playground-selected-model", ""); const systemPromptStore = persistentStore("playground-system-prompt", ""); @@ -303,29 +308,23 @@
- - + +
{#if showSettings} -
+
- +
- - + />
- -
+
Precise (0) Creative (2)
- - -

Required for /v1/messages.

+ + +

Required for /v1/messages.

{/if} {#if !hasModels} -
+

No models configured. Add models to your configuration to start chatting.

{:else}
{#if messages.length === 0} -
+

Start a conversation by typing a message below.

{:else} @@ -419,14 +411,14 @@ {#if attachedImages.length > 0}
{#each attachedImages as imageUrl, idx (idx)} -
+
Attached image {idx + 1} + {:else} - - + + {/if}
diff --git a/ui-svelte/src/components/playground/ExpandableTextarea.svelte b/ui-svelte/src/components/playground/ExpandableTextarea.svelte index 3bea4548..e7a287e7 100644 --- a/ui-svelte/src/components/playground/ExpandableTextarea.svelte +++ b/ui-svelte/src/components/playground/ExpandableTextarea.svelte @@ -1,6 +1,8 @@ -
- - + +
{#if isExpanded}
-
+
-
-

Edit Text

- +
+

Edit Text

+
- + />
-
- - +
+ +
diff --git a/ui-svelte/src/components/playground/ModelSelector.svelte b/ui-svelte/src/components/playground/ModelSelector.svelte index 0d6c481f..b8085d1b 100644 --- a/ui-svelte/src/components/playground/ModelSelector.svelte +++ b/ui-svelte/src/components/playground/ModelSelector.svelte @@ -19,7 +19,7 @@ {#if hasModels}