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:
sam committed 2026-11-06 21:43:23 +11:00
1 parent d3fbb0842f
commit c5a43f21aa
5 files changed
+20 -12

No files matched your search

+1
View File
@@ -260,6 +260,7 @@ const title = computed(() => (props.binding ? "Edit binding" : "New binding"));
v-if="!inputDraft(name).param" v-if="!inputDraft(name).param"
v-model="inputDraft(name).value" v-model="inputDraft(name).value"
class="font-mono text-xs" class="font-mono text-xs"
:aria-label="`${name} value`"
placeholder="value" placeholder="value"
/> />
</div> </div>
+4 -4
View File
@@ -191,12 +191,12 @@ function setModels(list: string[]) {
<FieldDescription>Everyone else is ignored.</FieldDescription> <FieldDescription>Everyone else is ignored.</FieldDescription>
</FieldContent> </FieldContent>
<div class="flex min-w-0 flex-wrap items-center gap-3 @md/field-group:flex-1"> <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"> <TagsInputItem v-for="id in allowedUsers" :key="id" :value="id">
<TagsInputItemText /> <TagsInputItemText />
<TagsInputItemDelete /> <TagsInputItemDelete />
</TagsInputItem> </TagsInputItem>
<TagsInputInput placeholder="Add user ID" /> <TagsInputInput placeholder="Add user ID" aria-label="Allowed users" />
</TagsInput> </TagsInput>
</div> </div>
</Field> </Field>
@@ -287,12 +287,12 @@ function setModels(list: string[]) {
<FieldDescription>Empty: role models.</FieldDescription> <FieldDescription>Empty: role models.</FieldDescription>
</FieldContent> </FieldContent>
<div class="flex min-w-0 flex-wrap items-center gap-3 @md/field-group:flex-1"> <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"> <TagsInputItem v-for="model in models" :key="model" :value="model">
<TagsInputItemText /> <TagsInputItemText />
<TagsInputItemDelete /> <TagsInputItemDelete />
</TagsInputItem> </TagsInputItem>
<TagsInputInput placeholder="provider/model" /> <TagsInputInput placeholder="provider/model" aria-label="Models" />
</TagsInput> </TagsInput>
</div> </div>
</Field> </Field>
+1
View File
@@ -114,6 +114,7 @@ onUnmounted(() => clearTimeout(searchTimer));
<Input <Input
v-model="search" v-model="search"
type="search" type="search"
aria-label="Search messages and fields"
placeholder="Search messages and fields…" placeholder="Search messages and fields…"
class="min-w-0 flex-1 md:max-w-56" class="min-w-0 flex-1 md:max-w-56"
/> />
+6 -4
View File
@@ -137,9 +137,9 @@ onMounted(load);
<Section v-if="editing" :title="draft.id ? draft.id : 'New policy'"> <Section v-if="editing" :title="draft.id ? draft.id : 'New policy'">
<div class="flex flex-col gap-3"> <div class="flex flex-col gap-3">
<div class="flex flex-wrap gap-2"> <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"> <Select v-model="draft.level">
<SelectTrigger class="w-40"><SelectValue /></SelectTrigger> <SelectTrigger class="w-40" aria-label="Level"><SelectValue /></SelectTrigger>
<SelectContent> <SelectContent>
<SelectItem value="instance">instance</SelectItem> <SelectItem value="instance">instance</SelectItem>
<SelectItem value="org">org</SelectItem> <SelectItem value="org">org</SelectItem>
@@ -151,16 +151,18 @@ onMounted(load);
v-if="draft.level === 'workspace'" v-if="draft.level === 'workspace'"
v-model="draft.workspace_id" v-model="draft.workspace_id"
placeholder="workspace id" placeholder="workspace id"
aria-label="Workspace id"
class="w-48" class="w-48"
/> />
<template v-if="draft.level === 'object'"> <template v-if="draft.level === 'object'">
<Input v-model="draft.object_kind" placeholder="kind (secret, source...)" 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" class="w-48" /> <Input v-model="draft.object_id" placeholder="object id" aria-label="Object id" class="w-48" />
</template> </template>
</div> </div>
<Textarea <Textarea
v-model="draft.text" v-model="draft.text"
class="min-h-40 font-mono text-xs" class="min-h-40 font-mono text-xs"
aria-label="Cedar policy"
placeholder='permit(principal, action == Archie::Action::"read", resource);' placeholder='permit(principal, action == Archie::Action::"read", resource);'
/> />
<div class="flex gap-2"> <div class="flex gap-2">
+8 -4
View File
@@ -186,6 +186,7 @@ const ON_FAILURE = [{ value: "", label: "Park the task" }, { value: "continue",
<Textarea <Textarea
v-else-if="fields.lead.kind === 'text'" v-else-if="fields.lead.kind === 'text'"
:model-value="text(fields.lead.key)" :model-value="text(fields.lead.key)"
:aria-label="label(fields.lead.key, fields.lead.schema)"
class="min-h-32 text-label leading-relaxed" class="min-h-32 text-label leading-relaxed"
@focus="focused = fields.lead.key" @focus="focused = fields.lead.key"
@update:model-value="setSetting(fields.lead.key, String($event))" @update:model-value="setSetting(fields.lead.key, String($event))"
@@ -193,6 +194,7 @@ const ON_FAILURE = [{ value: "", label: "Park the task" }, { value: "continue",
<Input <Input
v-else v-else
:model-value="text(fields.lead.key)" :model-value="text(fields.lead.key)"
:aria-label="label(fields.lead.key, fields.lead.schema)"
@focus="focused = fields.lead.key" @focus="focused = fields.lead.key"
@update:model-value="setSetting(fields.lead.key, String($event))" @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" /> <CircleHelp v-if="field.schema.description" class="size-3 text-fg-subtle" />
</span> </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)" /> <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)" /> <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 <Input
v-else-if="field.kind === 'number'" v-else-if="field.kind === 'number'"
type="number" type="number"
class="h-8 w-24 text-right text-label" class="h-8 w-24 text-right text-label"
:model-value="(settings[field.key] as number | undefined) ?? ''" :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)))" @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> </div>
</section> </section>
@@ -261,16 +264,17 @@ const ON_FAILURE = [{ value: "", label: "Park the task" }, { value: "continue",
{{ label(field.key, field.schema) }} {{ label(field.key, field.schema) }}
<CircleHelp v-if="field.schema.description" class="size-3 text-fg-subtle" /> <CircleHelp v-if="field.schema.description" class="size-3 text-fg-subtle" />
</div> </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 <Textarea
v-else-if="field.kind === 'lines'" v-else-if="field.kind === 'lines'"
:model-value="Array.isArray(settings[field.key]) ? (settings[field.key] as string[]).join('\n') : ''" :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" class="min-h-16 font-mono text-xs"
placeholder="One per line" placeholder="One per line"
@update:model-value="setSetting(field.key, String($event).split('\n').filter(Boolean))" @update:model-value="setSetting(field.key, String($event).split('\n').filter(Boolean))"
/> />
<template v-else> <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> <span v-if="yamlErrors[field.key]" class="text-xs text-danger">{{ yamlErrors[field.key] }}</span>
</template> </template>
</section> </section>