mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-28 10:12:11 +00:00
add aria labels on vue node widgets (2/2) (#6037)
## Summary Continuation of https://github.com/Comfy-Org/ComfyUI_frontend/pull/6032 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6037-add-aria-labels-on-vue-node-widgets-2-2-28b6d73d365081d68795f5dfaca0b89a) by [Unito](https://www.unito.io)
This commit is contained in:
@@ -17,6 +17,11 @@
|
|||||||
"chart": "Chart",
|
"chart": "Chart",
|
||||||
"chartLowercase": "chart",
|
"chartLowercase": "chart",
|
||||||
"file": "file",
|
"file": "file",
|
||||||
|
"selectedFile": "Selected file",
|
||||||
|
"none": "None",
|
||||||
|
"markdown": "markdown",
|
||||||
|
"content": "content",
|
||||||
|
"audioProgress": "Audio progress",
|
||||||
"viewImageOfTotal": "View image {index} of {total}",
|
"viewImageOfTotal": "View image {index} of {total}",
|
||||||
"viewVideoOfTotal": "View video {index} of {total}",
|
"viewVideoOfTotal": "View video {index} of {total}",
|
||||||
"imagePreview": "Image preview - Use arrow keys to navigate between images",
|
"imagePreview": "Image preview - Use arrow keys to navigate between images",
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
:model-value="selectedFile?.name"
|
:model-value="selectedFile?.name"
|
||||||
:options="[selectedFile?.name || '']"
|
:options="[selectedFile?.name || '']"
|
||||||
:disabled="true"
|
:disabled="true"
|
||||||
|
:aria-label="`${$t('g.selectedFile')}: ${selectedFile?.name || $t('g.none')}`"
|
||||||
v-bind="transformCompatProps"
|
v-bind="transformCompatProps"
|
||||||
class="max-w-[20em] min-w-[8em] text-xs"
|
class="max-w-[20em] min-w-[8em] text-xs"
|
||||||
size="small"
|
size="small"
|
||||||
@@ -89,6 +90,7 @@
|
|||||||
:model-value="selectedFile?.name"
|
:model-value="selectedFile?.name"
|
||||||
:options="[selectedFile?.name || '']"
|
:options="[selectedFile?.name || '']"
|
||||||
:disabled="true"
|
:disabled="true"
|
||||||
|
:aria-label="`${$t('g.selectedFile')}: ${selectedFile?.name || $t('g.none')}`"
|
||||||
v-bind="transformCompatProps"
|
v-bind="transformCompatProps"
|
||||||
class="max-w-[20em] min-w-[8em] text-xs"
|
class="max-w-[20em] min-w-[8em] text-xs"
|
||||||
size="small"
|
size="small"
|
||||||
|
|||||||
@@ -3,7 +3,9 @@ import PrimeVue from 'primevue/config'
|
|||||||
import Textarea from 'primevue/textarea'
|
import Textarea from 'primevue/textarea'
|
||||||
import { describe, expect, it, vi } from 'vitest'
|
import { describe, expect, it, vi } from 'vitest'
|
||||||
import { nextTick } from 'vue'
|
import { nextTick } from 'vue'
|
||||||
|
import { createI18n } from 'vue-i18n'
|
||||||
|
|
||||||
|
import enMessages from '@/locales/en/main.json'
|
||||||
import type { SimplifiedWidget } from '@/types/simplifiedWidget'
|
import type { SimplifiedWidget } from '@/types/simplifiedWidget'
|
||||||
|
|
||||||
import WidgetMarkdown from './WidgetMarkdown.vue'
|
import WidgetMarkdown from './WidgetMarkdown.vue'
|
||||||
@@ -39,9 +41,19 @@ describe('WidgetMarkdown Dual Mode Display', () => {
|
|||||||
modelValue: string,
|
modelValue: string,
|
||||||
readonly = false
|
readonly = false
|
||||||
) => {
|
) => {
|
||||||
|
const i18n = createI18n({
|
||||||
|
legacy: false,
|
||||||
|
locale: 'en',
|
||||||
|
messages: {
|
||||||
|
en: {
|
||||||
|
...enMessages
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
return mount(WidgetMarkdown, {
|
return mount(WidgetMarkdown, {
|
||||||
global: {
|
global: {
|
||||||
plugins: [PrimeVue],
|
plugins: [PrimeVue, i18n],
|
||||||
components: { Textarea }
|
components: { Textarea }
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
v-show="isEditing"
|
v-show="isEditing"
|
||||||
ref="textareaRef"
|
ref="textareaRef"
|
||||||
v-model="localValue"
|
v-model="localValue"
|
||||||
|
:aria-label="`${$t('g.edit')} ${widget.name || $t('g.markdown')} ${$t('g.content')}`"
|
||||||
class="absolute inset-0 min-h-[60px] w-full resize-none"
|
class="absolute inset-0 min-h-[60px] w-full resize-none"
|
||||||
:pt="{
|
:pt="{
|
||||||
root: {
|
root: {
|
||||||
|
|||||||
@@ -59,6 +59,7 @@
|
|||||||
min="0"
|
min="0"
|
||||||
max="100"
|
max="100"
|
||||||
step="0.1"
|
step="0.1"
|
||||||
|
:aria-label="$t('g.audioProgress')"
|
||||||
class="absolute inset-0 w-full cursor-pointer opacity-0"
|
class="absolute inset-0 w-full cursor-pointer opacity-0"
|
||||||
@input="handleSeek"
|
@input="handleSeek"
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user