Repository navigation
feat(list): add List8View, a label ↔ avatar + value row - #23
Merged
Merged
Conversation
The design system's list-8 (Design system – iOS, node 2881:69): a tertiary Subhead-medium label on the left and, right-aligned, a round 24pt avatar and a Subhead value. The avatar is the caller's view; the row sizes and clips it, and VoiceOver reads the row as one element. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Label and value centre on the 24pt avatar instead of the label riding 2pt high; the label no longer uses fixedSize, so a long one cannot push the row past its container; drop the no-op minHeight and truncation mode; guard the preview with #if DEBUG and add a long-label state; list List8View in docs/README.md and CLAUDE.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A long label no longer takes the width ahead of the value: the two share it, so the recipient never shrinks to a bare ellipsis. The value truncates in the middle, keeping the end of a username. Docs now say the avatar gets a 24pt frame (the caller passes a view that fills it) and that the row is 48pt, and drop the Dynamic Type claim. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The trailing group took every spare point (maxWidth .infinity), capping the label at half the row even beside a three-letter value. A Spacer(minLength: 20) between them gives each text its own width and splits only when both are long. Preview gains the long-label/short-value state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
List8View(label:value:) builds the row without an avatar: the value stands alone at the trailing edge and the row is 44pt. The avatar variant is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
init(label:value:avatar: Avatar?) drops the avatar slot for nil, where an if inside the builder would still reserve 24pt and leave a gap, and keeps rows with and without an avatar one type. Docs say when to use it and how a no-avatar List8View differs from List1View; the summary line calls the avatar optional; a long no-avatar preview state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A builder that draws nothing already takes no space (measured: an empty if, EmptyView and the no-avatar init all lay out alike), so the Avatar? init and optional storage were not needed. The no-avatar init delegates to the builder one; docs show the if-let builder for recipients that only sometimes have an avatar. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Only a builder that produces no view (an if without an else) collapses; an invisible view such as Color.clear keeps the slot. State the no-avatar height plainly, drop a stray trailing comma, and preview the if-false avatar. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
romchornyi
pushed a commit
to dashpay/dashwallet-ios
that referenced
this pull request
Oct 19, 2026
List8View is on dashpay/DashUIKit#23. Point the package at that branch so this PR builds; switch back to master once it is merged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
llbartekll
approved these changes
Oct 19, 2026
llbartekll
left a comment
Collaborator
There was a problem hiding this comment.
Approving. The component does what the description says, and I checked the claims that dashpay/dashwallet-ios#1214 relies on.
What I verified (at 44385a9)
swift buildon macOS andxcodebuildfor the iOS Simulator both succeed, with no warnings fromList8View.swift.- Rendered every preview state at 320pt and 375pt, plus two more: a long label beside a long value, and a long display name. I used a copy of
bodywith plain colours, because the asset colours don't load underswift test. A long label next to a short value keeps its full width. When both are long they split the row, and the value never shrinks to a bare…. With an avatar the row is 48pt. - An empty builder takes no space. The ideal width is 133pt for
List8View(label:value:), for{ if false { … } }and for{ EmptyView() }, and 165pt with an avatar. That matches the 32pt shift in the docs. - VoiceOver: the avatar is hidden inside
.accessibilityElement(children: .combine), so the row is one element. dashFontuses fixed.system(size:)with no Dynamic Type, so the documented 48pt height holds.
Non-blocking
- The value always truncates in the middle, and callers can't change that. See the inline comment. It matters for #1214, which usually passes a display name rather than a username.
- No test covers the empty-builder behaviour the docs promise. A size comparison like the one above (
fittingSize/sizeThatFitson.fixedSize()rows) would take about ten lines. No CI job here runsswift test, though, so this is optional.
truncationMode defaults to .middle, which keeps a username's end; a display name reads better cut at the tail. The modifier sits on the inner Text, so it has to be a parameter rather than an outer modifier. The preview's if-false avatar row says what it exercises. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The tail-truncation preview uses a name long enough to cut; the empty avatar row uses a plain if false (it does not warn); the List1View comparison calls middle truncation the default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 tasks done
romchornyi
pushed a commit
that referenced
this pull request
Oct 23, 2026
Eight PRs landed on master since this branch was cut (#16–#23). Their new files came with the old floor's annotations and two fallback branches, which this merge brings onto the iOS 18 floor the same way the earlier commits did for everything else: - `@available(iOS 14, macOS 11)` / `(iOS 17, macOS 14)` dropped from `Criteria`, `SimpleSelect`, `List8View` and the `NavigationBarCircle*` / `NavigationBarButton` files, previews included. - `NavigationBarButtonStyle` moved to `NavigationBarButton.swift` on master; the branch's copy in `NavigationBar.swift` is gone and the moved one uses `animation(_:value:)` unconditionally. - `NavigationBarCircleMenu` always takes the bar's button style — the pre-16 branch that dimmed the menu by hand is gone, and with it the unused `isEnabled`. - `AddressFieldView`'s two new focus mirrors use the two-parameter `onChange`. - The three new doc pages lose their `@available` line, and the circle-menu paragraph its "On iOS 16+". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 of 4 tasks
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.
Issue being fixed or feature implemented
Adds the design system's
list-8row (Design system – iOS, Figma node2881:69): a label on the left and, right-aligned, a round 24pt avatar followed by a value. dashwallet-ios needs it for the "To" row of the DashPay contact payment confirmation sheet (dashpay/dashwallet-ios#1214), where the recipient is shown with their avatar.What was done?
List8View(Table List/List8View.swift, iOS 14 / macOS 11):List8View(label:value:avatar:). The label uses.subheadMedium+tertiaryText, the value.subhead+primaryText(the same tokens asList1View), with 14/12pt padding, a 20pt minimum gap and 8pt between avatar and value, all taken from the Figma node.List8View(label:value:)gives a row without one.List8View(label:value:) { … }takes it as a@ViewBuilder, gives it a fixed 24×24 frame and clips it round. A builder that produces no view ({ if let avatar { … } }with no avatar) takes no space either. The library does not load images itself.List8Viewsection indocs/lists-and-rows.md, plus entries inREADME.md,docs/README.mdandCLAUDE.md.Screenshots
list-8Rows, top to bottom: with an avatar, without an avatar, a long value, a long label beside a short value, and both long.
How Has This Been Tested?
swift build -c releaseandswift build(debug, previews included).ImageRendererat 393, 375 and 320pt and compared the output with the Figma screenshot of2881:69. Four states were checked: short/short, short label + long value, long label + short value, and long/long.#Preview("Every state")covers the same four states.Breaking Changes
None. This is a new component only.
Checklist:
🤖 Generated with Claude Code