feat: import Menu icon set, add DashIcon enums and SwitchView - #6
feat: import Menu icon set, add DashIcon enums and SwitchView#6romchornyi wants to merge 11 commits into
Conversation
Adds 82 imagesets covering the Menu icon set from the Hybrid design system, with light and dark artwork in a single imageset via luminosity appearances. Dark artwork is only included where it actually differs from light — 52 of the exported dark files were byte-identical to their light counterparts and were dropped rather than shipped as redundant duplicates. Layer names were normalized to a menu-<slug> template: separators unified, image-menu-/menu- prefixes de-duplicated, and "floopy disk" corrected to menu-floppy-disk. Two Face ID components that collapsed to the same slug are kept apart as menu-face-id (square brackets) and menu-face-id-rounded. Note: menu-send.disabled and menu-receive.disabled are removed here. The only remaining reference is a #if DEBUG preview in MenuItem.swift, which will render a blank icon until the disabled variants are re-exported.
Prefixes every icon in the group with system-message- and replaces the ad-hoc warning_triangle spelling, so names match the folder they live in. Adds the shield, timer, unmixed-funds and username-change icons. The top-level stopwatch imageset is folded into the group as system-message-timer-small.
Replaces dot separators with dashes so the names follow the same kebab-case convention as the rest of the catalog: transaction-all.trans becomes transaction-all-trans, transaction-coinbase.received becomes transaction-coinbase-received, transaction-uphold.received becomes transaction-uphold-received.
Moves the per-component icon folders under a shared Components/ parent and renames RadioButton to CheckBox, which is what the icons in it actually are. Checkbox assets pick up a checkbox- prefix to match.
Implements the switch from the iOS design system (node 1841:259) as a standalone SwiftUI view: a 64x28 track with a 39x24 pill thumb inset by 2, sliding 21pt between states with a 0.2s ease-in-out. Covers all four states. Disabled is read from the isEnabled environment value rather than a parameter, so .disabled(true) on any ancestor works: on + enabled blue on + disabled blueAlpha50 off + enabled gray300Alpha50 off + disabled black1000Alpha20 The off and on colors map exactly to the switch/track-fill-off and switch/track-fill-on design variables. The design system has no track-fill-on-disabled variable, so blueAlpha50 is a stand-in and needs confirming with the designer.
The Menu (disabled) frame in Figma only diverges from the light set for these two icons; everything else in that frame is identical to its enabled counterpart. Named with a -disabled suffix to match the kebab-case convention the rest of the catalog now uses.
Introduces DashIcon, a namespace of String-backed enums mirroring the asset catalog folder structure — 137 icons across 12 groups. The raw value is the imageset name, so a wrong name becomes a compile error instead of a blank image at runtime. DashIconAsset gives each case .source (a DashIconSource, for components that take one) and .image (a plain Image, styled by the caller). Group prefixes are dropped from case names since the enum already namespaces them: menu-account-error reads as DashIcon.Menu.accountError. Generated from the catalog rather than hand-written, and CaseIterable so a gallery preview can enumerate a group.
Replaces all 20 raw asset-name strings in the library with DashIcon cases.
Three of them were already broken by the catalog normalization and were
failing silently:
- SystemMessageView's default icon still pointed at "warning_triangle",
renamed to system-message-warning-triangle. This is a default parameter
value in shipping code, not a preview, so every SystemMessageView built
without an explicit icon rendered a blank one.
- MenuItem's preview used "menu-receive.disabled"; the imageset is now
menu-receive-disabled.
- TransactionView passed "transaction-mining" with no bundle, so it
resolved against the host app's bundle rather than the library's.
Call sites that only needed an Image collapse from
Image(dash: .custom(name, bundle: .dashUIKit)) to DashIcon.Group.case.image.
Converts every unambiguous .font(Font.dash.X) to .dashFont(.X), so the
documented design line height is applied alongside the font rather than
leaving each Text at the system's natural leading. Also maps two preview
labels off Apple's .subheadline onto .dashFont(.subhead).
Deliberately left on .font:
- The previews in LineHeight+DashUI and DashTextStyle exist precisely to
contrast bare .font against .dashFont — converting them would erase what
they demonstrate.
- SearchBar's Font.dash.footnote.weight(.semibold): the nearest token,
footnoteMedium, is .medium, so converting would change the weight.
- DashButtonSize.fontSize returns .system(size: 16/14/13/12); 14pt has no
token, so a partial conversion would leave the sizes inconsistent.
- DashAmount, NumericKeyboardView and SwapAmountView size text dynamically
or take a Font parameter. Converting those means reshaping the API to pass
DashTextStyle, which is a separate change.
The design system has no track-fill-on-disabled variable, so the disabled on state was a stand-in. Aligns it with the disabled off state, which means a disabled switch reads the same either way and only the thumb position tells them apart.
|
Important Review skippedToo many files! This PR contains 125 files, which is 25 over the limit of 100. To get a review, narrow the scope: Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (421)
📒 Files selected for processing (126)
You can disable this status message by setting the |
Icon-import PRs change hundreds of files, and although CodeRabbit already skips the binary PNGs, the imageset Contents.json files alone put PR #6 at 124 changed files against a limit of 100 — so the review was skipped entirely and the Swift changes went unreviewed. Filtering out **/*.xcassets/** leaves only the source files, 19 in that PR. Nothing is lost: imageset Contents.json is generated by Xcode or by the Figma export tooling and is never hand-edited.
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
Superseded — split into two stacked PRs so the Swift changes can actually be reviewed. With the asset catalog in the same PR, CodeRabbit counted 125 reviewable files against its limit of 100 and skipped the review entirely. Adding
The combined tree is byte-identical to this branch. Retarget #8 to |
Issue being fixed or feature implemented
The asset catalog had drifted: icon names carried whatever spelling the Figma layer
happened to use (
floopy disk,credit.card,image-menu-face_id,UserSearch),folders mixed conventions, and every call site referenced assets by raw string — so a
renamed asset failed silently at runtime with a blank image instead of a build error.
The Menu icon set from the design system was also missing from the library, and the
switch component was a native
Togglewith a tint, which cannot match a design whosethumb is a 39×24 pill rather than a circle.
What was done?
Assets — imported and normalized
imageset via
luminosityappearances. Dark artwork is only included where it actuallydiffers — 52 of the exported dark files were byte-identical to their light
counterparts and were dropped rather than shipped as duplicates.
menu-send-disabled/menu-receive-disabled. These are the only two icons inthe Figma
Menu (disabled)frame that genuinely diverge from the enabled set.System messageicons gained asystem-message-prefix,Transactionsdropped dot separators(
transaction-all.trans→transaction-all-trans), and the per-component foldersmoved under
Components/withRadioButtonrenamed toCheckbox— which is whatthe icons in it actually are.
DashIcon— typed asset namesFoundation/Icon_DashUI.swiftadds a namespace ofString-backed enums mirroring thecatalog structure, 137 icons in 12 groups. The raw value is the imageset name, so a
wrong name is now a compile error.
DashIconAssetgives each case.source(aDashIconSource) and.image(a plainImage, styled by the caller).All 20 raw asset strings in the library were replaced. Three were already broken and
failing silently:
SystemMessageViewwarning_triangle, renamed during normalization — this is a default parameter in shipping code, not a preview, so everySystemMessageViewwithout an explicit icon rendered blankMenuItempreviewmenu-receive.disabled; the imageset ismenu-receive-disabledTransactionViewtransaction-miningwith nobundle:, resolving against the host app's bundle instead of the library'sdashFont— line heights appliedConverted 21 unambiguous
.font(Font.dash.X)call sites to.dashFont(.X), so thedocumented design line height is applied with the font instead of leaving each
Textatthe system's natural leading.
17 sites deliberately stay on
.font, listed with reasons in the commit body. The shortversion: the
LineHeightandDashTextStylepreviews exist to contrast the two, soconverting them would erase what they demonstrate;
SearchBaruses a.semiboldfootnote and the nearest token is
.medium; andDashButtonSize,DashAmount,NumericKeyboardViewandSwapAmountViewsize text dynamically or take aFontparameter, so converting them means reshaping the API to pass
DashTextStyle— aseparate change, not a mechanical one.
SwitchViewImplements the switch from the iOS design system (node
1841:259): a 64×28 track with a39×24 pill thumb inset by 2, sliding 21pt with a 0.2s ease-in-out. Covers all four
states. Disabled reads from the
isEnabledenvironment value rather than a parameter, so.disabled(true)on any ancestor works.Track colors map to design variables exactly —
gray300Alpha50isswitch/track-fill-off,blueisswitch/track-fill-on,black1000Alpha20isswitch/track-fill-off-disabled.How Has This Been Tested?
swift buildpasses at every commit in the branch.The refactors were verified by grep rather than by eye: zero remaining
.custom("…")raw names outside the generated file, and the 17 surviving
.font(sites are exactly theones enumerated above.
Icon_DashUI.swiftwas generated from the catalog on disk ratherthan hand-written, so every raw value is guaranteed to name a real imageset.
Visual states were checked in SwiftUI previews —
SwitchViewships previews for all fourstates plus an interactive one.
Not tested: the icons are not yet consumed by
dashwallet-ios, so this is library-sideonly.
Breaking Changes
None.
DashIconis additive, the asset renames are internal to the library (no publicAPI exposed asset names), and
SwitchViewis new.DashSwitchis untouched.Worth flagging for review rather than as a break: the design system has no
track-fill-on-disabledvariable, so a disabled on switch currently uses the samecolour as a disabled off switch — only the thumb position distinguishes them. That
needs confirming with the designer.
Checklist: