Merge pull request #16186 from itk-dev/feature/user-menu-tab-order-and-menu-item-accessibility
FEAT: user menu tab order and menu item accessibility
This commit is contained in:
commit
b378ac1f57
|
@ -68,7 +68,6 @@
|
|||
let shiftKey = false;
|
||||
|
||||
let selectedChatId = null;
|
||||
let showDropdown = false;
|
||||
let showPinnedChat = true;
|
||||
|
||||
let showCreateChannel = false;
|
||||
|
@ -1035,21 +1034,19 @@
|
|||
}
|
||||
}}
|
||||
>
|
||||
<button
|
||||
<div
|
||||
class=" flex items-center rounded-xl py-2.5 px-2.5 w-full hover:bg-gray-100 dark:hover:bg-gray-900 transition"
|
||||
on:click={() => {
|
||||
showDropdown = !showDropdown;
|
||||
}}
|
||||
>
|
||||
<div class=" self-center mr-3">
|
||||
<img
|
||||
src={$user?.profile_image_url}
|
||||
class=" max-w-[30px] object-cover rounded-full"
|
||||
alt="User profile"
|
||||
alt={$i18n.t('Open User Profile Menu')}
|
||||
aria-label={$i18n.t('Open User Profile Menu')}
|
||||
/>
|
||||
</div>
|
||||
<div class=" self-center font-medium">{$user?.name}</div>
|
||||
</button>
|
||||
</div>
|
||||
</UserMenu>
|
||||
{/if}
|
||||
</div>
|
||||
|
|
|
@ -105,9 +105,10 @@
|
|||
</DropdownMenu.Item>
|
||||
|
||||
{#if role === 'admin'}
|
||||
<a
|
||||
class="flex rounded-md py-1.5 px-3 w-full hover:bg-gray-50 dark:hover:bg-gray-800 transition select-none"
|
||||
<DropdownMenu.Item
|
||||
as="a"
|
||||
href="/playground"
|
||||
class="flex rounded-md py-1.5 px-3 w-full hover:bg-gray-50 dark:hover:bg-gray-800 transition select-none"
|
||||
on:click={() => {
|
||||
show = false;
|
||||
if ($mobile) {
|
||||
|
@ -119,11 +120,11 @@
|
|||
<Code className="size-5" strokeWidth="1.5" />
|
||||
</div>
|
||||
<div class=" self-center truncate">{$i18n.t('Playground')}</div>
|
||||
</a>
|
||||
|
||||
<a
|
||||
class="flex rounded-md py-1.5 px-3 w-full hover:bg-gray-50 dark:hover:bg-gray-800 transition select-none"
|
||||
</DropdownMenu.Item>
|
||||
<DropdownMenu.Item
|
||||
as="a"
|
||||
href="/admin"
|
||||
class="flex rounded-md py-1.5 px-3 w-full hover:bg-gray-50 dark:hover:bg-gray-800 transition select-none"
|
||||
on:click={() => {
|
||||
show = false;
|
||||
if ($mobile) {
|
||||
|
@ -135,39 +136,40 @@
|
|||
<UserGroup className="w-5 h-5" strokeWidth="1.5" />
|
||||
</div>
|
||||
<div class=" self-center truncate">{$i18n.t('Admin Panel')}</div>
|
||||
</a>
|
||||
</DropdownMenu.Item>
|
||||
{/if}
|
||||
|
||||
{#if help}
|
||||
<hr class=" border-gray-100 dark:border-gray-800 my-1 p-0" />
|
||||
|
||||
<!-- {$i18n.t('Help')} -->
|
||||
<a
|
||||
|
||||
<DropdownMenu.Item
|
||||
as="a"
|
||||
class="flex gap-2 items-center py-1.5 px-3 text-sm select-none w-full cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-md transition"
|
||||
id="chat-share-button"
|
||||
href="https://docs.openwebui.com"
|
||||
target="_blank"
|
||||
on:click={() => {
|
||||
show = false;
|
||||
}}
|
||||
href="https://docs.openwebui.com'"
|
||||
>
|
||||
<QuestionMarkCircle className="size-5" />
|
||||
<div class="flex items-center">{$i18n.t('Documentation')}</div>
|
||||
</a>
|
||||
</DropdownMenu.Item>
|
||||
|
||||
<!-- Releases -->
|
||||
<a
|
||||
<DropdownMenu.Item
|
||||
as="a"
|
||||
class="flex gap-2 items-center py-1.5 px-3 text-sm select-none w-full cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-md transition"
|
||||
id="menu-item-releases"
|
||||
href="https://github.com/open-webui/open-webui/releases"
|
||||
target="_blank"
|
||||
id="chat-share-button"
|
||||
on:click={() => {
|
||||
show = false;
|
||||
}}
|
||||
href="https://github.com/open-webui/"
|
||||
>
|
||||
<Map className="size-5" />
|
||||
<div class="flex items-center">{$i18n.t('Releases')}</div>
|
||||
</a>
|
||||
</DropdownMenu.Item>
|
||||
|
||||
<DropdownMenu.Item
|
||||
class="flex gap-2 items-center py-1.5 px-3 text-sm select-none w-full cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-md transition cursor-pointer"
|
||||
|
@ -184,7 +186,7 @@
|
|||
|
||||
<hr class=" border-gray-100 dark:border-gray-800 my-1 p-0" />
|
||||
|
||||
<button
|
||||
<DropdownMenu.Item
|
||||
class="flex rounded-md py-1.5 px-3 w-full hover:bg-gray-50 dark:hover:bg-gray-800 transition"
|
||||
on:click={async () => {
|
||||
const res = await userSignOut();
|
||||
|
@ -199,7 +201,7 @@
|
|||
<SignOut className="w-5 h-5" strokeWidth="1.5" />
|
||||
</div>
|
||||
<div class=" self-center truncate">{$i18n.t('Sign Out')}</div>
|
||||
</button>
|
||||
</DropdownMenu.Item>
|
||||
|
||||
{#if usage}
|
||||
{#if usage?.user_ids?.length > 0}
|
||||
|
|
Loading…
Reference in New Issue