refac: chat navbar menu

This commit is contained in:
Timothy Jaeryang Baek committed 2025-10-26 19:23:55 -07:00
1 parent 82c08a3b5d
commit ed6449d35f
5 files changed
+165 -136

No files matched your search

+18 -15
View File
@@ -19,7 +19,8 @@
user,
settings,
folders,
showEmbeds
showEmbeds,
artifactContents
} from '$lib/stores';
import { flyAndScale } from '$lib/utils/transitions';
import { getChatById } from '$lib/apis/chats';
@@ -312,7 +313,7 @@
<div class="flex items-center">{$i18n.t('Settings')}</div>
</DropdownMenu.Item> -->
{#if $mobile}
{#if $mobile && ($user?.role === 'admin' || ($user?.permissions.chat?.controls ?? true))}
<DropdownMenu.Item
class="flex gap-2 items-center px-3 py-1.5 text-sm cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-xl select-none w-full"
id="chat-controls-button"
@@ -342,19 +343,21 @@
<div class="flex items-center">{$i18n.t('Overview')}</div>
</DropdownMenu.Item>
<DropdownMenu.Item
class="flex gap-2 items-center px-3 py-1.5 text-sm cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-xl select-none w-full"
id="chat-overview-button"
on:click={async () => {
await showControls.set(true);
await showArtifacts.set(true);
await showOverview.set(false);
await showEmbeds.set(false);
}}
>
<Cube className=" size-4" strokeWidth="1.5" />
<div class="flex items-center">{$i18n.t('Artifacts')}</div>
</DropdownMenu.Item>
{#if ($artifactContents ?? []).length > 0}
<DropdownMenu.Item
class="flex gap-2 items-center px-3 py-1.5 text-sm cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-xl select-none w-full"
id="chat-overview-button"
on:click={async () => {
await showControls.set(true);
await showArtifacts.set(true);
await showOverview.set(false);
await showEmbeds.set(false);
}}
>
<Cube className=" size-4" strokeWidth="1.5" />
<div class="flex items-center">{$i18n.t('Artifacts')}</div>
</DropdownMenu.Item>
{/if}
<hr class="border-gray-50 dark:border-gray-800 my-1" />