From 684bdcc77fcef4f69beee022d6010f56f0a3412c Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Mon, 10 Aug 2026 17:42:02 +0700 Subject: [PATCH 1/2] feat(transaction-view): optional amount accessory SF Symbol MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit An SF Symbol rendered immediately before the trailing DashAmount, in the secondary tone — for rows whose amount carries no direction, e.g. a circulating-arrows glyph on a wallet-internal transfer rendered with amountSign: .none. Co-Authored-By: Claude Fable 5 --- .../Transaction/TransactionView.swift | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Sources/DashUIKit/Components/Transaction/TransactionView.swift b/Sources/DashUIKit/Components/Transaction/TransactionView.swift index 9050d45..4b63182 100644 --- a/Sources/DashUIKit/Components/Transaction/TransactionView.swift +++ b/Sources/DashUIKit/Components/Transaction/TransactionView.swift @@ -60,6 +60,10 @@ public struct TransactionView: View { /// Dash amount in duffs (10⁸ per Dash). Negative = outgoing. public var dashAmount: Int64 public var amountSign: DashAmountSign + /// Optional SF Symbol rendered immediately before the amount, in the secondary tone. + /// Meant for rows whose amount carries no direction — e.g. a circulating-arrows glyph on a + /// wallet-internal transfer shown with `amountSign: .none`. + public var amountAccessorySystemImage: String? public var fiat: String? /// Short status shown immediately before the amount, e.g. "Locked" for a coinbase reward that /// has not matured yet. Rendered in the warning tone, since it qualifies the amount. @@ -78,6 +82,7 @@ public struct TransactionView: View { details: String? = nil, dashAmount: Int64 = 0, amountSign: DashAmountSign = .negativeOnly, + amountAccessorySystemImage: String? = nil, fiat: String? = nil, trailingStatusText: String? = nil, action: (() -> Void)? = nil @@ -91,6 +96,7 @@ public struct TransactionView: View { self.details = details self.dashAmount = dashAmount self.amountSign = amountSign + self.amountAccessorySystemImage = amountAccessorySystemImage self.fiat = fiat self.trailingStatusText = trailingStatusText self.action = action @@ -209,6 +215,12 @@ public struct TransactionView: View { .foregroundColor(Color.dash.orange) } + if let amountAccessorySystemImage { + Image(systemName: amountAccessorySystemImage) + .font(.system(size: 11, weight: .semibold)) + .foregroundColor(Color.dash.secondaryText) + } + DashAmount(amount: dashAmount, sign: amountSign) .foregroundColor(Color.dash.primaryText) } @@ -270,6 +282,21 @@ public struct TransactionView: View { .background(Color.dash.primaryBackground) } +@available(iOS 17, macOS 14, *) +#Preview("Internal transfer — amount accessory") { + TransactionView( + icon: .system("arrow.forward.circle.fill"), + title: "Internal Transfer", + subtitle: "8:34 AM", + dashAmount: 200_000_000, + amountSign: .none, + amountAccessorySystemImage: "arrow.triangle.2.circlepath", + fiat: "$ 55.00" + ) + .padding(.horizontal) + .background(Color.dash.primaryBackground) +} + @available(iOS 17, macOS 14, *) #Preview("Locked reward") { TransactionView( From 499abc26b4e10b7f7f12d67d58c3e3b0486ec26d Mon Sep 17 00:00:00 2001 From: Roman <51091564+jeanpierreroma@users.noreply.github.com> Date: Wed, 29 Jul 2026 18:50:07 +0300 Subject: [PATCH 2/2] fix: keep TextField prompts as Text instead of dashFont MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The dashFont conversion turned two TextField prompts into some View. A prompt must be a Text, so both call sites failed to compile: SearchBar.swift:146 Cannot convert value of type 'some View' to Text AddressFieldView.swift:126 Reverts those two to .font(Font.dash.subhead), which is the correct call here regardless — dashFont pairs a font with a line height, and a line height cannot be applied to Text in the first place. Both files are wrapped in #if canImport(UIKit), so swift build on macOS never compiled them. Verified with xcodebuild against an iOS destination. --- Sources/DashUIKit/Components/AddressFieldView.swift | 4 +++- Sources/DashUIKit/Components/SearchBar.swift | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Sources/DashUIKit/Components/AddressFieldView.swift b/Sources/DashUIKit/Components/AddressFieldView.swift index db53e1a..0278960 100644 --- a/Sources/DashUIKit/Components/AddressFieldView.swift +++ b/Sources/DashUIKit/Components/AddressFieldView.swift @@ -121,8 +121,10 @@ public struct AddressFieldView: View { TextField( "", text: $text, + // A prompt must stay a `Text`; `dashFont` returns `some View`, and a + // line height cannot be applied to `Text` anyway. prompt: Text(placeholder) - .dashFont(.subhead) + .font(Font.dash.subhead) .foregroundStyle(Color.dash.black1000Alpha30), axis: .vertical ) diff --git a/Sources/DashUIKit/Components/SearchBar.swift b/Sources/DashUIKit/Components/SearchBar.swift index 3f5471a..7614b08 100644 --- a/Sources/DashUIKit/Components/SearchBar.swift +++ b/Sources/DashUIKit/Components/SearchBar.swift @@ -141,8 +141,10 @@ private struct SearchBarFocused: View { if #available(iOS 17.0, *) { TextField( text: $text, + // A prompt must stay a `Text`; `dashFont` returns `some View`, and a + // line height cannot be applied to `Text` anyway. prompt: Text(placeholder) - .dashFont(.subhead) + .font(Font.dash.subhead) .foregroundStyle(Color.dash.black1000Alpha30) ) { EmptyView()