trackslash
VAULT-66 P2

Give the editor's text fields accessibility labels

0
All issues

Description

Found while testing VAULT-16.

The bug: plain and secure LabeledTextField inputs have no accessibility label. VoiceOver gets only a hint, so a field is announced without its name. The floating label is hidden from accessibility, on the assumption that the field already carries the title, but it doesn't. The recovery phrase word fields have the same problem.

LabeledTextField's textEditor variant already sets .accessibilityLabel(title), so it's fine.

Fix:

  • Give every LabeledTextField input, plain, secure and revealed secure, its title as the accessibility label.
  • Give each recovery phrase word field a label like "Word 3".
  • Keep any existing hint.

Tests: extend SecretTextInputTraitsTests, or add a small test that hosts each variant and checks its accessibility label.

Sub-issues

0

Linked issues

0

GitHub

0

No branches or pull requests linked.

Comments

1
Bradley

Fixed in https://github.com/badbundle/vault-app/pull/642 (merged as d61993c3).

Labels added:

  • Every LabeledTextField input, whether plain, secure (masked or shown) or multiline, now uses its title as its accessibility label. Hints stay as they were. The multiline editor's label moved to the same place.
  • Recovery phrase word fields are named "Word 1" to "Word 24".
  • .secretTextInput is unchanged.

Tests:

  • Checked every variant with the accessibility tree in the simulator. Key, Site Name, Account Name (with its hint), Description, Passphrase (masked and shown) and the word fields all read their names.
  • A new unit test covers the word names.
  • There's no hosted UI test. SwiftUI only attaches text-field labels when the system's accessibility bundles are loaded, which they aren't in the test process.

Still worth checking on a device: that VoiceOver skips the floating label and word numbers, which are marked hidden. The simulator's accessibility tree still lists them.