fix(a11y): name every form control in Settings
Measured with Accessibility.getFullAXTree against the running app with all seven sections expanded: 24 of 93 controls computed an empty name. Every config-field select and toggle, and all eighteen track-list column checkboxes, had a <label> sitting right beside them with nothing associating the two. Now 0 of 93. Not in the audit, and a11y.6 says why in its own line: it scanned every <button>, and none of these is one. Same shape as the count that sent Phase 1 looking for an unnamed sort control — the claim was answering a narrower question than it reads as. The fields use `for`/`id` rather than aria-label, for what it buys beyond the name: the label text becomes a click target for the control. A fixed id is safe only because each config-field is its own shadow root. Two more are named but identify nothing, which is a11y.32's complaint one page over: three shortcut buttons announced themselves as "S", and thirty-six column arrows as "Move up".
This commit is contained in:
@@ -8,6 +8,17 @@ export class ShortcutCapture extends LitElement {
|
||||
@property() currentKey = '';
|
||||
@property() defaultKey = '';
|
||||
|
||||
/**
|
||||
* What the binding does, for the name.
|
||||
*
|
||||
* The button's text is the *key* — so the shortcuts list rendered
|
||||
* three buttons called "S", two called "Down" and one called "?",
|
||||
* beside a visible label that named none of them (it is a sibling,
|
||||
* in another shadow root, and nothing associated the two). The
|
||||
* label is what a control is for; the key is its value.
|
||||
*/
|
||||
@property() label = '';
|
||||
|
||||
@state() private recording = false;
|
||||
|
||||
static override styles = css`
|
||||
@@ -134,6 +145,9 @@ export class ShortcutCapture extends LitElement {
|
||||
: this.currentKey
|
||||
? ''
|
||||
: 'not-set'}
|
||||
aria-label=${this.label
|
||||
? `${this.label} shortcut: ${this.currentKey || 'not set'}`
|
||||
: ''}
|
||||
@click=${this.handleClick}
|
||||
@keydown=${this.handleKeydown}
|
||||
@blur=${this.handleBlur}
|
||||
@@ -148,6 +162,8 @@ export class ShortcutCapture extends LitElement {
|
||||
class="reset-btn"
|
||||
@click=${this.handleReset}
|
||||
title="Reset to default (${this.defaultKey})"
|
||||
aria-label="Reset ${this.label ||
|
||||
this.action} to ${this.defaultKey}"
|
||||
>
|
||||
\u21BA
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user