This commit is contained in:
Timothy Jaeryang Baek committed 2026-07-14 02:55:01 -04:00
1 parent d8131d1091
commit d364101761
12 files changed
+161 -128

No files matched your search

+51 -52
View File
@@ -695,12 +695,12 @@
} else if (type === 'chat:message:favorite') { } else if (type === 'chat:message:favorite') {
// Update message favorite status // Update message favorite status
message.favorite = data.favorite; message.favorite = data.favorite;
} else if (type === 'chat:title') { } else if (type === 'chat:title') {
chatTitle.set(data); chatTitle.set(data);
await refreshChatList(localStorage.token); await refreshChatList(localStorage.token);
} else if (type === 'chat:tags') { } else if (type === 'chat:tags') {
chat = await getChatById(localStorage.token, $chatId); chat = await getChatById(localStorage.token, $chatId);
allTags.set(await getAllTags(localStorage.token)); allTags.set(await getAllTags(localStorage.token));
} else if (type === 'source' || type === 'citation') { } else if (type === 'source' || type === 'citation') {
if (data?.type === 'code_execution') { if (data?.type === 'code_execution') {
// Code execution; update existing code execution by ID, or add new one. // Code execution; update existing code execution by ID, or add new one.
@@ -1759,11 +1759,11 @@
const chatCompletedHandler = async (_chatId, modelId, responseMessageId, messages) => { const chatCompletedHandler = async (_chatId, modelId, responseMessageId, messages) => {
// Backend handles outlet filters and persistence inline. // Backend handles outlet filters and persistence inline.
// Just refresh the sidebar chat list. // Just refresh the sidebar chat list.
if ($chatId == _chatId && !$temporaryChatEnabled) { if ($chatId == _chatId && !$temporaryChatEnabled) {
await refreshChatList(localStorage.token); await refreshChatList(localStorage.token);
} }
}; };
const chatActionHandler = async (_chatId, actionId, modelId, responseMessageId, event = null) => { const chatActionHandler = async (_chatId, actionId, modelId, responseMessageId, event = null) => {
const messages = createMessagesList(history, responseMessageId); const messages = createMessagesList(history, responseMessageId);
@@ -1810,12 +1810,12 @@
history: history, history: history,
params: params, params: params,
files: chatFiles files: chatFiles
}); });
await refreshChatList(localStorage.token); await refreshChatList(localStorage.token);
}
} }
}; }
};
const getChatEventEmitter = async (modelId: string, chatId: string = '') => { const getChatEventEmitter = async (modelId: string, chatId: string = '') => {
return setInterval(() => { return setInterval(() => {
@@ -2653,11 +2653,11 @@
// and causing spurious toast notifications / state duplication). // and causing spurious toast notifications / state duplication).
if (res.chat_id && $chatId !== res.chat_id && $chatId === _chatId) { if (res.chat_id && $chatId !== res.chat_id && $chatId === _chatId) {
await chatId.set(res.chat_id); await chatId.set(res.chat_id);
if (!$temporaryChatEnabled) { if (!$temporaryChatEnabled) {
window.history.replaceState(history.state, '', `/c/${res.chat_id}`); window.history.replaceState(history.state, '', `/c/${res.chat_id}`);
await refreshChatList(localStorage.token); await refreshChatList(localStorage.token);
// Persist chat-level params (system prompt, advanced // Persist chat-level params (system prompt, advanced
// params) that the backend doesn't receive in the // params) that the backend doesn't receive in the
// chat completion request. Files are now persisted // chat completion request. Files are now persisted
// by the backend at chat creation time. // by the backend at chat creation time.
@@ -2930,14 +2930,14 @@
_chatId = chat.id; _chatId = chat.id;
await chatId.set(_chatId); await chatId.set(_chatId);
window.history.replaceState(history.state, '', `/c/${_chatId}`); window.history.replaceState(history.state, '', `/c/${_chatId}`);
await tick(); await tick();
await refreshChatList(localStorage.token); await refreshChatList(localStorage.token);
selectedFolder.set(null); selectedFolder.set(null);
} else { } else {
_chatId = `local:${$socket?.id}`; // Use socket id for temporary chat _chatId = `local:${$socket?.id}`; // Use socket id for temporary chat
await chatId.set(_chatId); await chatId.set(_chatId);
} }
@@ -3012,24 +3012,24 @@
} }
); );
if (res) { if (res) {
await refreshChatList(localStorage.token, { refreshPinned: true }); await refreshChatList(localStorage.token, { refreshPinned: true });
toast.success($i18n.t('Chat moved successfully')); toast.success($i18n.t('Chat moved successfully'));
} }
} else { } else {
toast.error($i18n.t('Failed to move chat')); toast.error($i18n.t('Failed to move chat'));
} }
}; };
const archiveChatHandler = async (id: string) => { const archiveChatHandler = async (id: string) => {
try { try {
await archiveChatById(localStorage.token, id); await archiveChatById(localStorage.token, id);
initNewChat(); initNewChat();
await goto('/'); await goto('/');
await refreshChatList(localStorage.token, { refreshPinned: true }); await refreshChatList(localStorage.token, { refreshPinned: true });
toast.success($i18n.t('Chat archived.')); toast.success($i18n.t('Chat archived.'));
} catch (error) { } catch (error) {
console.error('Error archiving chat:', error); console.error('Error archiving chat:', error);
toast.error($i18n.t('Failed to archive chat.')); toast.error($i18n.t('Failed to archive chat.'));
} }
@@ -3058,13 +3058,13 @@
if (!id) return; if (!id) return;
try { try {
const res = await deleteChatById(localStorage.token, id); const res = await deleteChatById(localStorage.token, id);
if (res) { if (res) {
initNewChat(); initNewChat();
await goto('/'); await goto('/');
await refreshChatList(localStorage.token, { refreshPinned: true }); await refreshChatList(localStorage.token, { refreshPinned: true });
allTags.set(await getAllTags(localStorage.token)); allTags.set(await getAllTags(localStorage.token));
toast.success($i18n.t('Chat deleted.')); toast.success($i18n.t('Chat deleted.'));
} }
} catch (error) { } catch (error) {
console.error('Error deleting chat:', error); console.error('Error deleting chat:', error);
@@ -3183,7 +3183,6 @@
}} }}
{history} {history}
title={$chatTitle} title={$chatTitle}
bind:selectedModels
shareEnabled={!!history.currentId} shareEnabled={!!history.currentId}
{initNewChat} {initNewChat}
scrollToTop={!isNearTop ? scrollToTop : null} scrollToTop={!isNearTop ? scrollToTop : null}
@@ -3214,12 +3213,12 @@
null null
); );
if (savedChat) { if (savedChat) {
temporaryChatEnabled.set(false); temporaryChatEnabled.set(false);
chatId.set(savedChat.id); chatId.set(savedChat.id);
await refreshChatList(localStorage.token); await refreshChatList(localStorage.token);
await goto(`/c/${savedChat.id}`); await goto(`/c/${savedChat.id}`);
toast.success($i18n.t('Conversation saved successfully')); toast.success($i18n.t('Conversation saved successfully'));
} }
} catch (error) { } catch (error) {
@@ -3253,7 +3252,7 @@
setInputText={(text) => { setInputText={(text) => {
messageInput?.setText(text); messageInput?.setText(text);
}} }}
{selectedModels} bind:selectedModels
{atSelectedModel} {atSelectedModel}
{sendMessage} {sendMessage}
{showMessage} {showMessage}
@@ -3282,7 +3281,7 @@
bind:this={messageInput} bind:this={messageInput}
{history} {history}
{taskIds} {taskIds}
{selectedModels} bind:selectedModels
bind:files bind:files
bind:prompt bind:prompt
bind:autoScroll bind:autoScroll
@@ -3365,7 +3364,7 @@
<div class="flex items-center h-full"> <div class="flex items-center h-full">
<Placeholder <Placeholder
{history} {history}
{selectedModels} bind:selectedModels
bind:messageInput bind:messageInput
bind:files bind:files
bind:prompt bind:prompt
@@ -57,7 +57,7 @@
> >
<img <img
src={`${WEBUI_API_BASE_URL}/models/model/profile/image?id=${model?.id}&lang=${$i18n.language}`} src={`${WEBUI_API_BASE_URL}/models/model/profile/image?id=${model?.id}&lang=${$i18n.language}`}
class=" size-[2.7rem] rounded-full border-[1px] border-gray-100 dark:border-none" class=" size-[2.7rem] rounded-full"
alt="logo" alt="logo"
draggable="false" draggable="false"
on:error={(e) => { on:error={(e) => {
@@ -28,6 +28,9 @@
let showValves = getOpen('valves', false); let showValves = getOpen('valves', false);
let showSystemPrompt = getOpen('systemPrompt'); let showSystemPrompt = getOpen('systemPrompt');
let showAdvancedParams = getOpen('advancedParams'); let showAdvancedParams = getOpen('advancedParams');
const compactSectionButtonClass =
'w-full h-8 px-2.5 rounded-xl text-[13px] font-normal text-gray-600 hover:bg-gray-50/40 hover:text-gray-900 dark:text-gray-300 dark:hover:bg-gray-800/40 dark:hover:text-gray-100 transition cursor-pointer select-none';
</script> </script>
<div class=" dark:text-white"> <div class=" dark:text-white">
@@ -80,8 +83,6 @@
{/each} {/each}
</div> </div>
</Collapsible> </Collapsible>
<hr class="my-2 border-gray-50 dark:border-gray-700/10" />
{/if} {/if}
{#if $user?.role === 'admin' || ($user?.permissions.chat?.valves ?? true)} {#if $user?.role === 'admin' || ($user?.permissions.chat?.valves ?? true)}
@@ -89,14 +90,12 @@
bind:open={showValves} bind:open={showValves}
onChange={setOpen('valves')} onChange={setOpen('valves')}
title={$i18n.t('Valves')} title={$i18n.t('Valves')}
buttonClassName="w-full" buttonClassName={compactSectionButtonClass}
> >
<div class="text-sm" slot="content"> <div class="px-2 pt-1 text-sm" slot="content">
<Valves show={showValves} /> <Valves show={showValves} />
</div> </div>
</Collapsible> </Collapsible>
<hr class="my-2 border-gray-50 dark:border-gray-700/10" />
{/if} {/if}
{#if $user?.role === 'admin' || ($user?.permissions.chat?.system_prompt ?? true)} {#if $user?.role === 'admin' || ($user?.permissions.chat?.system_prompt ?? true)}
@@ -104,21 +103,19 @@
title={$i18n.t('System Prompt')} title={$i18n.t('System Prompt')}
bind:open={showSystemPrompt} bind:open={showSystemPrompt}
onChange={setOpen('systemPrompt')} onChange={setOpen('systemPrompt')}
buttonClassName="w-full" buttonClassName={compactSectionButtonClass}
> >
<div class="" slot="content"> <div class="px-2 pt-1" slot="content">
<textarea <textarea
bind:value={params.system} bind:value={params.system}
class="w-full text-xs outline-hidden resize-vertical {$settings.highContrastMode class="w-full text-sm outline-hidden resize-vertical {$settings.highContrastMode
? 'border-2 border-gray-300 dark:border-gray-700 rounded-lg bg-gray-50 dark:bg-gray-800 p-2.5' ? 'border-2 border-gray-300 dark:border-gray-700 rounded-lg bg-gray-50 dark:bg-gray-800 px-2 py-1.5'
: 'py-1.5 bg-transparent'}" : 'py-1 bg-transparent'}"
rows="4" rows="3"
placeholder={$i18n.t('Enter system prompt')} placeholder={$i18n.t('Enter system prompt')}
/> />
</div> </div>
</Collapsible> </Collapsible>
<hr class="my-2 border-gray-50 dark:border-gray-700/10" />
{/if} {/if}
{#if $user?.role === 'admin' || ($user?.permissions.chat?.params ?? true)} {#if $user?.role === 'admin' || ($user?.permissions.chat?.params ?? true)}
@@ -126,9 +123,9 @@
title={$i18n.t('Advanced Params')} title={$i18n.t('Advanced Params')}
bind:open={showAdvancedParams} bind:open={showAdvancedParams}
onChange={setOpen('advancedParams')} onChange={setOpen('advancedParams')}
buttonClassName="w-full" buttonClassName={compactSectionButtonClass}
> >
<div class="text-sm mt-1.5" slot="content"> <div class="px-2 pt-1 text-sm" slot="content">
<div> <div>
<AdvancedParams admin={$user?.role === 'admin'} custom={true} bind:params /> <AdvancedParams admin={$user?.role === 'admin'} custom={true} bind:params />
</div> </div>
+22 -13
View File
@@ -137,7 +137,7 @@
{#if show && !loading} {#if show && !loading}
<form <form
class="flex flex-col h-full justify-between space-y-3 text-sm" class="flex flex-col h-full justify-between space-y-2 text-xs"
on:submit|preventDefault={() => { on:submit|preventDefault={() => {
submitHandler(); submitHandler();
dispatch('save'); dispatch('save');
@@ -148,7 +148,7 @@
<div class="flex gap-2"> <div class="flex gap-2">
<div class="flex-1"> <div class="flex-1">
<select <select
class=" w-full rounded-sm text-xs py-2 px-1 bg-transparent outline-hidden" class="w-full h-[1.6875rem] rounded-xl text-xs px-2 bg-transparent outline-hidden"
bind:value={tab} bind:value={tab}
placeholder={$i18n.t('Select')} placeholder={$i18n.t('Select')}
> >
@@ -161,7 +161,7 @@
<div class="flex-1"> <div class="flex-1">
<select <select
class="w-full rounded-sm py-2 px-1 text-xs bg-transparent outline-hidden" class="w-full h-[1.6875rem] rounded-xl px-2 text-xs bg-transparent outline-hidden"
bind:value={selectedId} bind:value={selectedId}
on:change={async () => { on:change={async () => {
await tick(); await tick();
@@ -192,17 +192,17 @@
</div> </div>
{#if selectedId} {#if selectedId}
<hr class="border-gray-50/30 dark:border-gray-800/30 my-1 w-full" /> <div class="my-1 text-xs">
<div class="my-2 text-xs">
{#if !loading} {#if !loading}
<Valves <div class="chat-control-valves">
{valvesSpec} <Valves
bind:valves {valvesSpec}
on:change={() => { bind:valves
debounceSubmitHandler(); on:change={() => {
}} debounceSubmitHandler();
/> }}
/>
</div>
{:else} {:else}
<Spinner className="size-5" /> <Spinner className="size-5" />
{/if} {/if}
@@ -213,3 +213,12 @@
{:else} {:else}
<Spinner className="size-4" /> <Spinner className="size-4" />
{/if} {/if}
<style>
.chat-control-valves :global(input),
.chat-control-valves :global(select),
.chat-control-valves :global(textarea) {
font-size: 0.75rem;
line-height: 1rem;
}
</style>
+21 -8
View File
@@ -69,6 +69,7 @@
import InputMenu from './MessageInput/InputMenu.svelte'; import InputMenu from './MessageInput/InputMenu.svelte';
import VoiceRecording from './MessageInput/VoiceRecording.svelte'; import VoiceRecording from './MessageInput/VoiceRecording.svelte';
import ModelSelector from './ModelSelector.svelte';
import ToolServersModal from './ToolServersModal.svelte'; import ToolServersModal from './ToolServersModal.svelte';
import SkillsModal from './SkillsModal.svelte'; import SkillsModal from './SkillsModal.svelte';
@@ -1997,11 +1998,31 @@
</button> </button>
</Tooltip> </Tooltip>
{/each} {/each}
{#if !history?.currentId || history.messages[history.currentId]?.done == true}
<!-- Terminal Server Selector -->
{@const hasDirectToolServerAccess =
$_user?.role === 'admin' ||
($_user?.permissions?.features?.direct_tool_servers ?? true)}
{#if terminalCapableModels.length > 0 && (($terminalServers ?? []).some((t) => t.id) || (hasDirectToolServerAccess && (($terminalServers ?? []).some((t) => !t.id) || ($settings?.terminalServers ?? []).some((s) => s.url))))}
<TerminalMenu bind:show={showTerminalMenu} />
{/if}
{/if}
</div> </div>
</div> </div>
</div> </div>
<div class="self-end flex space-x-1 mr-1 shrink-0 gap-[0.5px]"> <div class="self-end flex space-x-1 mr-1 shrink-0 gap-[0.5px]">
<div class="-mr-1 flex min-w-0 max-w-[10rem] items-center sm:max-w-[13rem]">
<ModelSelector
bind:selectedModels
showSetDefault={!history?.currentId}
placement="auto"
align="end"
triggerClassName="items-center gap-1.5 rounded-lg px-2 py-1 text-[13px] font-normal text-gray-600 transition-colors duration-100 hover:bg-gray-50/40 hover:text-gray-700 dark:text-gray-300 dark:hover:bg-gray-800/40 dark:hover:text-gray-200"
/>
</div>
{#if isActive && prompt === '' && files.length === 0} {#if isActive && prompt === '' && files.length === 0}
<div class=" flex items-center"> <div class=" flex items-center">
<Tooltip content={$i18n.t('Stop')}> <Tooltip content={$i18n.t('Stop')}>
@@ -2045,14 +2066,6 @@
{/if} {/if}
{#if !history?.currentId || history.messages[history.currentId]?.done == true} {#if !history?.currentId || history.messages[history.currentId]?.done == true}
<!-- Terminal Server Selector -->
{@const hasDirectToolServerAccess =
$_user?.role === 'admin' ||
($_user?.permissions?.features?.direct_tool_servers ?? true)}
{#if terminalCapableModels.length > 0 && (($terminalServers ?? []).some((t) => t.id) || (hasDirectToolServerAccess && (($terminalServers ?? []).some((t) => !t.id) || ($settings?.terminalServers ?? []).some((s) => s.url))))}
<TerminalMenu bind:show={showTerminalMenu} />
{/if}
{#if $_user?.role === 'admin' || ($_user?.permissions?.chat?.stt ?? true)} {#if $_user?.role === 'admin' || ($_user?.permissions?.chat?.stt ?? true)}
<!-- {$i18n.t('Record voice')} --> <!-- {$i18n.t('Record voice')} -->
<Tooltip content={$i18n.t('Dictate')}> <Tooltip content={$i18n.t('Dictate')}>
@@ -91,14 +91,14 @@
</script> </script>
<div class="flex items-center translate-x-0.5"> <div class="flex items-center translate-x-0.5">
<Dropdown bind:show align="end"> <Dropdown bind:show align="start">
<Tooltip content={$i18n.t('Terminal')} placement="top"> <Tooltip content={$i18n.t('Terminal')} placement="top">
<button <button
type="button" type="button"
class="flex items-center gap-1.5 translate-y-[1px] hover:bg-gray-50/40 dark:hover:bg-gray-800/40 text-[13px] transition rounded-lg cursor-pointer {$selectedTerminalId && class="flex items-center gap-1.5 translate-y-[1px] text-[13px] text-gray-600 hover:bg-gray-50/40 hover:text-gray-700 dark:text-gray-300 dark:hover:bg-gray-800/40 dark:hover:text-gray-200 transition rounded-lg cursor-pointer {$selectedTerminalId &&
selectedLabel selectedLabel
? ' px-2.5 py-1 ' ? ' p-1 '
: ' p-2 opacity-50'}" : ' p-1 opacity-50'}"
> >
<Cloud className="size-3.5" strokeWidth="2" /> <Cloud className="size-3.5" strokeWidth="2" />
+8 -4
View File
@@ -14,6 +14,8 @@
export let showSetDefault = true; export let showSetDefault = true;
export let triggerClassName = 'text-lg'; export let triggerClassName = 'text-lg';
export let className = undefined; export let className = undefined;
export let placement: 'top' | 'bottom' | 'auto' = 'bottom';
export let align: 'start' | 'end' = 'start';
let compareModels = selectedModels.length > 1; let compareModels = selectedModels.length > 1;
@@ -57,10 +59,10 @@
} }
</script> </script>
<div class="flex flex-col w-full items-start"> <div class="flex min-w-0 max-w-full flex-col items-start">
<div class="flex w-full max-w-fit"> <div class="flex min-w-0 max-w-full">
<div class="overflow-hidden w-full"> <div class="min-w-0 max-w-full overflow-hidden">
<div class="max-w-full {($settings?.highContrastMode ?? false) ? 'm-1' : 'mr-1'}"> <div class="min-w-0 max-w-full">
<Selector <Selector
id="model" id="model"
placeholder={$i18n.t('Select a model')} placeholder={$i18n.t('Select a model')}
@@ -72,6 +74,8 @@
{pinModelHandler} {pinModelHandler}
{className} {className}
{triggerClassName} {triggerClassName}
{placement}
{align}
{showSetDefault} {showSetDefault}
onSetDefault={saveDefaultModel} onSetDefault={saveDefaultModel}
multipleEnabled={$user?.role === 'admin' || multipleEnabled={$user?.role === 'admin' ||
@@ -65,6 +65,8 @@
export let className = 'w-[22rem]'; export let className = 'w-[22rem]';
export let triggerClassName = 'text-lg'; export let triggerClassName = 'text-lg';
export let placement: 'top' | 'bottom' | 'auto' = 'bottom';
export let align: 'start' | 'end' = 'start';
export let showSetDefault = false; export let showSetDefault = false;
export let onSetDefault: () => Promise<void> | void = () => {}; export let onSetDefault: () => Promise<void> | void = () => {};
@@ -87,20 +89,36 @@
const updatePosition = () => { const updatePosition = () => {
if (!show || !triggerElement) return; if (!show || !triggerElement) return;
const rect = triggerElement.getBoundingClientRect(); const rect = triggerElement.getBoundingClientRect();
const contentRect = contentElement?.getBoundingClientRect();
const contentWidth = contentRect?.width ?? 0;
const contentHeight = contentRect?.height ?? 0;
const spaceBelow = window.innerHeight - rect.bottom - 8;
const spaceAbove = rect.top - 8;
const resolvedPlacement =
placement === 'auto'
? contentHeight && spaceBelow < contentHeight && spaceAbove > spaceBelow
? 'top'
: 'bottom'
: placement;
dropdownPosition = { dropdownPosition = {
top: rect.bottom + 2, top:
left: $mobile ? 8 : rect.left, resolvedPlacement === 'top' && contentHeight
? rect.top - contentHeight - 2
: rect.bottom + 2,
left: $mobile ? 8 : align === 'end' && contentWidth ? rect.right - contentWidth : rect.left,
width: $mobile ? window.innerWidth - 16 : 0 width: $mobile ? window.innerWidth - 16 : 0
}; };
}; };
const toggleOpen = () => { const toggleOpen = async () => {
show = !show; show = !show;
if (show) { if (show) {
searchValue = ''; searchValue = '';
listScrollTop = 0; listScrollTop = 0;
resetView(); resetView();
updatePosition(); updatePosition();
await tick();
updatePosition();
window.setTimeout(() => document.getElementById('model-search-input')?.focus(), 0); window.setTimeout(() => document.getElementById('model-search-input')?.focus(), 0);
} else { } else {
document.getElementById(`model-selector-${id}-button`)?.blur(); document.getElementById(`model-selector-${id}-button`)?.blur();
@@ -609,7 +627,7 @@
on:click={toggleOpen} on:click={toggleOpen}
> >
<div <div
class="flex w-full text-left px-0.5 bg-transparent truncate {triggerClassName} justify-between {($settings?.highContrastMode ?? class="flex w-full min-w-0 text-left px-0.5 bg-transparent {triggerClassName} justify-between {($settings?.highContrastMode ??
false) false)
? 'dark:placeholder-gray-100 placeholder-gray-800' ? 'dark:placeholder-gray-100 placeholder-gray-800'
: 'placeholder-gray-400'}" : 'placeholder-gray-400'}"
@@ -622,8 +640,8 @@
); );
}} }}
> >
{triggerLabel} <span class="min-w-0 flex-1 truncate">{triggerLabel}</span>
<ChevronDown className=" self-center ml-2 size-3" strokeWidth="2.5" /> <ChevronDown className="ml-1.5 size-2.5 shrink-0 self-center" strokeWidth="2.5" />
</div> </div>
</button> </button>
+10 -16
View File
@@ -21,7 +21,6 @@
import { goto } from '$app/navigation'; import { goto } from '$app/navigation';
import ShareChatModal from '../chat/ShareChatModal.svelte'; import ShareChatModal from '../chat/ShareChatModal.svelte';
import ModelSelector from '../chat/ModelSelector.svelte';
import Tooltip from '../common/Tooltip.svelte'; import Tooltip from '../common/Tooltip.svelte';
import Menu from '$lib/components/layout/Navbar/Menu.svelte'; import Menu from '$lib/components/layout/Navbar/Menu.svelte';
import UserMenu from '$lib/components/layout/Sidebar/UserMenu.svelte'; import UserMenu from '$lib/components/layout/Sidebar/UserMenu.svelte';
@@ -50,9 +49,7 @@
export let chat; export let chat;
export let history; export let history;
export let selectedModels; export let title = '';
export let showModelSelector = true;
export let onSaveTempChat: () => {}; export let onSaveTempChat: () => {};
export let archiveChatHandler: (id: string) => void; export let archiveChatHandler: (id: string) => void;
export let deleteChatHandler: (id: string) => void; export let deleteChatHandler: (id: string) => void;
@@ -117,18 +114,15 @@
</div> </div>
{/if} {/if}
<div <div class="flex-1 overflow-hidden max-w-full mt-0.5 py-0.5 {$showSidebar ? 'ml-1' : ''}">
class="flex-1 overflow-hidden max-w-full mt-0.5 py-0.5 {#if chat?.id}
{$showSidebar ? 'ml-1' : ''} <button
" type="button"
> class="max-w-full truncate rounded-lg px-2 py-1 text-left text-[13px] font-medium text-gray-700 transition-colors duration-100 hover:bg-gray-50/40 hover:text-gray-900 dark:text-gray-300 dark:hover:bg-gray-800/40 dark:hover:text-gray-100"
{#if showModelSelector} on:click={() => scrollToTop?.()}
<ModelSelector >
bind:selectedModels {title || chat?.chat?.title || $i18n.t('New Chat')}
showSetDefault={!shareEnabled && !readOnly} </button>
disabled={readOnly}
triggerClassName="text-[17px]"
/>
{/if} {/if}
</div> </div>
+2 -3
View File
@@ -78,7 +78,6 @@
$selectedFolder != null && $selectedFolder != null &&
$selectedFolder.user_id !== $user?.id && $selectedFolder.user_id !== $user?.id &&
$selectedFolder.permission !== 'write'; $selectedFolder.permission !== 'write';
</script> </script>
<div class="m-auto w-full max-w-6xl px-2 @2xl:px-20 translate-y-6 py-24 text-center"> <div class="m-auto w-full max-w-6xl px-2 @2xl:px-20 translate-y-6 py-24 text-center">
@@ -133,7 +132,7 @@
> >
<img <img
src={`${WEBUI_API_BASE_URL}/models/model/profile/image?id=${model?.id}&lang=${$i18n.language}`} src={`${WEBUI_API_BASE_URL}/models/model/profile/image?id=${model?.id}&lang=${$i18n.language}`}
class=" size-9 @sm:size-10 rounded-full border-[1px] border-gray-100 dark:border-none" class=" size-9 @sm:size-10 rounded-full"
aria-hidden="true" aria-hidden="true"
draggable="false" draggable="false"
on:error={(e) => { on:error={(e) => {
@@ -219,7 +218,7 @@
<MessageInput <MessageInput
bind:this={messageInput} bind:this={messageInput}
{history} {history}
{selectedModels} bind:selectedModels
bind:files bind:files
bind:prompt bind:prompt
bind:autoScroll bind:autoScroll
+4 -4
View File
@@ -119,9 +119,9 @@
{#if !disabled} {#if !disabled}
<div class="flex self-center translate-y-[1px]"> <div class="flex self-center translate-y-[1px]">
{#if open} {#if open}
<ChevronUp strokeWidth="3.5" className="size-3.5" /> <ChevronUp strokeWidth="2.75" className="size-3" />
{:else} {:else}
<ChevronDown strokeWidth="3.5" className="size-3.5" /> <ChevronDown strokeWidth="2.75" className="size-3" />
{/if} {/if}
</div> </div>
{/if} {/if}
@@ -144,9 +144,9 @@
{#if chevron} {#if chevron}
<div class="flex self-start translate-y-1"> <div class="flex self-start translate-y-1">
{#if open} {#if open}
<ChevronUp strokeWidth="3.5" className="size-3.5" /> <ChevronUp strokeWidth="2.75" className="size-3" />
{:else} {:else}
<ChevronDown strokeWidth="3.5" className="size-3.5" /> <ChevronDown strokeWidth="2.75" className="size-3" />
{/if} {/if}
</div> </div>
{/if} {/if}
@@ -54,7 +54,7 @@
<XMark className="size-3.5" /> <XMark className="size-3.5" />
</button> </button>
{:else} {:else}
<ChevronDown className=" size-3.5" strokeWidth="2.5" /> <ChevronDown className="size-2.5" strokeWidth="2.5" />
{/if} {/if}
</svelte:fragment> </svelte:fragment>