mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-11 20:05:19 +00:00
Merge pull request #17746 from andrewbbaek/dev
chore: add IDs to elements for better maintainability
This commit is contained in:
commit
4aa5574ba7
7 changed files with 25 additions and 11 deletions
|
|
@ -769,6 +769,7 @@
|
|||
}}
|
||||
>
|
||||
<div
|
||||
id="message-input-container"
|
||||
class="flex-1 flex flex-col relative w-full shadow-lg rounded-3xl border border-gray-50 dark:border-gray-850 hover:border-gray-100 focus-within:border-gray-100 hover:dark:border-gray-800 focus-within:dark:border-gray-800 transition px-1 bg-white/90 dark:bg-gray-400/5 dark:text-gray-100"
|
||||
dir={$settings?.chatDirection ?? 'auto'}
|
||||
>
|
||||
|
|
@ -941,6 +942,7 @@
|
|||
}}
|
||||
>
|
||||
<button
|
||||
id="input-menu-button"
|
||||
class="bg-transparent hover:bg-white/80 text-gray-800 dark:text-white dark:hover:bg-gray-800 transition rounded-full p-1.5 outline-hidden focus:outline-hidden"
|
||||
type="button"
|
||||
aria-label="More"
|
||||
|
|
|
|||
|
|
@ -1030,6 +1030,7 @@
|
|||
}}
|
||||
>
|
||||
<div
|
||||
id="message-input-container"
|
||||
class="flex-1 flex flex-col relative w-full shadow-lg rounded-3xl border {$temporaryChatEnabled
|
||||
? 'border-dashed border-gray-100 dark:border-gray-800 hover:border-gray-200 focus-within:border-gray-200 hover:dark:border-gray-700 focus-within:dark:border-gray-700'
|
||||
: ' border-gray-100 dark:border-gray-850 hover:border-gray-200 focus-within:border-gray-100 hover:dark:border-gray-800 focus-within:dark:border-gray-800'} transition px-1 bg-white/5 dark:bg-gray-500/5 backdrop-blur-sm dark:text-gray-100"
|
||||
|
|
@ -1425,6 +1426,7 @@
|
|||
}}
|
||||
>
|
||||
<div
|
||||
id="input-menu-button"
|
||||
class="bg-transparent hover:bg-gray-100 text-gray-700 dark:text-white dark:hover:bg-gray-800 rounded-full size-8 flex justify-center items-center outline-hidden focus:outline-hidden"
|
||||
>
|
||||
<PlusAlt className="size-5.5" />
|
||||
|
|
@ -1455,6 +1457,7 @@
|
|||
}}
|
||||
>
|
||||
<div
|
||||
id="integration-menu-button"
|
||||
class="bg-transparent hover:bg-gray-100 text-gray-700 dark:text-white dark:hover:bg-gray-800 rounded-full size-8 flex justify-center items-center outline-hidden focus:outline-hidden"
|
||||
>
|
||||
<Component className="size-4.5" strokeWidth="1.5" />
|
||||
|
|
|
|||
|
|
@ -139,7 +139,8 @@
|
|||
>
|
||||
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
||||
<div
|
||||
class="w-full group rounded-xl relative flex items-center justify-between hover:bg-gray-100 dark:hover:bg-gray-900 transition {buttonClassName}"
|
||||
id="sidebar-folder-button"
|
||||
class=" w-full group rounded-xl relative flex items-center justify-between hover:bg-gray-100 dark:hover:bg-gray-900 transition {buttonClassName}"
|
||||
>
|
||||
<button class="w-full py-1.5 pl-2 flex items-center gap-1.5 text-xs font-medium">
|
||||
{#if chevron}
|
||||
|
|
|
|||
|
|
@ -749,7 +749,7 @@
|
|||
<div
|
||||
class="{scrollTop > 0
|
||||
? 'visible'
|
||||
: 'invisible'} bg-linear-to-b from-gray-50 dark:from-gray-950 to-transparent from-50% pointer-events-none absolute inset-0 -z-10 -mb-6"
|
||||
: 'invisible'} sidebar-bg-gradient-to-b bg-linear-to-b from-gray-50 dark:from-gray-950 to-transparent from-50% pointer-events-none absolute inset-0 -z-10 -mb-6"
|
||||
></div>
|
||||
</div>
|
||||
|
||||
|
|
@ -785,6 +785,7 @@
|
|||
|
||||
<div class="px-[7px] flex justify-center text-gray-800 dark:text-gray-200">
|
||||
<button
|
||||
id="sidebar-search-button"
|
||||
class="grow flex items-center space-x-3 rounded-2xl px-2.5 py-2 hover:bg-gray-100 dark:hover:bg-gray-900 transition outline-none"
|
||||
on:click={() => {
|
||||
showSearch.set(true);
|
||||
|
|
@ -805,6 +806,7 @@
|
|||
{#if ($config?.features?.enable_notes ?? false) && ($user?.role === 'admin' || ($user?.permissions?.features?.notes ?? true))}
|
||||
<div class="px-[7px] flex justify-center text-gray-800 dark:text-gray-200">
|
||||
<a
|
||||
id="sidebar-notes-button"
|
||||
class="grow flex items-center space-x-3 rounded-2xl px-2.5 py-2 hover:bg-gray-100 dark:hover:bg-gray-900 transition"
|
||||
href="/notes"
|
||||
on:click={itemClickHandler}
|
||||
|
|
@ -825,6 +827,7 @@
|
|||
{#if $user?.role === 'admin' || $user?.permissions?.workspace?.models || $user?.permissions?.workspace?.knowledge || $user?.permissions?.workspace?.prompts || $user?.permissions?.workspace?.tools}
|
||||
<div class="px-[7px] flex justify-center text-gray-800 dark:text-gray-200">
|
||||
<a
|
||||
id="sidebar-workspace-button"
|
||||
class="grow flex items-center space-x-3 rounded-2xl px-2.5 py-2 hover:bg-gray-100 dark:hover:bg-gray-900 transition"
|
||||
href="/workspace"
|
||||
on:click={itemClickHandler}
|
||||
|
|
@ -1176,7 +1179,7 @@
|
|||
|
||||
<div class="px-1.5 pt-1.5 pb-2 sticky bottom-0 z-10 -mt-3 sidebar">
|
||||
<div
|
||||
class=" bg-linear-to-t from-gray-50 dark:from-gray-950 to-transparent from-50% pointer-events-none absolute inset-0 -z-10 -mt-6"
|
||||
class=" sidebar-bg-gradient-to-t bg-linear-to-t from-gray-50 dark:from-gray-950 to-transparent from-50% pointer-events-none absolute inset-0 -z-10 -mt-6"
|
||||
></div>
|
||||
<div class="flex flex-col font-primary">
|
||||
{#if $user !== undefined && $user !== null}
|
||||
|
|
|
|||
|
|
@ -44,10 +44,11 @@
|
|||
/>
|
||||
|
||||
<div
|
||||
id="sidebar-channel-item"
|
||||
bind:this={itemElement}
|
||||
class=" w-full {className} rounded-xl flex relative group hover:bg-gray-100 dark:hover:bg-gray-900 {$page
|
||||
.url.pathname === `/channels/${channel.id}`
|
||||
? 'bg-gray-100 dark:bg-gray-900'
|
||||
? 'bg-gray-100 dark:bg-gray-900 selected'
|
||||
: ''} px-2.5 py-1"
|
||||
>
|
||||
<a
|
||||
|
|
|
|||
|
|
@ -336,17 +336,19 @@
|
|||
{/if}
|
||||
|
||||
<div
|
||||
id="sidebar-chat-group"
|
||||
bind:this={itemElement}
|
||||
class=" w-full {className} relative group"
|
||||
draggable={draggable && !confirmEdit}
|
||||
>
|
||||
{#if confirmEdit}
|
||||
<div
|
||||
id="sidebar-chat-item"
|
||||
class=" w-full flex justify-between rounded-xl px-[11px] py-[6px] {id === $chatId ||
|
||||
confirmEdit
|
||||
? 'bg-gray-100 dark:bg-gray-900'
|
||||
? 'bg-gray-100 dark:bg-gray-900 selected'
|
||||
: selected
|
||||
? 'bg-gray-100 dark:bg-gray-950'
|
||||
? 'bg-gray-100 dark:bg-gray-950 selected'
|
||||
: 'group-hover:bg-gray-100 dark:group-hover:bg-gray-950'} whitespace-nowrap text-ellipsis relative {generating
|
||||
? 'cursor-not-allowed'
|
||||
: ''}"
|
||||
|
|
@ -394,11 +396,12 @@
|
|||
</div>
|
||||
{:else}
|
||||
<a
|
||||
id="sidebar-chat-item"
|
||||
class=" w-full flex justify-between rounded-xl px-[11px] py-[6px] {id === $chatId ||
|
||||
confirmEdit
|
||||
? 'bg-gray-100 dark:bg-gray-900'
|
||||
? 'bg-gray-100 dark:bg-gray-900 selected'
|
||||
: selected
|
||||
? 'bg-gray-100 dark:bg-gray-950'
|
||||
? 'bg-gray-100 dark:bg-gray-950 selected'
|
||||
: ' group-hover:bg-gray-100 dark:group-hover:bg-gray-950'} whitespace-nowrap text-ellipsis"
|
||||
href="/c/{id}"
|
||||
on:click={() => {
|
||||
|
|
@ -438,11 +441,12 @@
|
|||
|
||||
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
||||
<div
|
||||
id="sidebar-chat-item-menu"
|
||||
class="
|
||||
{id === $chatId || confirmEdit
|
||||
? 'from-gray-100 dark:from-gray-900'
|
||||
? 'from-gray-100 dark:from-gray-900 selected'
|
||||
: selected
|
||||
? 'from-gray-100 dark:from-gray-950'
|
||||
? 'from-gray-100 dark:from-gray-950 selected'
|
||||
: 'invisible group-hover:visible from-gray-100 dark:from-gray-950'}
|
||||
absolute {className === 'pr-2'
|
||||
? 'right-[8px]'
|
||||
|
|
|
|||
|
|
@ -431,7 +431,7 @@
|
|||
id="folder-{folderId}-button"
|
||||
class="relative w-full py-1 px-1.5 rounded-xl flex items-center gap-1.5 hover:bg-gray-100 dark:hover:bg-gray-900 transition {$selectedFolder?.id ===
|
||||
folderId
|
||||
? 'bg-gray-100 dark:bg-gray-900'
|
||||
? 'bg-gray-100 dark:bg-gray-900 selected'
|
||||
: ''}"
|
||||
on:dblclick={(e) => {
|
||||
if (clickTimer) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue