Skip to content

Commit eafb7ee

Browse files
authored
Merge branch 'main' into pr@main@keep_chat_model
2 parents be5a34f + 8d74580 commit eafb7ee

2 files changed

Lines changed: 35 additions & 19 deletions

File tree

src/lib/components/chat/ModelSelector/Selector.svelte

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,13 @@
324324
// Remove duplicates and sort
325325
tags = Array.from(new Set(tags)).sort((a, b) => a.localeCompare(b));
326326
}
327+
328+
models.set(
329+
await getModels(
330+
localStorage.token,
331+
$config?.features?.enable_direct_connections && ($settings?.directConnections ?? null)
332+
)
333+
);
327334
});
328335
329336
$: if (show) {

src/lib/components/layout/Sidebar.svelte

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -598,8 +598,16 @@
598598
</Tooltip>
599599
</div>
600600

601-
<div class="">
602-
<Tooltip content={$i18n.t('Search')} placement="right">
601+
<div class={$showSidebar ? '' : 'hidden'}>
602+
<div class="relative {$temporaryChatEnabled ? 'opacity-20' : ''}">
603+
<SearchInput
604+
bind:value={search}
605+
on:input={searchDebounceHandler}
606+
placeholder={$i18n.t('Search')}
607+
showClearButton={true}
608+
/>
609+
</div>
610+
<Tooltip content={$i18n.t('Search 123')} placement="right" className="hidden">
603611
<button
604612
class=" cursor-pointer flex rounded-xl hover:bg-gray-100 dark:hover:bg-gray-850 transition group"
605613
on:click={(e) => {
@@ -734,21 +742,7 @@
734742
<div
735743
class="sidebar px-2 pt-2 pb-1.5 flex justify-between space-x-1 text-gray-600 dark:text-gray-400 sticky top-0 z-10 -mb-3"
736744
>
737-
<a
738-
class="flex items-center rounded-xl size-8.5 h-full justify-center hover:bg-gray-100/50 dark:hover:bg-gray-850/50 transition no-drag-region"
739-
href="/"
740-
draggable="false"
741-
on:click={newChatHandler}
742-
>
743-
<img
744-
crossorigin="anonymous"
745-
src="{WEBUI_BASE_URL}/static/favicon.png"
746-
class="sidebar-new-chat-icon size-6 rounded-full"
747-
alt=""
748-
/>
749-
</a>
750-
751-
<a href="/" class="flex flex-1 px-1.5" on:click={newChatHandler}>
745+
<a href="/" class="flex flex-1 px-1.5 hidden" on:click={newChatHandler}>
752746
<div
753747
id="sidebar-webui-name"
754748
class=" self-center font-medium text-gray-850 dark:text-white font-primary"
@@ -775,6 +769,21 @@
775769
</button>
776770
</Tooltip>
777771

772+
<Tooltip content={$i18n.t('New Chat')} placement="bottom">
773+
<button
774+
class="cursor-pointer p-[7px] flex rounded-xl hover:bg-gray-100 dark:hover:bg-gray-900 transition"
775+
on:click={async () => {
776+
selectedChatId = null;
777+
await goto('/kael/');
778+
const newChatButton = document.getElementById('new-chat-button');
779+
setTimeout(() => {
780+
newChatButton?.click();
781+
}, 0);
782+
}}
783+
>
784+
<PencilSquare className="size-5" strokeWidth="2" />
785+
</button>
786+
</Tooltip>
778787
<div
779788
class="{scrollTop > 0
780789
? 'visible'
@@ -1218,7 +1227,7 @@
12181227
</Folder>
12191228
</div>
12201229

1221-
<div class="px-1.5 pt-1.5 pb-2 sticky bottom-0 z-10 -mt-3 sidebar">
1230+
<div class="px-1.5 pt-1.5 pb-3 sticky bottom-0 z-10 -mt-3 sidebar">
12221231
<div
12231232
class=" sidebar-bg-gradient-to-t bg-linear-to-t from-gray-50 dark:from-gray-950 to-transparent from-50% pointer-events-none absolute inset-0 -z-10 -mt-6"
12241233
></div>
@@ -1233,7 +1242,7 @@
12331242
}}
12341243
>
12351244
<div
1236-
class=" flex items-center rounded-2xl py-2 px-1.5 w-full hover:bg-gray-100/50 dark:hover:bg-gray-900/50 transition"
1245+
class=" flex items-center rounded-xl py-2 px-2 w-full hover:bg-gray-100 dark:hover:bg-gray-900/50 transition"
12371246
>
12381247
<div class=" self-center mr-3">
12391248
<img

0 commit comments

Comments
 (0)