Repository navigation
feat(address-field): match the design system's label, placeholder and scan icon - #61
Conversation
… scan icon - Label: footnote medium in primary text (was footnote regular in gray500). - Placeholder: subhead in primary text at 50% opacity (was black1000Alpha30). - Scan button: the corner-brackets scan glyph, a new template icon DashIcon.Other.textFieldScanQR rendered in primary text; textFieldQR stays for API compatibility. Snapshot references are re-recorded by CI.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…l, placeholder and scan icon
romchornyi-pitcrew
left a comment
There was a problem hiding this comment.
🟡 Changes suggested — 1 major (inline) · 5 non-blocking recommendations · no blockers — reviewed at 670b446c5e
| Level | Verdict | |
|---|---|---|
| 1 · Idea | ✅ valid | The field drifted from the design; the new placeholder also fixes a real bug: black1000Alpha30 has no dark variant, so the placeholder was near-invisible in dark mode (compare the Before/After dark images) |
| 2 · Architecture | ✅ right layer | A DashUIKit component change, picked up by every host |
| 3 · Completeness | ✅ gaps tracked | SearchBar has the same dark-mode placeholder bug (
); tracked in #54 |
| 4 · Code | 🟡 1 major | The placeholder colour is built inline and comes out at 45 % in dark mode |
Major (inline)
-
—
Color.dash.primaryText.opacity(0.5)breaks the repo rule "Theming is asset-driven … Add a new token there, not inline" (CLAUDE.md L54–56), and the result is not what the PR and docs say:PrimaryTextis white at 0.9 alpha in dark mode, so the placeholder draws at 0.45, not 50 %. A colorset with its own light and dark values (e.g.TextFieldPlaceholder:#0A0A0D@ 0.5 light, white @ 0.5 dark) fixes both, and #54 can reuse it forSearchBar.
5 non-blocking recommendations
- The scan glyph has its own token —
—
Color.dash.textFieldCryptoAddressIconexists for this field's icon and is unused (#141519light, white @ 1.0 dark);primaryTextdraws the glyph at 0.9 in dark mode. - The SVG is not square — — 19.0002 × 19.0851 drawn
.scaledToFit()into 19 × 19 ends up about 18.9 pt wide and off the pixel grid by a fraction; a0 0 19 19viewBox makes it exact, as the comment at intends. (not measured) - Deprecate the old glyph —
— nothing in the library uses
textFieldQRnow;@available(*, deprecated, renamed: "textFieldScanQR")keeps the API and tells a host that draws its own QR button to switch. - Template set twice —
—
.renderingMode(.template)repeats the imageset'stemplate-rendering-intent: template; one of them is enough. - The disabled field looks the same as an enabled one now — with the label in
primaryText, only the missing trailing buttons tell the disabled state apart (compare thedisabledreferences). Worth checking against the design's disabled state. (not verified against Figma)
Review details
Levels 1–3 inline; level 4: a general code review at high effort plus the UI checklist (tokens, dark mode, assets, docs). The major was checked against the PrimaryText, SearchPlaceholder and TextFieldCryptoAddressIcon colorsets at this head and against the repo's CLAUDE.md; the Before/After references were compared by eye in light and dark. CI was still running at review time.
🤖 Reviewed with Claude Code
…immed disabled state - Placeholder: new token TextFieldPlaceholder (#0A0A0D @ 0.5 light, white @ 0.5 dark) instead of primaryText at 50% opacity, which drew at 45% in dark mode. - Scan glyph: the field's own token textFieldCryptoAddressIcon. - text-field-scan-qr.svg: a square 19x19 viewBox so it sits on the pixel grid. - The template rendering is set once, in the imageset. - Disabled: the label and entered text use secondaryText and the placeholder tertiaryText, as MenuItem dims a disabled row.
|
Recommendations, in 4b53fc5:
Snapshot references are re-rendered by CI for this push; Before/After will be refreshed. |
romchornyi-pitcrew
left a comment
There was a problem hiding this comment.
✅ Clean once the references are re-rendered — the major is closed · 1 non-blocking recommendation left · no blockers — re-reviewed at 4b53fc56c9
| Level | Verdict | |
|---|---|---|
| 1 · Idea | ✅ valid | unchanged |
| 2 · Architecture | ✅ right layer | unchanged |
| 3 · Completeness | ✅ gaps tracked | SearchBar stays with #54, which can now reuse textFieldPlaceholder |
| 4 · Code | ✅ clean | The placeholder is a token at 50 % in both modes |
Closed since the last review
- Major: inline placeholder colour → new
TextFieldPlaceholdercolorset,#0A0A0D@ 0.5 light and white @ 0.5 dark; docs updated. - Scan glyph token →
textFieldCryptoAddressIcon. - Non-square SVG →
0 0 19 19viewBox, the group shifted up by half the 0.085 overhang, so at most 0.04 pt of stroke is trimmed top and bottom. - Template set twice → the call-site
.renderingMode(.template)is gone; the imageset keeps it. - Disabled state → label and text step down to
secondaryText, the placeholder totertiaryText, the same stepMenuItemuses (MenuItem.swift L103); aDisabledpreview was added.
Before merging
This commit changes how the disabled field draws, and the dark placeholder moves from 45 % to 50 %, but no reference image changed. Expect Snapshot tests (iOS Simulator) to fail on testDisabled (and possibly the dark empty and error images); bring the CI-rendered images in with .github/scripts/fetch-snapshots.sh as before.
1 non-blocking recommendation (still open)
- Deprecate the old glyph — Icon_DashUI.swift L265 —
textFieldQRis unused in the library;@available(*, deprecated, renamed: "textFieldScanQR")keeps the API and points hosts at the new icon.
Review details
Re-review of 670b446c5e..4b53fc56c9 against the earlier findings, with the author's reply on the major; the new colorset and the SVG transform were checked by hand, the disabled colours against MenuItem. CI was still queued at review time.
🤖 Reviewed with Claude Code
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Issue being fixed or feature implemented
AddressFieldViewdid not match the design system: the label was footnote regular in gray500, the placeholder was lighter than the design, and the scan button showed a QR-grid glyph where the design has the corner-brackets scan glyph. Dash Wallet iOS's new Send flow (dashpay/dashwallet-ios#1358) uses this field on its Address screen.What was done?
Color.dash.primaryText(was footnote regular ingray500).Color.dash.textFieldPlaceholder(TextFieldPlaceholder, light and dark variants from the design system; wasblack1000Alpha30, which has no dark variant).DashIcon.Other.textFieldScanQR(text-field-scan-qr, the design's ScanQR corner-brackets glyph as a square vector SVG) tinted with the existingColor.dash.textFieldCryptoAddressIcon; its box grows from 17 to 19 pt so the 2 pt stroke is not clipped.textFieldQRstays so the public API does not break.secondaryText, the placeholder totertiaryText, asMenuItemdoes, so a disabled field does not read as one that takes input. New "Disabled" preview.docs/buttons-and-inputs.md,docs/foundation.mdupdated.Every screen that uses
AddressFieldViewgets the new look.How Has This Been Tested?
swift build,swift test(61 tests),.github/scripts/conventions.sh: pass.AddressFieldViewSnapshotTestsreferences change (5 states × light/dark); re-rendered by CI and committed withfetch-snapshots.sh.Before / After
🤖 Generated with Claude Code
Summary by CodeRabbit