fix(ui): accessible names on fields that had only placeholders (#1736)
Step editor fields (lead, compact rows, long/YAML textareas and the compact boolean switch), the org policy editor (policy id, level, workspace id, object kind/id, Cedar textarea), the binding constant value input, the log search and the channel tags inputs now each carry an aria-label. On TagsInput the aria-label moved from the root div, where screen readers never reach it, onto the actual TagsInputInput.
This commit is contained in:
5 files changed
+20
-12
No files matched your search
@@ -260,6 +260,7 @@ const title = computed(() => (props.binding ? "Edit binding" : "New binding"));
|
||||
v-if="!inputDraft(name).param"
|
||||
v-model="inputDraft(name).value"
|
||||
class="font-mono text-xs"
|
||||
:aria-label="`${name} value`"
|
||||
placeholder="value"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -191,12 +191,12 @@ function setModels(list: string[]) {
|
||||
<FieldDescription>Everyone else is ignored.</FieldDescription>
|
||||
</FieldContent>
|
||||
<div class="flex min-w-0 flex-wrap items-center gap-3 @md/field-group:flex-1">
|
||||
<TagsInput :model-value="allowedUsers" aria-label="Allowed users" class="font-mono" @update:model-value="(ids) => setAllowedUsers(ids.map(String))">
|
||||
<TagsInput :model-value="allowedUsers" class="font-mono" @update:model-value="(ids) => setAllowedUsers(ids.map(String))">
|
||||
<TagsInputItem v-for="id in allowedUsers" :key="id" :value="id">
|
||||
<TagsInputItemText />
|
||||
<TagsInputItemDelete />
|
||||
</TagsInputItem>
|
||||
<TagsInputInput placeholder="Add user ID" />
|
||||
<TagsInputInput placeholder="Add user ID" aria-label="Allowed users" />
|
||||
</TagsInput>
|
||||
</div>
|
||||
</Field>
|
||||
@@ -287,12 +287,12 @@ function setModels(list: string[]) {
|
||||
<FieldDescription>Empty: role models.</FieldDescription>
|
||||
</FieldContent>
|
||||
<div class="flex min-w-0 flex-wrap items-center gap-3 @md/field-group:flex-1">
|
||||
<TagsInput :model-value="models" aria-label="Models" class="font-mono" @update:model-value="(list) => setModels(list.map(String))">
|
||||
<TagsInput :model-value="models" class="font-mono" @update:model-value="(list) => setModels(list.map(String))">
|
||||
<TagsInputItem v-for="model in models" :key="model" :value="model">
|
||||
<TagsInputItemText />
|
||||
<TagsInputItemDelete />
|
||||
</TagsInputItem>
|
||||
<TagsInputInput placeholder="provider/model" />
|
||||
<TagsInputInput placeholder="provider/model" aria-label="Models" />
|
||||
</TagsInput>
|
||||
</div>
|
||||
</Field>
|
||||
|
||||
@@ -114,6 +114,7 @@ onUnmounted(() => clearTimeout(searchTimer));
|
||||
<Input
|
||||
v-model="search"
|
||||
type="search"
|
||||
aria-label="Search messages and fields"
|
||||
placeholder="Search messages and fields…"
|
||||
class="min-w-0 flex-1 md:max-w-56"
|
||||
/>
|
||||
|
||||
@@ -137,9 +137,9 @@ onMounted(load);
|
||||
<Section v-if="editing" :title="draft.id ? draft.id : 'New policy'">
|
||||
<div class="flex flex-col gap-3">
|
||||
<div class="flex flex-wrap gap-2">
|
||||
<Input v-model="draft.id" placeholder="policy id" class="w-56" />
|
||||
<Input v-model="draft.id" placeholder="policy id" aria-label="Policy id" class="w-56" />
|
||||
<Select v-model="draft.level">
|
||||
<SelectTrigger class="w-40"><SelectValue /></SelectTrigger>
|
||||
<SelectTrigger class="w-40" aria-label="Level"><SelectValue /></SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="instance">instance</SelectItem>
|
||||
<SelectItem value="org">org</SelectItem>
|
||||
@@ -151,16 +151,18 @@ onMounted(load);
|
||||
v-if="draft.level === 'workspace'"
|
||||
v-model="draft.workspace_id"
|
||||
placeholder="workspace id"
|
||||
aria-label="Workspace id"
|
||||
class="w-48"
|
||||
/>
|
||||
<template v-if="draft.level === 'object'">
|
||||
<Input v-model="draft.object_kind" placeholder="kind (secret, source...)" class="w-48" />
|
||||
<Input v-model="draft.object_id" placeholder="object id" class="w-48" />
|
||||
<Input v-model="draft.object_kind" placeholder="kind (secret, source...)" aria-label="Object kind" class="w-48" />
|
||||
<Input v-model="draft.object_id" placeholder="object id" aria-label="Object id" class="w-48" />
|
||||
</template>
|
||||
</div>
|
||||
<Textarea
|
||||
v-model="draft.text"
|
||||
class="min-h-40 font-mono text-xs"
|
||||
aria-label="Cedar policy"
|
||||
placeholder='permit(principal, action == Archie::Action::"read", resource);'
|
||||
/>
|
||||
<div class="flex gap-2">
|
||||
|
||||
@@ -186,6 +186,7 @@ const ON_FAILURE = [{ value: "", label: "Park the task" }, { value: "continue",
|
||||
<Textarea
|
||||
v-else-if="fields.lead.kind === 'text'"
|
||||
:model-value="text(fields.lead.key)"
|
||||
:aria-label="label(fields.lead.key, fields.lead.schema)"
|
||||
class="min-h-32 text-label leading-relaxed"
|
||||
@focus="focused = fields.lead.key"
|
||||
@update:model-value="setSetting(fields.lead.key, String($event))"
|
||||
@@ -193,6 +194,7 @@ const ON_FAILURE = [{ value: "", label: "Park the task" }, { value: "continue",
|
||||
<Input
|
||||
v-else
|
||||
:model-value="text(fields.lead.key)"
|
||||
:aria-label="label(fields.lead.key, fields.lead.schema)"
|
||||
@focus="focused = fields.lead.key"
|
||||
@update:model-value="setSetting(fields.lead.key, String($event))"
|
||||
/>
|
||||
@@ -216,16 +218,17 @@ const ON_FAILURE = [{ value: "", label: "Park the task" }, { value: "continue",
|
||||
<CircleHelp v-if="field.schema.description" class="size-3 text-fg-subtle" />
|
||||
</span>
|
||||
<WorkflowPicker v-if="field.kind === 'workflow'" :editable="type !== 'workflow.call'" class="max-w-48" :value="text(field.key)" :workflows="workflows" :label="label(field.key, field.schema)" @pick="setTarget(field.key, $event)" />
|
||||
<Switch v-else-if="field.kind === 'boolean'" :model-value="settings[field.key] === true" @update:model-value="setSetting(field.key, $event || undefined)" />
|
||||
<Switch v-else-if="field.kind === 'boolean'" :model-value="settings[field.key] === true" :aria-label="label(field.key, field.schema)" @update:model-value="setSetting(field.key, $event || undefined)" />
|
||||
<OptionSelect v-else-if="field.kind === 'select'" class="w-40" :model-value="text(field.key)" :options="choices(field.options)" :aria-label="label(field.key, field.schema)" @update:model-value="setSetting(field.key, $event || undefined)" />
|
||||
<Input
|
||||
v-else-if="field.kind === 'number'"
|
||||
type="number"
|
||||
class="h-8 w-24 text-right text-label"
|
||||
:model-value="(settings[field.key] as number | undefined) ?? ''"
|
||||
:aria-label="label(field.key, field.schema)"
|
||||
@update:model-value="(value) => setSetting(field.key, String(value) === '' ? undefined : Number(String(value)))"
|
||||
/>
|
||||
<Input v-else class="h-8 w-40 text-label" :model-value="text(field.key)" @focus="focused = field.key" @update:model-value="(value) => setSetting(field.key, String(value))" />
|
||||
<Input v-else class="h-8 w-40 text-label" :model-value="text(field.key)" :aria-label="label(field.key, field.schema)" @focus="focused = field.key" @update:model-value="(value) => setSetting(field.key, String(value))" />
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -261,16 +264,17 @@ const ON_FAILURE = [{ value: "", label: "Park the task" }, { value: "continue",
|
||||
{{ label(field.key, field.schema) }}
|
||||
<CircleHelp v-if="field.schema.description" class="size-3 text-fg-subtle" />
|
||||
</div>
|
||||
<Textarea v-if="field.kind === 'text'" :model-value="text(field.key)" class="min-h-20 text-label" @focus="focused = field.key" @update:model-value="setSetting(field.key, String($event))" />
|
||||
<Textarea v-if="field.kind === 'text'" :model-value="text(field.key)" :aria-label="label(field.key, field.schema)" class="min-h-20 text-label" @focus="focused = field.key" @update:model-value="setSetting(field.key, String($event))" />
|
||||
<Textarea
|
||||
v-else-if="field.kind === 'lines'"
|
||||
:model-value="Array.isArray(settings[field.key]) ? (settings[field.key] as string[]).join('\n') : ''"
|
||||
:aria-label="label(field.key, field.schema)"
|
||||
class="min-h-16 font-mono text-xs"
|
||||
placeholder="One per line"
|
||||
@update:model-value="setSetting(field.key, String($event).split('\n').filter(Boolean))"
|
||||
/>
|
||||
<template v-else>
|
||||
<Textarea :model-value="asYaml(settings[field.key])" class="min-h-24 font-mono text-xs" placeholder="YAML" @change="setYamlSetting(field.key, ($event.target as HTMLTextAreaElement).value)" />
|
||||
<Textarea :model-value="asYaml(settings[field.key])" :aria-label="label(field.key, field.schema)" class="min-h-24 font-mono text-xs" placeholder="YAML" @change="setYamlSetting(field.key, ($event.target as HTMLTextAreaElement).value)" />
|
||||
<span v-if="yamlErrors[field.key]" class="text-xs text-danger">{{ yamlErrors[field.key] }}</span>
|
||||
</template>
|
||||
</section>
|
||||
|
||||
Reference in new issue
Block a user