Widen macOS amount fields so large values don't clip

NumericField's macOS-only frame was hard-capped at 140pt, but the
app's own max BTC supply (21,000,000) means Sats amounts can reach a
~21-character grouped string, which didn't fit — the field visibly
clipped once typed input exceeded the cap. Lets it grow up to 220pt
instead of a fixed 140pt.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FXcrACM5sok3M1KQJ8kByy
This commit is contained in:
2026-09-11 15:11:45 +03:00
co-authored by Claude Sonnet 5
parent 5411455d88
commit 4388350230
+6 -1
View File
@@ -351,7 +351,12 @@ private struct NumericField: View {
#endif
.multilineTextAlignment(alignment)
#if os(macOS)
.frame(maxWidth: 140)
// Bounded rather than unconstrained so the field doesn't grow to fill the whole row
// (the original reason for a fixed width here), but wide enough for the largest
// values this app actually displays e.g. a Sats amount at the max BTC supply
// (`maxSupplyBtcAmount` * 100,000,000) is a 16-digit, comma-grouped ~21-character
// string, which a 140pt cap was clipping.
.frame(minWidth: 80, idealWidth: 140, maxWidth: 220)
#endif
.onAppear { text = NumberFormatKt.groupDigits(value: value) }
.onChange(of: text) { newValue in