From c5ba33486ae9648f15e1ae8f5da7ec222f5be598 Mon Sep 17 00:00:00 2001 From: nrobi144 Date: Tue, 28 Jul 2026 17:14:22 +0300 Subject: [PATCH] feat(desktop): format profile zap amounts compactly (210k, 1.5M) Use commons showAmount() for the Zaps tab total and each zapper row instead of raw sats, matching Amethyst Android and other Nostr clients. Co-Authored-By: Claude Opus 4.8 --- .../vitorpamplona/amethyst/desktop/ui/UserProfileScreen.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/ui/UserProfileScreen.kt b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/ui/UserProfileScreen.kt index 42f0c3e559..6a22d25e3f 100644 --- a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/ui/UserProfileScreen.kt +++ b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/ui/UserProfileScreen.kt @@ -85,6 +85,7 @@ import com.vitorpamplona.amethyst.commons.state.FollowState import com.vitorpamplona.amethyst.commons.ui.components.LoadingState import com.vitorpamplona.amethyst.commons.ui.components.UserSearchCard import com.vitorpamplona.amethyst.commons.ui.feeds.FeedState +import com.vitorpamplona.amethyst.commons.util.showAmount import com.vitorpamplona.amethyst.desktop.account.AccountState import com.vitorpamplona.amethyst.desktop.cache.DesktopLocalCache import com.vitorpamplona.amethyst.desktop.feeds.DesktopBookmarkFeedFilter @@ -1237,7 +1238,7 @@ fun UserProfileScreen( } Tab(selected = selectedTab == 10, onClick = { selectedTab = 10 }) { Text( - "Zaps${if (zapTotalSats.signum() > 0) " (${zapTotalSats.toBigInteger()})" else ""}", + "Zaps${if (zapTotalSats.signum() > 0) " (${showAmount(zapTotalSats)})" else ""}", modifier = Modifier.padding(12.dp), ) } @@ -1604,7 +1605,7 @@ fun UserProfileScreen( u?.metadataOrNull()?.bestName() ?: (pk.hexToByteArrayOrNull()?.toNpub()?.take(16) ?: pk.take(16)), pictureUrl = u?.metadataOrNull()?.profilePicture(), - sats = sats.toBigInteger().toString(), + sats = showAmount(sats), onClick = { onNavigateToProfile(pk) }, ) }