This commit is contained in:
Timothy J. Baek 2024-09-21 03:44:44 +02:00
parent 5d848ad130
commit aed8e2156f
3 changed files with 25 additions and 25 deletions

View File

@ -283,6 +283,16 @@
await goto('/'); await goto('/');
} }
} }
showControls.subscribe(async (value) => {
if (controlPane) {
if (value) {
controlPane.resize(parseInt(localStorage.getItem('chat-controls-size') || '35'));
} else {
controlPane.resize(0);
}
}
});
}); });
onDestroy(() => { onDestroy(() => {
@ -1764,7 +1774,6 @@
bind:selectedModels bind:selectedModels
bind:showModelSelector bind:showModelSelector
shareEnabled={messages.length > 0} shareEnabled={messages.length > 0}
{controlPane}
{chat} {chat}
{initNewChat} {initNewChat}
/> />
@ -1847,8 +1856,8 @@
{messages} {messages}
{submitPrompt} {submitPrompt}
{stopResponse} {stopResponse}
on:call={() => { on:call={async () => {
showControls.set(true); await showControls.set(true);
}} }}
/> />
</div> </div>

View File

@ -140,17 +140,19 @@
: 'px-5 py-4 bg-white dark:shadow-lg dark:bg-gray-850 border border-gray-50 dark:border-gray-800'} rounded-lg z-50 pointer-events-auto overflow-y-auto scrollbar-hidden" : 'px-5 py-4 bg-white dark:shadow-lg dark:bg-gray-850 border border-gray-50 dark:border-gray-800'} rounded-lg z-50 pointer-events-auto overflow-y-auto scrollbar-hidden"
> >
{#if $showCallOverlay} {#if $showCallOverlay}
<CallOverlay <div class="w-full h-full flex justify-center">
bind:files <CallOverlay
{submitPrompt} bind:files
{stopResponse} {submitPrompt}
{modelId} {stopResponse}
{chatId} {modelId}
{eventTarget} {chatId}
on:close={() => { {eventTarget}
showControls.set(false); on:close={() => {
}} showControls.set(false);
/> }}
/>
</div>
{:else if $showOverview} {:else if $showOverview}
<Overview <Overview
{history} {history}

View File

@ -29,7 +29,6 @@
export let initNewChat: Function; export let initNewChat: Function;
export let title: string = $WEBUI_NAME; export let title: string = $WEBUI_NAME;
export let shareEnabled: boolean = false; export let shareEnabled: boolean = false;
export let controlPane;
export let chat; export let chat;
export let selectedModels; export let selectedModels;
@ -112,16 +111,6 @@
class=" flex cursor-pointer px-2 py-2 rounded-xl hover:bg-gray-50 dark:hover:bg-gray-850 transition" class=" flex cursor-pointer px-2 py-2 rounded-xl hover:bg-gray-50 dark:hover:bg-gray-850 transition"
on:click={async () => { on:click={async () => {
await showControls.set(!$showControls); await showControls.set(!$showControls);
if (controlPane) {
if ($showControls) {
controlPane.resize(
parseInt(localStorage.getItem('chat-controls-size') || '35')
);
} else {
controlPane.resize(0);
}
}
}} }}
aria-label="Controls" aria-label="Controls"
> >