uttrflow / uttrflow/uttrflow-swift
The Dictionary and Snippets editor fields have no accessibility names
- Dominant language
- Swift
- Stars
- 4
- Forks
- 17
- Avg merge
- 3h 32m
- Merged PRs (30d)
- 277
Description
## What happens
The inline editors on the Dictionary and Snippets pages create their text fields with an empty title and draw the field's caption as a separate `Text` beside it. Nothing ties the caption to the field, so each field has no accessibility name.
- `Sources/Uttrflow/Main/DictionaryPageView.swift:129`: `TextField("", text: word)`, captioned by `MainEditorLabel(text: editor.wordLabel)` on line 128.
- `Sources/Uttrflow/Main/DictionaryPageView.swift:137`: `TextField("", text: pronunciation)`, captioned on line 136.
- `Sources/Uttrflow/Main/SnippetsPageView.swift:109`: `TextField("", text: trigger)`, captioned on line 105.
- `Sources/Uttrflow/Main/SnippetsPageView.swift:113`: `TextEditor(text: text)`, captioned on line 111.
None of the four has an `.accessibilityLabel`, and `MainEditorLabel` (`Sources/Uttrflow/Main/MainPieces.swift:421-430`) is plain text.
## Why it matters
A VoiceOver user who presses Add on either page lands in an unnamed field, followed by another unnamed field. They can't tell which is the word and which is the pronunciation, or which is the trigger and which is the expansion, and those are the whole form.
## How to reproduce
1. Turn on VoiceOver (⌘F5).
2. Open the Dictionary page and choose Add.
3. Move into the first field. VoiceOver announces a text field with no name. The same happens in the Snippets editor.
## Acceptance criteria
- Each of the four fields is announced with its caption, for example "Word, text field", using the presentation's own strings (`editor.wordLabel`, `editor.pronunciationLabel`, `editor.triggerLabel`, `editor.textLabel`).
- The visible layout doesn't change.
## Where to start
- Add `.accessibilityLabel(editor.wordLabel)` and the like at the four lines above. Alternatively, pass the caption as the `TextField` title and keep `.labelsHidden()` so it isn't drawn twice.
- #514 is the same kind of fix on the Style page.
- Run `make verify`, and see `CONTRIBUTING.md`.
Size: four lines.
Contributor guide
Research direction
Start with the four fields in Sources/Uttrflow/Main/DictionaryPageView.swift at lines 129 and 137 and Sources/Uttrflow/Main/SnippetsPageView.swift at lines 109 and 113; compare their captions and MainEditorLabel in MainPieces.swift:421-430. Run make verify after adding accessibility names using the presentation strings. Done means VoiceOver announces each field with its caption while the visible layout remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- macos, swift
- Domain
- accessibility, desktop
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 95/100