Merge pull request #953 from open-webui/dev

fix: title edit issue
This commit is contained in:
Timothy Jaeryang Baek 2024-02-28 01:36:32 -05:00 committed by GitHub
commit 776b463ff3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -366,28 +366,34 @@
} }
}) as chat, i} }) as chat, i}
<div class=" w-full pr-2 relative"> <div class=" w-full pr-2 relative">
<a {#if chatTitleEditId === chat.id}
class=" w-full flex justify-between rounded-xl px-3 py-2 hover:bg-gray-900 {chat.id === <div
$chatId class=" w-full flex justify-between rounded-xl px-3 py-2 hover:bg-gray-900 {chat.id ===
? 'bg-gray-900' $chatId
: ''} transition whitespace-nowrap text-ellipsis" ? 'bg-gray-900'
href="/c/{chat.id}" : ''} transition whitespace-nowrap text-ellipsis"
draggable={isEditing ? 'false' : 'true'} >
> <input bind:value={chatTitle} class=" bg-transparent w-full outline-none mr-10" />
<div class=" flex self-center flex-1 w-full">
<div
class=" text-left self-center overflow-hidden {chat.id === $chatId
? 'w-[160px]'
: 'w-full'} "
>
{#if chatTitleEditId === chat.id}
<input bind:value={chatTitle} class=" bg-transparent w-full" />
{:else}
{chat.title}
{/if}
</div>
</div> </div>
</a> {:else}
<a
class=" w-full flex justify-between rounded-xl px-3 py-2 hover:bg-gray-900 {chat.id ===
$chatId
? 'bg-gray-900'
: ''} transition whitespace-nowrap text-ellipsis"
href="/c/{chat.id}"
>
<div class=" flex self-center flex-1 w-full">
<div
class=" text-left self-center overflow-hidden {chat.id === $chatId
? 'w-[160px]'
: 'w-full'} "
>
{chat.title}
</div>
</div>
</a>
{/if}
{#if chat.id === $chatId} {#if chat.id === $chatId}
<div class=" absolute right-[22px] top-[10px]"> <div class=" absolute right-[22px] top-[10px]">
@ -399,7 +405,6 @@
editChatTitle(chat.id, chatTitle); editChatTitle(chat.id, chatTitle);
chatTitleEditId = null; chatTitleEditId = null;
chatTitle = ''; chatTitle = '';
isEditing = false;
}} }}
> >
<svg <svg
@ -487,7 +492,6 @@
on:click={() => { on:click={() => {
chatTitle = chat.title; chatTitle = chat.title;
chatTitleEditId = chat.id; chatTitleEditId = chat.id;
isEditing = true;
}} }}
> >
<svg <svg