mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-17 03:03:27 -06:00
fix(a11y): 25 fields, switches and buttons with no name, or only a placeholder, have names (#33471)
This commit is contained in:
@@ -335,9 +335,11 @@
|
||||
<AdminSettingField
|
||||
label={$i18n.t('settings.admin.pipelines.githubUrl.label')}
|
||||
description={`${$i18n.t('Pipelines are a plugin system with arbitrary code execution.')} ${$i18n.t("Don't fetch random pipelines from sources you don't trust.")}`}
|
||||
forId="pipelines-github-url"
|
||||
>
|
||||
<div class="flex gap-2">
|
||||
<input
|
||||
id="pipelines-github-url"
|
||||
class={inputClass}
|
||||
placeholder={$i18n.t('Enter GitHub Raw URL')}
|
||||
bind:value={pipelineDownloadUrl}
|
||||
|
||||
@@ -205,6 +205,7 @@
|
||||
|
||||
<div class="px-1.5 py-0.5">
|
||||
<select
|
||||
aria-label={$i18n.t('Schedule')}
|
||||
class="w-full h-[1.6875rem] bg-transparent rounded-xl text-[0.8125rem] px-1.5 outline-hidden"
|
||||
bind:value={frequency}
|
||||
on:click={(e) => e.stopPropagation()}
|
||||
@@ -244,6 +245,7 @@
|
||||
</div>
|
||||
<div class="flex items-center gap-1.5">
|
||||
<input
|
||||
aria-label={$i18n.t('Time')}
|
||||
type="time"
|
||||
bind:value={onceTime}
|
||||
class="bg-transparent outline-hidden text-xs dark:scheme-dark"
|
||||
@@ -255,6 +257,7 @@
|
||||
<div class="flex items-center gap-1.5">
|
||||
<span class="text-xs text-gray-500 mr-0.5">{$i18n.t('Time')}</span>
|
||||
<input
|
||||
aria-label={$i18n.t('Time')}
|
||||
type="time"
|
||||
value={`${String(hour).padStart(2, '0')}:${String(minute).padStart(2, '0')}`}
|
||||
on:input={(e) => {
|
||||
@@ -273,6 +276,7 @@
|
||||
<div class="flex items-center gap-1.5">
|
||||
<span class="text-xs text-gray-500">{$i18n.t('Day')}</span>
|
||||
<input
|
||||
aria-label={$i18n.t('Day')}
|
||||
type="number"
|
||||
bind:value={monthDay}
|
||||
min={1}
|
||||
|
||||
@@ -567,6 +567,7 @@
|
||||
<Textarea
|
||||
className=" bg-transparent outline-hidden w-full resize-none text-sm leading-[1.375rem]"
|
||||
bind:value={editedContent}
|
||||
ariaLabel={$i18n.t('Message')}
|
||||
onKeydown={(e) => {
|
||||
if (e.key === 'Escape') {
|
||||
document.getElementById('close-edit-message-button')?.click();
|
||||
|
||||
@@ -245,6 +245,7 @@
|
||||
{$i18n.t('Other')}
|
||||
</div>
|
||||
<input
|
||||
aria-label={$i18n.t('Other')}
|
||||
dir={$settings?.chatDirection ?? 'auto'}
|
||||
class="min-w-0 flex-1 bg-transparent text-xs text-gray-800 outline-hidden placeholder:text-gray-400 dark:text-gray-100 dark:placeholder:text-gray-500"
|
||||
placeholder={$i18n.t('Type your answer')}
|
||||
|
||||
@@ -452,6 +452,7 @@
|
||||
{#if renaming}
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<input
|
||||
aria-label={$i18n.t('Rename')}
|
||||
bind:this={renameInput}
|
||||
bind:value={renameValue}
|
||||
class="flex-1 text-xs bg-transparent outline-hidden text-gray-800 dark:text-gray-200 min-w-0 {variant ===
|
||||
|
||||
@@ -542,6 +542,7 @@
|
||||
</div>
|
||||
{:else if editing}
|
||||
<textarea
|
||||
aria-label={$i18n.t('File content')}
|
||||
bind:this={editTextarea}
|
||||
bind:value={editContent}
|
||||
class="w-full h-full text-xs font-mono text-gray-800 dark:text-gray-200 whitespace-pre break-all leading-relaxed p-3 bg-transparent border-none outline-none resize-none"
|
||||
|
||||
@@ -283,6 +283,7 @@
|
||||
{#if editingCell[i]}
|
||||
<!-- svelte-ignore a11y-autofocus -->
|
||||
<textarea
|
||||
aria-label={$i18n.t('Markdown')}
|
||||
class="nb-edit-textarea text-sm"
|
||||
bind:value={editedSources[i]}
|
||||
on:input={autoResize}
|
||||
|
||||
@@ -201,6 +201,7 @@
|
||||
<!-- URL bar -->
|
||||
<form class="flex-1 min-w-0" on:submit|preventDefault={navigateUrl}>
|
||||
<input
|
||||
aria-label={$i18n.t('URL')}
|
||||
type="text"
|
||||
bind:value={urlInput}
|
||||
class="w-full text-[0.6875rem] font-mono bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-full px-3 py-1 outline-hidden focus:border-gray-400 dark:focus:border-gray-500 text-gray-600 dark:text-gray-300 transition"
|
||||
|
||||
@@ -271,6 +271,7 @@
|
||||
<div class="flex-1 min-w-0">
|
||||
{#if di.type === 'message'}
|
||||
<textarea
|
||||
aria-label={$i18n.t('Text')}
|
||||
use:fitContent
|
||||
class="w-full bg-transparent outline-hidden focus-visible:outline-none! resize-none overflow-hidden text-[0.9375rem] p-1.5 rounded-lg"
|
||||
value={getMessageText(di.item)}
|
||||
@@ -283,6 +284,7 @@
|
||||
/>
|
||||
{:else if di.type === 'reasoning'}
|
||||
<textarea
|
||||
aria-label={$i18n.t('Thought')}
|
||||
use:fitContent
|
||||
class="w-full bg-transparent outline-hidden focus-visible:outline-none! resize-none overflow-hidden text-[0.9375rem] text-gray-500 dark:text-gray-400 p-1.5 rounded-lg"
|
||||
value={getReasoningText(di.item)}
|
||||
|
||||
@@ -794,6 +794,7 @@
|
||||
{:else}
|
||||
<!-- Legacy textarea for messages without output -->
|
||||
<textarea
|
||||
aria-label={$i18n.t('Message')}
|
||||
id="message-edit-{message.id}"
|
||||
bind:this={editTextAreaElement}
|
||||
class=" bg-transparent outline-hidden focus-visible:outline-none! w-full resize-none text-[0.9375rem]"
|
||||
|
||||
@@ -319,6 +319,7 @@
|
||||
|
||||
<div class="max-h-96 overflow-auto" bind:this={editScrollContainer}>
|
||||
<textarea
|
||||
aria-label={$i18n.t('Message')}
|
||||
id="message-edit-{message.id}"
|
||||
bind:this={messageEditTextAreaElement}
|
||||
class=" bg-transparent outline-hidden focus-visible:outline-none! w-full resize-none text-[0.9375rem]"
|
||||
|
||||
@@ -193,7 +193,11 @@
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-1.5">
|
||||
<input type="checkbox" bind:checked={deleteFolderContents} />
|
||||
<input
|
||||
aria-label={$i18n.t('Delete all contents inside this folder')}
|
||||
type="checkbox"
|
||||
bind:checked={deleteFolderContents}
|
||||
/>
|
||||
|
||||
<div class="text-xs text-gray-500">
|
||||
{$i18n.t('Delete all contents inside this folder')}
|
||||
|
||||
@@ -82,6 +82,7 @@
|
||||
<Tooltip content={(config?.enable ?? true) ? $i18n.t('Enabled') : $i18n.t('Disabled')}>
|
||||
<Switch
|
||||
bind:state={config.enable}
|
||||
ariaLabel={$i18n.t('Enabled')}
|
||||
on:change={() => {
|
||||
config.enable = config.enable ?? false;
|
||||
onSubmit({ url, key, config });
|
||||
|
||||
@@ -671,6 +671,7 @@
|
||||
: ''}"
|
||||
>
|
||||
<input
|
||||
aria-label={$i18n.t('Rename')}
|
||||
id="chat-title-input-{id}"
|
||||
bind:value={chatTitle}
|
||||
class=" bg-transparent w-full outline-hidden mr-10"
|
||||
|
||||
@@ -716,7 +716,11 @@
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-1.5">
|
||||
<input type="checkbox" bind:checked={deleteFolderContents} />
|
||||
<input
|
||||
aria-label={$i18n.t('Delete all contents inside this folder')}
|
||||
type="checkbox"
|
||||
bind:checked={deleteFolderContents}
|
||||
/>
|
||||
|
||||
<div class="text-xs text-gray-500">
|
||||
{$i18n.t('Delete all contents inside this folder')}
|
||||
@@ -821,6 +825,7 @@
|
||||
>
|
||||
{#if edit}
|
||||
<input
|
||||
aria-label={$i18n.t('Rename')}
|
||||
id="folder-{folderId}-input"
|
||||
type="text"
|
||||
bind:value={name}
|
||||
|
||||
@@ -169,32 +169,37 @@
|
||||
{#if profile}
|
||||
{#if $user?.status_emoji || $user?.status_message}
|
||||
<div class="user-menu-status">
|
||||
<button
|
||||
role="menuitem"
|
||||
class="w-full h-[1.6875rem] gap-2 rounded-xl px-2 hover:bg-gray-50/60 dark:hover:bg-gray-800/60 transition cursor-pointer select-none text-xs flex items-center text-left"
|
||||
type="button"
|
||||
on:click={() => {
|
||||
show = false;
|
||||
showUserStatusModal = true;
|
||||
}}
|
||||
<div
|
||||
class="user-menu-row flex items-center w-full rounded-xl hover:bg-gray-50/60 dark:hover:bg-gray-800/60 transition-colors"
|
||||
>
|
||||
{#if $user?.status_emoji}
|
||||
<div class="self-center shrink-0 size-4.5 flex items-center justify-center">
|
||||
<Emoji className="size-3.5" shortCode={$user?.status_emoji} />
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<Tooltip
|
||||
content={$user?.status_message}
|
||||
className="self-center line-clamp-2 flex-1 text-left"
|
||||
<button
|
||||
role="menuitem"
|
||||
class="flex flex-1 min-w-0 h-[1.6875rem] gap-2 rounded-xl px-2 cursor-pointer select-none text-xs items-center text-left"
|
||||
type="button"
|
||||
on:click={() => {
|
||||
show = false;
|
||||
showUserStatusModal = true;
|
||||
}}
|
||||
>
|
||||
{$user?.status_message}
|
||||
</Tooltip>
|
||||
{#if $user?.status_emoji}
|
||||
<div class="self-center shrink-0 size-4.5 flex items-center justify-center">
|
||||
<Emoji className="size-3.5" shortCode={$user?.status_emoji} />
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div class="self-center">
|
||||
<Tooltip
|
||||
content={$user?.status_message}
|
||||
className="self-center line-clamp-2 flex-1 text-left"
|
||||
>
|
||||
{$user?.status_message}
|
||||
</Tooltip>
|
||||
</button>
|
||||
|
||||
<div class="self-center mr-2">
|
||||
<Tooltip content={$i18n.t('Clear status')}>
|
||||
<button
|
||||
role="menuitem"
|
||||
aria-label={$i18n.t('Clear status')}
|
||||
class="flex size-5 items-center justify-center"
|
||||
type="button"
|
||||
on:click={async (e) => {
|
||||
@@ -219,7 +224,7 @@
|
||||
</button>
|
||||
</Tooltip>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{:else}
|
||||
<div class="user-menu-status">
|
||||
|
||||
@@ -124,6 +124,7 @@
|
||||
</EmojiPicker>
|
||||
|
||||
<input
|
||||
aria-label={$i18n.t('Status')}
|
||||
id="status-message"
|
||||
type="text"
|
||||
bind:value={message}
|
||||
|
||||
@@ -1097,6 +1097,7 @@
|
||||
<div class="text-xs">{$i18n.t('Test Query')}</div>
|
||||
<div class="flex gap-2">
|
||||
<input
|
||||
aria-label={$i18n.t('Test Query')}
|
||||
class="w-full text-xs rounded-xl bg-gray-50 dark:bg-gray-850 px-3 py-2 outline-hidden"
|
||||
bind:value={externalTestQuery}
|
||||
placeholder={$i18n.t('Ask this knowledge source a test question')}
|
||||
|
||||
@@ -74,6 +74,7 @@
|
||||
|
||||
<div class=" flex-1 w-full h-full">
|
||||
<textarea
|
||||
aria-label={$i18n.t('Content')}
|
||||
class="w-full h-full min-h-[12.5rem] bg-transparent outline-none resize-none text-base leading-relaxed placeholder:text-gray-300 dark:placeholder:text-gray-600"
|
||||
bind:value={content}
|
||||
placeholder={$i18n.t('Write something...')}
|
||||
|
||||
@@ -1799,6 +1799,7 @@
|
||||
{#if showPreview}
|
||||
<div class="pt-2">
|
||||
<textarea
|
||||
aria-label={$i18n.t('JSON Preview')}
|
||||
class="w-full bg-transparent text-xs leading-5 outline-hidden resize-none font-normal text-gray-900 dark:text-gray-100"
|
||||
rows="8"
|
||||
value={JSON.stringify(readOnly ? model : modelInfo, null, 2)}
|
||||
|
||||
Reference in New Issue
Block a user