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
AppIcon.appiconset only defined an iOS "universal" 1024x1024 entry, so
the macOS build had no mac-idiom icon at all — App Store Connect
rejected uploads for missing the required 512pt@2x (1024x1024) image.
Generates the full mac icon set (16/32/128/256/512pt at 1x/2x) from
the existing 1024px source and wires it into Contents.json.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FXcrACM5sok3M1KQJ8kByy
statusLine() used to build the whole "via Coinbase, updated ..."
string in shared code with hardcoded English literals ("updated",
"loading rates…", "via ") — not localizable, since this shared code
has no Composable/moko-resources context to resolve a string from,
and said more than needed (the source is already shown in the Price
Source picker right above it).
Replaced with lastUpdatedDateTime(): String?, which returns only the
locale-formatted date/time (still shared, since that part is genuine
platform-native locale formatting, not translated text) — null for
Manual, or while the first fetch hasn't completed. Each UI layer now
builds the localized "Updated %1$s" / "Loading rates…" text itself
via stringResource()/IosLocalizationKt around that value, using two
new string resources.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FXcrACM5sok3M1KQJ8kByy
New "Reset" button in the currency picker's top bar (next to Done),
shown only when more than the pinned default currency is selected.
Tapping it asks for confirmation before removing every other
selected currency, via PriceViewModel.onSelectedCurrenciesReset() —
same recompute/persist pattern as onFiatCurrencyToggled.
Compose uses an AlertDialog; iOS/macOS uses .alert with a destructive
Reset action, matching the destructive-role toolbar button that
triggers it.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FXcrACM5sok3M1KQJ8kByy
The "Currencies" section (not-yet-added currencies) is now two:
"Priced Currencies" and "Unpriced Currencies", partitioned by
whether the active source quotes a rate for each one. "Current
Currency" and "Selected Currencies" are unaffected.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FXcrACM5sok3M1KQJ8kByy
It was using the decimal sanitizer/keyboard, same as the rate field
next to it — but Sats are indivisible, so this one should behave like
the existing Sats amount field: integers only, numeric keypad.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FXcrACM5sok3M1KQJ8kByy
Always render the field now (label included) with just its value
empty when unknown, rather than hiding the whole field.
In Manual source mode it's now a genuine input: typing into it
recomputes the "BTC to currency" rate the same way typing into that
field recomputes this one. Both edit the same underlying
ManualExchangeRateSource.rate via the same self-inverse division
(CurrencyConverter.satsPerCurrencyUnit of a rate gives Sats, and of a
Sats amount gives a rate back), tracked as a new manualSatsPerCurrencyInput
field alongside the existing manualRateInput.
Wired through PriceViewModel, the iOS bridge/ConverterViewModel, and
both UIs.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FXcrACM5sok3M1KQJ8kByy
"1 BTC to USD" -> "BTC to USD", "1 <currency> to Sats" -> "<currency>
to Sats" (the "1 " was redundant with the field itself now carrying
the label).
Compose: the BTC-to-currency rate and currency-to-sats value are now
OutlinedTextFields (read-only, matching the enabled/disabled styling
of the Currencies section's fields) instead of plain Text, with the
label folded into the field itself rather than a separate heading.
The manual-source rate field's label changes from generic "Rate" to
the same "BTC to <currency>".
iOS/macOS: dropped the Section's "1 BTC to <currency>" header;
the label now sits directly on the rate row (label left, value
right), matching the existing Sats/BTC/currency field rows and the
already-matching "<currency> to Sats" row below it.
rate_label is now unused and removed.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FXcrACM5sok3M1KQJ8kByy
Shows the inverse of the existing "1 BTC to <currency>" rate — how
many Sats one unit of the default currency is worth — right below it.
Useful since many currencies are worth less than, or a low multiple
of, a single Sat.
CurrencyConverter.satsPerCurrencyUnit(rate) does the actual division;
ConverterUiState.oneCurrencyToSats() derives the display string from
the already-fetched rate the same way defaultCurrencyRate() does, so
no new ViewModel state was needed. Wired into both Compose and the
iOS bridge/SwiftUI.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FXcrACM5sok3M1KQJ8kByy
Combining .searchable, .toolbar, and .navigationTitle on the same
List triggered "Update ToolbarReader tried to update multiple times
per frame" every time the sheet's first presentation animated in.
Moving .searchable onto the NavigationStack instead — separate from
the .toolbar/.navigationTitle chain on the List — avoids it.
Reproduced and confirmed fixed via the unified log (Console shows the
same warning under com.apple.SwiftUI:Invalid Configuration); the
sheet, search field, and currency list all still render correctly.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FXcrACM5sok3M1KQJ8kByy
Filters by code or display name, case-insensitively, across all three
sections (current, selected, and remaining currencies) — a section
disappears entirely once nothing in it matches. The matching logic
lives in shared code (matchesCurrencySearch) so Compose and SwiftUI
stay in sync; SwiftUI wires it into the native .searchable() field,
Compose gets a plain search text field with a clear button.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FXcrACM5sok3M1KQJ8kByy
macOS's Form isn't List-backed, so .onMove's drag-to-reorder (which
already worked on iOS) had no effect there — the only way to reorder
was the manual chevron up/down buttons. Those are replaced with real
drag-and-drop via .draggable/.dropDestination, and a right-click
context menu now offers Remove for any non-default currency, since
macOS has no swipe-to-delete gesture either.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FXcrACM5sok3M1KQJ8kByy
With a single currency shown there's nothing to reorder or remove, so
the per-row "..." menu (Compose) and the Edit button plus swipe-to-
delete/drag-to-reorder (iOS) no longer appear. This also covers
Manual, which always shows just the default currency.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FXcrACM5sok3M1KQJ8kByy
Manual's default-currency field being unpriced just means no rate has
been typed in yet, not an actual pricing error, so the label (and the
red error styling that came with it) no longer applies when it's the
active source.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FXcrACM5sok3M1KQJ8kByy
"via Manual" had nothing useful left to say once the "updated" part
was dropped, so statusLine() now returns empty for Manual and both
UIs skip rendering it entirely instead of showing a blank line/footer.
onManualRateChanged also now clears manualSource.rate whenever the
field doesn't parse (emptied, or mid-edit on an incomplete number)
rather than only ever updating it on a successful parse. refresh()'s
early-return for a null Manual rate now also clears the cached rates
and pricedCurrencyCodes, so a cleared/incomplete manual rate stops
fiat amounts from continuing to show a stale computed value.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FXcrACM5sok3M1KQJ8kByy
Refreshing has no meaning for a manually-typed rate, so the button
(and its loading spinner) is now hidden while Manual is selected.
Switching to Manual for the first time now seeds its rate field from
whichever source was active before, falling back to any other
source's last cached rate for the default currency. When neither is
available, the rate and amount fields are left empty instead of
showing stale values.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FXcrACM5sok3M1KQJ8kByy
The manual rate source only ever prices the default currency, so the
currency selector, additional currency rows, and the "updated" part
of the status line no longer make sense for it.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FXcrACM5sok3M1KQJ8kByy
Derives a country flag from the ISO 4217 code's country prefix, with
an explicit map of country codes for currencies shared by multiple
countries (XAF, XCD, XCG, XOF, XPF) showing every issuing country's
flag, and the EU flag as a special case for EUR.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QpjMKWGoiT5aJBzhxvXkwp
Adds groupDigits(), a display-only formatter that inserts the current
locale's digit-grouping separators into an amount's integer part (e.g.
"1,000,000.5" in en-US vs "1.000.000,5" in de-DE, where the roles of ","
and "." are swapped, or hi-IN's irregular "12,34,567"). Delegates to each
platform's native locale APIs (java.text.NumberFormat/DecimalFormatSymbols,
NSNumberFormatter/NSLocale, Intl.NumberFormat with BigInt for arbitrary
precision) rather than reimplementing grouping rules, and never touches the
canonical '.'-decimal strings the rest of the app parses and stores.
Applied via a Compose VisualTransformation (BTC/Sats/fiat/manual-rate
fields, plus the read-only rate display) and, on the native SwiftUI screen,
by re-deriving the field's displayed text on every change. Also made input
parsing locale-aware: sanitizeDecimalInput now recognizes the locale's own
decimal separator (e.g. what a locale-aware decimal keypad sends), not just
"." — with a stricter rule on the SwiftUI side specifically, since its
single text buffer re-feeds the grouped display back through sanitize, so
a "." can be grouping noise there rather than a decimal point.
The exceeds-max-supply warning's "21,000,000 BTC" is no longer baked into
the localized string with hardcoded grouping; it's substituted in at
runtime via groupDigits so the link-detection text always matches exactly,
in every locale.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QpjMKWGoiT5aJBzhxvXkwp
Previously a currency the active price source had no rate for was hidden
entirely, so switching sources (e.g. to CoinGecko, which quotes far fewer
fiat currencies than Coinbase) could silently drop it from the picker and
even from the user's own selection.
Every system currency is now always offered. ConverterUiState tracks which
codes the latest fetch actually priced, and both UIs (Compose and the
native SwiftUI screen, since iOS/macOS don't render Compose UI at all) show
a "Not priced by <source>" indicator for the rest, with the amount field
emptied and disabled rather than showing a stale or meaningless value.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QpjMKWGoiT5aJBzhxvXkwp
The earlier -Wl,-U,_sqlite3_enable_load_extension fix only satisfied the
linker; at runtime, Kotlin/Native's cinterop wrapper for that function still
resolves against the symbol the moment SQLDelight's native-driver opens a
connection, and Apple's system libsqlite3 doesn't export it on macOS — so
the app now crashed instead of failing to build.
Adds weak no-op definitions of sqlite3_enable_load_extension and
sqlite3_load_extension, compiled directly into the app (Xcode's
file-system-synchronized group picks the file up with no project.pbxproj
changes needed beyond what Xcode itself rewrote on this build). Weak means
a platform whose system library does provide the real symbol keeps using
that one; this only fills in where it's missing.
Verified there's no longer a crash by running the built macOS binary
directly and by installing/launching it on the iOS Simulator — neither
produced a dyld error or a crash report, versus two reproducible crash
reports beforehand with the exact reported failure signature.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QpjMKWGoiT5aJBzhxvXkwp
Tapping "21,000,000 BTC" in the exceeds-max-supply warning now sets the BTC
field to that value, on both Compose (Android/Desktop/Web) and the native
SwiftUI screen (iOS/macOS) — Compose UI isn't rendered on iOS/macOS at all,
so that side needed its own AttributedString-based link.
The link is styled to match the surrounding warning text: Compose's
LinkAnnotation otherwise falls back to the theme's accent color unless every
interaction state's style is set explicitly, and SwiftUI renders `.link`
runs in the accent color regardless of the Text's own foregroundColor
modifier unless it's set directly on the link's AttributedString range.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QpjMKWGoiT5aJBzhxvXkwp
Adds a SQLDelight-backed AppDatabase (Android, Desktop, iOS/macOS) so the
converter survives restarts: the last-known rates per price source, the
user's selected fiat currencies (with order preserved), and the last-used
price source all reload before the first network fetch completes. Web isn't
a shipped platform and SQLDelight's driver there needs a worker plus a wasm
sqlite binary, so it gets a lighter localStorage-backed implementation of
the same store interfaces instead.
Android needs an app Context for its driver, wired via a new
SatsPriceApplication. iOS/macOS need libsqlite3 linked explicitly (Swift's
autolinking only covers Shared.framework itself, not its C library
dependencies), plus two extension-loading symbols marked optional since
macOS's system sqlite build omits them.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QpjMKWGoiT5aJBzhxvXkwp