Skip to content

fix(vault): PIN toggle announced a bare "Show"/"Hide" to TalkBack - #274

Merged
libravault-xyz merged 1 commit into
devfrom
test/library-vault-a11y
Aug 18, 2026
Merged

libravault-xyz merged 1 commit into
devfrom
test/library-vault-a11y

Conversation

@libravault-xyz

Copy link
Copy Markdown
Collaborator

Phase 5 accessibility, continuing #266 / #268 / #269 / #271.

The bug

The vault PIN field's show/hide toggle carried contentDescription = "Show" / "Hide" — a verb with no object, on a screen that also has a Back button and a submit button. TalkBack read "Hide, button" and left the user to infer what was being hidden. Now "Show PIN" / "Hide PIN".

Same class as the reader's "A-"/"A+" font buttons in #269: a label that exists, so the generic "everything is labelled" sweep from #268 passes, but that doesn't tell the user what the control does. Only a test pinning the wording catches it. That's now happened twice, which is why the sweep alone isn't the standard.

It existed twice

CreateVaultScreen and UnlockVaultScreen carried byte-for-byte copies of this field — same label, same PasswordVisualTransformation, same trailing toggle.

That's how the entry point to an encrypted vault ends up behaving differently in two places after someone fixes only the copy in front of them. Not hypothetical: I applied this accessibility fix twice before noticing and unifying it.

Extracted to PinField.kt as internal (per AGENTS.md) so it's directly unit-testable — a pure function of its arguments, no ViewModel, no DI.

Tests

4 tests: the label wording, both relabel directions, and the generic labelled sweep.

Each asserts the old label is absent as well as the new one present. A control announcing both, or offering "Show PIN" while the PIN is already visible, is as wrong as one with no label — and a presence-only check passes in all of those cases.

The relabel tests are self-evidently load-bearing: they failed on the first run against correct production code, because my test harness built its state with mutableStateOf and no remember, so the toggle snapped back on every recomposition. Fixed in the harness and called out there, since that trap silently defeats any interactive Compose test.

Full feature:vault suite green.

Refs docs/TEST_COVERAGE_PRD.md Phase 5

Phase 5 of docs/TEST_COVERAGE_PRD.md (accessibility).

The vault PIN field's show/hide toggle carried contentDescription
"Show" / "Hide" — a verb with no object, on a screen that also has a
Back button and a submit button. TalkBack read "Hide, button" and left
the user to infer what was being hidden. Now "Show PIN" / "Hide PIN".

Same class of defect as the reader's "A-"/"A+" font buttons (#269): a
label that EXISTS, so a generic "everything is labelled" sweep passes,
but that does not say what the control does. Only a test pinning the
wording catches it.

## Unified the two copies

CreateVaultScreen and UnlockVaultScreen carried byte-for-byte copies
of this field — same label, same PasswordVisualTransformation, same
trailing toggle. That is how the entry point to an ENCRYPTED VAULT
ends up behaving differently in two places after someone fixes only
the copy in front of them. Not hypothetical: this accessibility fix
had to be applied twice before unifying it.

Extracted to PinField.kt as `internal` (per AGENTS.md) so it is unit
-testable directly — it is a pure function of its arguments, no
ViewModel, no DI.

## Tests

4 tests covering the label wording, both relabel directions, and the
generic labelled sweep. Each asserts the OLD label is ABSENT as well
as the new one present: a control announcing both, or offering "Show
PIN" while the PIN is already visible, is as wrong as one with no
label, and a presence-only check passes in every one of those cases.

The relabel tests are self-evidently load-bearing — they failed first
time round against correct production code, because the test harness
built its state without `remember` so the toggle snapped back on
recomposition. Fixed in the harness, and noted there, since that trap
silently defeats any interactive Compose test.

Full feature:vault suite green.
@github-actions

Copy link
Copy Markdown
Contributor

📱 iOS Build Status: PASSED

✅ iOS Simulator Build & Unit Tests - success
✅ Android Core Modules - success

iOS UI tests run in a separate, informational job and are not reflected above — check "iOS UI Tests (informational)" for those.

View run details

@libravault-xyz
libravault-xyz merged commit 85aa1bc into dev Aug 18, 2026
8 checks passed
@libravault-xyz
libravault-xyz deleted the test/library-vault-a11y branch August 18, 2026 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant