Repository navigation
feat(address-field): name the text field and let callers set its identifier - #78
Conversation
…tifier The text field had no accessibility label and no identifier, and a tap on its label did nothing. It now reads its label, the label row focuses it, and fieldIdentifier(_:) names the field alone. Closes dashpay#59 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
romchornyi
left a comment
There was a problem hiding this comment.
🟡 No blockers, no major findings · 2 minor (please fix before merge) · 3 nits — reviewed at a71f0eab66
| Level | Verdict | |
|---|---|---|
| 1 · Idea | ✅ valid | The field has no name and no identifier (#59) |
| 2 · Architecture | ✅ right layer | The component owns the label; a method keeps the API additive |
| 3 · Completeness | ✅ complete | #49 covers the scan and clear buttons |
| 4 · Code | 🟡 2 minor | Both in the label row |
Minor
- A disabled field's label row swallows the host's tap —
AddressFieldView.swift#L106.isDisabledis checked inside the closure, so the gesture still wins over an ancestor: for a disabled field in aButtonor under an.onTapGesture, a tap on the label row ran the host's action on master and now does nothing (verified on iOS 18.6 and 26.5). - "No visual change" does not hold for an accessory in tight space —
AddressFieldView.swift#L104. With themaxWidth: .infinityframe the stack sizes the accessory first, and one 8 pt gap is gone. 38 of 96 configurations differ from master, all with an accessory; for example label "Address" with a "Transparent address" badge, 375 pt, accessibility3: height 95 → 130. Without an accessory the rows are identical (verified by pixel comparison, iOS 26.5). No caller on dashwallet-iosdeveloppasses an accessory, and the recorded snapshots do not show it.
A direction tried for both: keep Text and Spacer(minLength: 0), give the Text .allowsHitTesting(false), and put the tap in a row .background that exists only while enabled and is hidden from accessibility. 96 of 96 layouts matched master (iOS 18.6), label taps focused, and disabled taps reached the host again (both OS versions). Not tried with an interactive accessory.
Before merge: the CI and Breaking changes workflows have not run on this head (action_required); they need approval to run and to pass.
3 nits
- The accessibility audit now flags the label —
AddressFieldView.swift#L106.performAccessibilityAuditadds "Hit area is too small" (361×18), also when disabled; master does not report it (verified, iOS 26.5). The direction above removes it. - The tests cover only the stored property — with the label, the identifier and the tap all removed, all 75 tests pass (verified). The description states this for the label and the tap, not for applying the identifier.
- The docs are too broad about an enclosing stack —
buttons-and-inputs.md#L160. On a stack with.accessibilityElement(children: .contain)the field's identifier survives (verified on both OS versions).
Review details
Levels 1–3, a general code lane and a UI lane with a throwaway app and XCUITest, master against this head. Not verified: real VoiceOver, iOS 27, a hardware keyboard, a dashwallet-ios build.
🤖 Reviewed with Claude Code
…s taps The tap that focuses the field moves from the label to a background behind the label row, built only while the field is enabled and hidden from accessibility. The label keeps its Spacer, so the row lays out as before with an accessory; a disabled field takes no tap of its own, so an enclosing Button or onTapGesture gets it; and the accessibility audit no longer flags the label's hit area. The identifier docs now say that `.accessibilityElement(children: .contain)` on the view itself, as on a stack around it, keeps the field's own identifier, and that the accessory keeps its own taps. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Follow-up to the review at Rule: the label row's tap-to-focus adds nothing to the layout or the accessibility tree, and while the field is disabled the row takes no tap of its own. It is applied at the one site the PR added, the label row in Minor
Nits
Checked: the 75 package tests, all 105 snapshot tests, a generic iOS build, |
romchornyi
left a comment
There was a problem hiding this comment.
✅ No blockers, no major findings · both minors from the last review closed — reviewed at e6621326af
| Level | Verdict | |
|---|---|---|
| 1 · Idea | ✅ valid | Unchanged: the field had no name and no identifier (#59) |
| 2 · Architecture | ✅ right layer | Unchanged: the component owns the label; a method keeps the API additive |
| 3 · Completeness | ✅ complete | #49 covers the scan and clear buttons |
| 4 · Code | ✅ clean | The fix round adds no new findings |
Closed since the last review
- A disabled field's label row swallows the host's tap. The focus tap now sits in a row
.backgroundthat exists only while the field is enabled and is hidden from accessibility (AddressFieldView.swift#L117-L125). The label text gets.allowsHitTesting(isDisabled)(L107), so while disabled a tap on it reaches the host. - Layout changes with an accessory.
Spacer(minLength: 0)is back and theTextno longer takesmaxWidth: .infinity, so the row keeps master's layout. - Nits. The audit no longer flags the label row. The description now states what the tests cover. The doc comment and
docs/buttons-and-inputs.mdnow cover.accessibilityElement(children: .contain)and the accessory's own taps.
Also checked: the label tap sets the @FocusState, and the existing onChange handlers carry it to a host's isFocused binding. accessibilityIdentifier(_:isEnabled:) needs iOS 17, and the package floor is iOS 18.
Before merge: CI and Breaking changes are still action_required on this head. They need approval to run, and then they need to pass.
Review details
This is a re-review of the fix round a71f0eab66..e6621326af: about 30 lines, all in the label row, plus docs. Levels 1–3 were carried over from the previous review because the fix does not touch them. Level 4 was checked by hand against the full file at the head. The general and specialist lanes were not re-run, because the new diff is small.
🤖 Reviewed with Claude Code
Issue being fixed or feature implemented
Closes #59.
The text field of
AddressFieldViewhad no accessibility label and no identifier, and a tap on its label did nothing. VoiceOver had an unnamed field, and UI tests had to tap it by coordinates.What was done?
label.Buttonor.onTapGesture) still gets through.fieldIdentifier(_:)sets the accessibility identifier of the text field alone. It is a method rather than an initializer parameter: the parameter would need an overload of both initializers.docs/buttons-and-inputs.md.An identifier the host puts on the whole view, or on a stack around it, keeps working as before: it lands on the label, the field and the buttons, and replaces the field's own. This is measured and documented, not changed.
No visual change: the label row keeps master's layout, with and without an accessory, and all snapshot references match. VoiceOver stops on the label and then on the field with the same name; the label stays an element because UI flows look it up.
How Has This Been Tested?
Buttonand under an.onTapGesturepasses taps on its label row to the host, as on master; an interactive accessory gets its own tap and does not focus the field;performAccessibilityAuditreports no hit-area issue that master does not.AddressFieldViewAccessibilityTestscovers only what the method stores. The host-less test bundle has no accessibility tree, so no test in the package covers the field's label, applying the identifier to it, or the tap.xcodebuildfor a generic iOS device,swift build,.github/scripts/conventions.shand.github/scripts/api-check.sh(no breaking changes).Before / After
Breaking Changes
None.
Checklist:
🤖 Generated with Claude Code