From 5cf621396daef8b611c1284f060c600670fd005e Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Thu, 2 May 2024 12:33:04 -0700 Subject: [PATCH] refac: navbar selector styling --- src/lib/components/chat/ModelSelector.svelte | 12 ++-- .../chat/ModelSelector/Selector.svelte | 64 ++++++++++++------- src/lib/components/layout/Navbar.svelte | 2 +- src/routes/(app)/playground/+page.svelte | 3 +- 4 files changed, 50 insertions(+), 31 deletions(-) diff --git a/src/lib/components/chat/ModelSelector.svelte b/src/lib/components/chat/ModelSelector.svelte index 8f03975ba..2874da49b 100644 --- a/src/lib/components/chat/ModelSelector.svelte +++ b/src/lib/components/chat/ModelSelector.svelte @@ -40,9 +40,9 @@
{#each selectedModels as selectedModel, selectedModelIdx} -
+
-
+
@@ -94,9 +94,9 @@ xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" - stroke-width="1.5" + stroke-width="2" stroke="currentColor" - class="w-4 h-4" + class="size-3.5" > diff --git a/src/lib/components/chat/ModelSelector/Selector.svelte b/src/lib/components/chat/ModelSelector/Selector.svelte index 350ca0aa2..98c63fc06 100644 --- a/src/lib/components/chat/ModelSelector/Selector.svelte +++ b/src/lib/components/chat/ModelSelector/Selector.svelte @@ -1,5 +1,5 @@ - { searchValue = ''; window.setTimeout(() => document.getElementById('model-search-input')?.focus(), 0); }} - selected={items.find((item) => item.value === value) ?? ''} - onSelectedChange={(selectedItem) => { - value = selectedItem.value; - }} > - - - - - +
+ {#if selectedModel} + {selectedModel.label} + {:else} + {placeholder} + {/if} + +
+ + @@ -214,12 +220,13 @@
{/if} -
+
{#each filteredItems as item} - { + value = item.value; + }} >
@@ -287,7 +294,7 @@
{/if} - + {:else}
@@ -385,5 +392,16 @@ {/each}
- - + + + + diff --git a/src/lib/components/layout/Navbar.svelte b/src/lib/components/layout/Navbar.svelte index cd6d19564..57b09a19b 100644 --- a/src/lib/components/layout/Navbar.svelte +++ b/src/lib/components/layout/Navbar.svelte @@ -37,7 +37,7 @@
-
+
{#if !shareEnabled} diff --git a/src/routes/(app)/playground/+page.svelte b/src/routes/(app)/playground/+page.svelte index e658a2a10..b0de1d272 100644 --- a/src/routes/(app)/playground/+page.svelte +++ b/src/routes/(app)/playground/+page.svelte @@ -316,7 +316,7 @@
-
+
@@ -330,6 +330,7 @@ info: model }))} bind:value={selectedModelId} + className="max-w-2xl" />