Repository navigation
fix(vault): PIN toggle announced a bare "Show"/"Hide" to TalkBack - #274
Merged
Merged
Conversation
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.
Contributor
📱 iOS Build Status: PASSED✅ iOS Simulator Build & Unit Tests - success iOS UI tests run in a separate, informational job and are not reflected above — check "iOS UI Tests (informational)" for those. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
CreateVaultScreenandUnlockVaultScreencarried byte-for-byte copies of this field — same label, samePasswordVisualTransformation, 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.ktasinternal(perAGENTS.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
mutableStateOfand noremember, 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:vaultsuite green.Refs
docs/TEST_COVERAGE_PRD.mdPhase 5