fix: sidebar menu

This commit is contained in:
Timothy J. Baek 2024-03-18 10:49:39 -07:00
parent c3dd11de16
commit c94d72bca8
2 changed files with 22 additions and 21 deletions

View file

@ -122,6 +122,8 @@
class="flex-grow flex justify-between rounded-xl px-3.5 py-2 hover:bg-gray-900 transition" class="flex-grow flex justify-between rounded-xl px-3.5 py-2 hover:bg-gray-900 transition"
href="/" href="/"
on:click={async () => { on:click={async () => {
selectedChatId = null;
await goto('/'); await goto('/');
const newChatButton = document.getElementById('new-chat-button'); const newChatButton = document.getElementById('new-chat-button');
setTimeout(() => { setTimeout(() => {
@ -164,6 +166,10 @@
<a <a
class="flex-grow flex space-x-3 rounded-xl px-3.5 py-2 hover:bg-gray-900 transition" class="flex-grow flex space-x-3 rounded-xl px-3.5 py-2 hover:bg-gray-900 transition"
href="/modelfiles" href="/modelfiles"
on:click={() => {
selectedChatId = null;
chatId.set('');
}}
> >
<div class="self-center"> <div class="self-center">
<svg <svg
@ -192,6 +198,10 @@
<a <a
class="flex-grow flex space-x-3 rounded-xl px-3.5 py-2 hover:bg-gray-900 transition" class="flex-grow flex space-x-3 rounded-xl px-3.5 py-2 hover:bg-gray-900 transition"
href="/prompts" href="/prompts"
on:click={() => {
selectedChatId = null;
chatId.set('');
}}
> >
<div class="self-center"> <div class="self-center">
<svg <svg
@ -220,6 +230,10 @@
<a <a
class="flex-grow flex space-x-3 rounded-xl px-3.5 py-2 hover:bg-gray-900 transition" class="flex-grow flex space-x-3 rounded-xl px-3.5 py-2 hover:bg-gray-900 transition"
href="/documents" href="/documents"
on:click={() => {
selectedChatId = null;
chatId.set('');
}}
> >
<div class="self-center"> <div class="self-center">
<svg <svg
@ -314,23 +328,6 @@
enrichChatsWithContent($chats); enrichChatsWithContent($chats);
}} }}
/> />
<!-- <div class="self-center pr-3 py-2 bg-gray-900">
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
class="w-4 h-4"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 01-.659 1.591l-5.432 5.432a2.25 2.25 0 00-.659 1.591v2.927a2.25 2.25 0 01-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 00-.659-1.591L3.659 7.409A2.25 2.25 0 013 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0112 3z"
/>
</svg>
</div> -->
</div> </div>
</div> </div>
@ -385,7 +382,9 @@
<div class=" w-full pr-2 relative group"> <div class=" w-full pr-2 relative group">
{#if chatTitleEditId === chat.id} {#if chatTitleEditId === chat.id}
<div <div
class=" w-full flex justify-between rounded-xl px-3 py-2 {chat.id === $chatId class=" w-full flex justify-between rounded-xl px-3 py-2 {chat.id === $chatId ||
chat.id === chatTitleEditId ||
chat.id === chatDeleteId
? 'bg-gray-900' ? 'bg-gray-900'
: chat.id === selectedChatId : chat.id === selectedChatId
? 'bg-gray-950' ? 'bg-gray-950'
@ -395,7 +394,9 @@
</div> </div>
{:else} {:else}
<a <a
class=" w-full flex justify-between rounded-xl px-3 py-2 {chat.id === $chatId class=" w-full flex justify-between rounded-xl px-3 py-2 {chat.id === $chatId ||
chat.id === chatTitleEditId ||
chat.id === chatDeleteId
? 'bg-gray-900' ? 'bg-gray-900'
: chat.id === selectedChatId : chat.id === selectedChatId
? 'bg-gray-950' ? 'bg-gray-950'
@ -420,7 +421,7 @@
<div <div
class=" class="
{chat.id === $chatId {chat.id === $chatId || chat.id === chatTitleEditId || chat.id === chatDeleteId
? ' from-gray-900' ? ' from-gray-900'
: chat.id === selectedChatId : chat.id === selectedChatId
? 'from-gray-950' ? 'from-gray-950'

View file

@ -26,7 +26,7 @@
<div slot="content"> <div slot="content">
<DropdownMenu.Content <DropdownMenu.Content
class="w-full max-w-[130px] rounded-lg px-1 py-1.5 border border-gray-700/50 z-50 bg-gray-850 text-white" class="w-full max-w-[130px] rounded-lg px-1 py-1.5 border border-gray-700/50 z-50 bg-gray-850 text-white"
sideOffset={8} sideOffset={-2}
side="bottom" side="bottom"
align="start" align="start"
> >