Modern Apps git

← Modern-Apps.git

globalesim: direct install button, drop install screen

Commit
9352af0866c549852210b575b60e544880f2c5e0
Author
vayun-mathur <[email protected]>
When
2026-10-24 19:16 UTC (1 month ago)
Parents
95f0d2d

Diff

globalesim/src/main/java/com/vayunmathur/globalesim/Navigation.kt
diff --git a/globalesim/src/main/java/com/vayunmathur/globalesim/Navigation.kt b/globalesim/src/main/java/com/vayunmathur/globalesim/Navigation.ktindex cf78499843..f25c3bc95e 100644--- a/globalesim/src/main/java/com/vayunmathur/globalesim/Navigation.kt+++ b/globalesim/src/main/java/com/vayunmathur/globalesim/Navigation.kt@@ -7,9 +7,7 @@ import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.ui.platform.LocalContext import androidx.core.net.toUri import com.vayunmathur.globalesim.platform.EsimViewModel-import com.vayunmathur.globalesim.ui.BudgetScreen import com.vayunmathur.globalesim.ui.HomeScreen-import com.vayunmathur.globalesim.ui.InstallScreen import com.vayunmathur.globalesim.ui.PricingScreen import com.vayunmathur.globalesim.ui.TransferScreen import com.vayunmathur.library.ui.IconGlobe@@ -29,18 +27,9 @@ fun Navigation(viewModel: EsimViewModel) {         entry<Route.Tabs> {             EsimTabs(                 viewModel = viewModel,-                onOpenInstall = { backStack.add(Route.Install) },-                onOpenBudget = { backStack.add(Route.Budget) },                 onOpenTransfer = { backStack.add(Route.Transfer) },             )         }-        entry<Route.Install> {-            InstallScreen(-                state = viewModel.state,-                onNavigateBack = { backStack.pop() },-                onDismissError = viewModel::dismissError,-            )-        }         entry<Route.Transfer> {             TransferScreen(                 state = viewModel.state,@@ -51,27 +40,17 @@ fun Navigation(viewModel: EsimViewModel) {                 onNavigateBack = { backStack.pop() },             )         }-        entry<Route.Budget> {-            BudgetScreen(-                state = viewModel.state,-                onNavigateBack = { backStack.pop() },-                onRefresh = viewModel::refreshBudget,-                onDismissError = viewModel::dismissError,-            )-        }     } }  /**  * The two bottom-nav tabs: Purchase (your eSIM + top-ups) and Pricing- * (searchable per-country rates). Install, Transfer, and Budget push on- * top as ordinary routes.+ * (searchable per-country rates). Install and Transfer push on top as+ * ordinary routes.  */ @Composable private fun EsimTabs(     viewModel: EsimViewModel,-    onOpenInstall: () -> Unit,-    onOpenBudget: () -> Unit,     onOpenTransfer: () -> Unit, ) {     val context = LocalContext.current@@ -80,7 +59,6 @@ private fun EsimTabs(         PagerTab("Purchase", { IconSim() }) {             HomeScreen(                 state = viewModel.state,-                onTopUp = viewModel::topUp,                 onCreateEsim = viewModel::createEsim,                 onStartCardPurchase = viewModel::startCardPurchase,                 onCardPurchaseDone = {@@ -98,8 +76,6 @@ private fun EsimTabs(                     }                 },                 onClearCryptoInvoice = viewModel::clearPendingInvoice,-                onOpenInstall = onOpenInstall,-                onOpenBudget = onOpenBudget,                 onOpenTransfer = onOpenTransfer,                 onDismissError = viewModel::dismissError,             )
globalesim/src/main/java/com/vayunmathur/globalesim/Route.kt
diff --git a/globalesim/src/main/java/com/vayunmathur/globalesim/Route.kt b/globalesim/src/main/java/com/vayunmathur/globalesim/Route.ktindex fef45cfa5b..d163a9c85d 100644--- a/globalesim/src/main/java/com/vayunmathur/globalesim/Route.kt+++ b/globalesim/src/main/java/com/vayunmathur/globalesim/Route.kt@@ -9,15 +9,7 @@ sealed interface Route : NavKey {     @Serializable     data object Tabs : Route -    /** Install: direct LPA handoff (reissues the same activation code). */-    @Serializable-    data object Install : Route-     /** Move the eSIM to a new phone. */     @Serializable     data object Transfer : Route--    /** Credit balance + top-up history. */-    @Serializable-    data object Budget : Route }
globalesim/src/main/java/com/vayunmathur/globalesim/platform/EsimViewModel.kt
diff --git a/globalesim/src/main/java/com/vayunmathur/globalesim/platform/EsimViewModel.kt b/globalesim/src/main/java/com/vayunmathur/globalesim/platform/EsimViewModel.ktindex ebc6ce5abe..c35d178aca 100644--- a/globalesim/src/main/java/com/vayunmathur/globalesim/platform/EsimViewModel.kt+++ b/globalesim/src/main/java/com/vayunmathur/globalesim/platform/EsimViewModel.kt@@ -74,12 +74,11 @@ class EsimViewModel(app: Application) : AndroidViewModel(app) {      fun refreshAll() {         refreshRates()-        // No eSIM yet (fresh install, pre-create): status/budget would hit-        // a nonexistent account, so skip them. createEsim/transferIn call+        // No eSIM yet (fresh install, pre-create): status would hit+        // a nonexistent account, so skip it. createEsim/transferIn call         // refreshAll again once the account exists.         if (state.profile == null) return         refreshStatus()-        refreshBudget()     }      fun refreshStatus() {@@ -99,37 +98,6 @@ class EsimViewModel(app: Application) : AndroidViewModel(app) {         }     } -    fun refreshBudget() {-        viewModelScope.launch {-            runCatching { EsimApi.budget(accountId()) }-                .onSuccess { state = state.copy(budgetCents = it.budgetUsdCents) }-                .onFailure { state = state.copy(error = it.message) }-        }-    }--    /**-     * Move credit from budget to the on-SIM wallet. One attempt per call;-     * the caller disables the button while [EsimUiState.loading] so a-     * double-tap cannot double-charge. Each attempt carries a fresh-     * idempotency key and the server dedupes replays.-     */-    fun topUp(amountCents: Long) {-        viewModelScope.launch {-            state = state.copy(loading = true, error = null)-            val req = TopUpRequest(accountId(), amountCents, UUID.randomUUID().toString())-            runCatching { EsimApi.topUp(req) }-                .onSuccess {-                    state = state.copy(-                        loading = false,-                        budgetCents = it.budgetUsdCents,-                        profile = state.profile?.copy(walletUsdCents = it.walletUsdCents),-                    )-                    refreshStatus()-                }-                .onFailure { state = state.copy(loading = false, error = it.message) }-        }-    }-     fun setEnabled(iccid: String, enabled: Boolean) {         viewModelScope.launch {             runCatching {@@ -218,8 +186,7 @@ class EsimViewModel(app: Application) : AndroidViewModel(app) {                 .onSuccess {                     if (it.status == "finished") {                         state = state.copy(pendingInvoiceUrl = null, pendingInvoiceId = null)-                        refreshBudget()-                        refreshAll()+                        refreshStatus()                     }                     onResult(it.status)                 }
globalesim/src/main/java/com/vayunmathur/globalesim/ui/BudgetScreen.kt
diff --git a/globalesim/src/main/java/com/vayunmathur/globalesim/ui/BudgetScreen.kt b/globalesim/src/main/java/com/vayunmathur/globalesim/ui/BudgetScreen.ktdeleted file mode 100644index c3bad43984..0000000000--- a/globalesim/src/main/java/com/vayunmathur/globalesim/ui/BudgetScreen.kt+++ /dev/null@@ -1,73 +0,0 @@-package com.vayunmathur.globalesim.ui--import androidx.compose.foundation.layout.Column-import androidx.compose.foundation.layout.fillMaxWidth-import androidx.compose.foundation.layout.padding-import androidx.compose.runtime.Composable-import androidx.compose.runtime.LaunchedEffect-import androidx.compose.ui.Modifier-import androidx.compose.ui.unit.dp-import com.vayunmathur.globalesim.domain.QuoteMath-import com.vayunmathur.globalesim.platform.EsimUiState-import com.vayunmathur.library.ui.AppScaffold-import com.vayunmathur.library.ui.Card-import com.vayunmathur.library.ui.IconRefresh-import com.vayunmathur.library.ui.IconButton-import com.vayunmathur.library.ui.Text-import com.vayunmathur.library.ui.appBarScrollBehavior-import com.vayunmathur.library.ui.rememberMessenger--/**- * Credit balance: the user-paid pool that top-ups draw from. Newly moved- * credit can take ~15 minutes to show full speed while the network- * confirms payment. (Stripe card top-up lands here in Phase 4.)- */-@Composable-fun BudgetScreen(-    state: EsimUiState,-    onNavigateBack: () -> Unit,-    onRefresh: () -> Unit,-    onDismissError: () -> Unit,-) {-    val messenger = rememberMessenger()-    val error = state.error-    LaunchedEffect(error) {-        if (error != null) {-            messenger.show(error)-            onDismissError()-        }-    }-    AppScaffold(-        title = "Credit",-        scrollBehavior = appBarScrollBehavior(),-        onNavigateBack = onNavigateBack,-        actions = {-            IconButton(onClick = onRefresh) { IconRefresh() }-        },-    ) { padding ->-        Column(Modifier.padding(padding).padding(16.dp)) {-            Card(Modifier.fillMaxWidth()) {-                Column(Modifier.padding(16.dp)) {-                    val cents = state.budgetCents-                    Text(-                        if (cents == null) "Balance unknown — pull to refresh."-                        else "Credit: ${QuoteMath.formatCents(cents)}",-                    )-                    val wallet = state.profile?.walletUsdCents-                    if (wallet != null) {-                        Text(-                            "On eSIM: ${QuoteMath.formatCents(wallet)}",-                            modifier = Modifier.padding(top = 4.dp),-                        )-                    }-                    if (cents != null && cents < 500) {-                        Text(-                            "Low credit: top up from Home before your wallet runs out.",-                            modifier = Modifier.padding(top = 8.dp),-                        )-                    }-                }-            }-        }-    }-}
globalesim/src/main/java/com/vayunmathur/globalesim/ui/HomeScreen.kt
diff --git a/globalesim/src/main/java/com/vayunmathur/globalesim/ui/HomeScreen.kt b/globalesim/src/main/java/com/vayunmathur/globalesim/ui/HomeScreen.ktindex c4df265cb1..5ae0581b17 100644--- a/globalesim/src/main/java/com/vayunmathur/globalesim/ui/HomeScreen.kt+++ b/globalesim/src/main/java/com/vayunmathur/globalesim/ui/HomeScreen.kt@@ -1,10 +1,16 @@ package com.vayunmathur.globalesim.ui  import android.content.Intent+import androidx.compose.foundation.layout.Arrangement+import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column+import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth+import androidx.compose.foundation.layout.offset import androidx.compose.foundation.layout.padding import androidx.compose.foundation.rememberScrollState+import androidx.compose.foundation.shape.RoundedCornerShape+import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.foundation.verticalScroll import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect@@ -12,8 +18,10 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue+import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext+import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.unit.dp import androidx.core.net.toUri import com.stripe.android.PaymentConfiguration@@ -22,14 +30,19 @@ import com.stripe.android.paymentsheet.PaymentSheetResult import com.stripe.android.paymentsheet.rememberPaymentSheet import com.vayunmathur.globalesim.domain.QuoteMath import com.vayunmathur.globalesim.platform.EsimUiState+import com.vayunmathur.library.intents.euicc.EsimLink import com.vayunmathur.library.ui.AppScaffold import com.vayunmathur.library.ui.Button import com.vayunmathur.library.ui.Card import com.vayunmathur.library.ui.LoadingIndicator+import com.vayunmathur.library.ui.MaterialTheme import com.vayunmathur.library.ui.OutlinedButton+import com.vayunmathur.library.ui.OutlinedTextField+import com.vayunmathur.library.ui.Surface import com.vayunmathur.library.ui.Text import com.vayunmathur.library.ui.appBarScrollBehavior import com.vayunmathur.library.ui.rememberMessenger+import kotlin.math.roundToLong  /**  * Home: your global eSIM at a glance — status, wallet balance, one-tap@@ -39,15 +52,12 @@ import com.vayunmathur.library.ui.rememberMessenger @Composable fun HomeScreen(     state: EsimUiState,-    onTopUp: (Long) -> Unit,     onCreateEsim: () -> Unit,     onStartCardPurchase: (amountCents: Long, publishableKey: String?, onKey: (String) -> Unit, onSheetReady: () -> Unit) -> Unit,     onCardPurchaseDone: () -> Unit,     onStartCryptoPurchase: (Long) -> Unit,     onCheckCryptoStatus: () -> Unit,     onClearCryptoInvoice: () -> Unit,-    onOpenInstall: () -> Unit,-    onOpenBudget: () -> Unit,     onOpenTransfer: () -> Unit,     onDismissError: () -> Unit, ) {@@ -125,7 +135,7 @@ fun HomeScreen(                     } else {                         Text("Status: ${profile.status}")                         Text(-                            "Wallet: ${QuoteMath.formatCents(profile.walletUsdCents)}",+                            "Balance: ${QuoteMath.formatCents(profile.walletUsdCents)}",                             modifier = Modifier.padding(top = 4.dp),                         )                         Text(@@ -138,7 +148,6 @@ fun HomeScreen(             if (profile != null) {                 TopUpCard(                     loading = state.loading,-                    onTopUp = onTopUp,                     onBuyWithCard = { cents ->                         onStartCardPurchase(                             cents,@@ -158,17 +167,27 @@ fun HomeScreen(                     modifier = Modifier.padding(top = 12.dp),                 )                 OutlinedButton(-                    onClick = onOpenInstall,+                    onClick = {+                        // The vendor stores SM-DP+ and matching ID separately;+                        // the LPA needs the full LPA:1$<smdp>$<code> string.+                        // A bare matching ID fails validation and lands on a+                        // blank manual-entry page.+                        val code = profile.activationCode+                        val full = if (code.startsWith("LPA:", ignoreCase = true) || '$' in code) {+                            code+                        } else {+                            "LPA:1$${profile.smdpAddress}$code"+                        }+                        val intent = Intent(+                            Intent.ACTION_VIEW,+                            EsimLink.provisioningUri(full),+                        ).setPackage(EsimLink.LPA_PACKAGE)+                        context.startActivity(intent)+                    },                     modifier = Modifier.fillMaxWidth().padding(top = 12.dp),                 ) {                     Text("Install / reinstall eSIM")                 }-                OutlinedButton(-                    onClick = onOpenBudget,-                    modifier = Modifier.fillMaxWidth().padding(top = 8.dp),-                ) {-                    Text("Credit balance")-                }                 OutlinedButton(                     onClick = onOpenTransfer,                     modifier = Modifier.fillMaxWidth().padding(top = 8.dp),@@ -181,14 +200,14 @@ fun HomeScreen( }  /**- * Fixed top-up presets. The button disables while a top-up is in flight- * so a double-tap cannot double-charge; each attempt carries a fresh- * idempotency key and the server dedupes replays.+ * Custom-amount top-up. The user types any dollar amount; two side-by-side+ * buttons pay by card ($5 min) or crypto ($2 min, +5% bonus), both capped+ * at $20. Payment funds the eSIM wallet directly — there is no manual+ * move step and no separate credit pool.  */ @Composable private fun TopUpCard(     loading: Boolean,-    onTopUp: (Long) -> Unit,     onBuyWithCard: (Long) -> Unit,     onBuyWithCrypto: (Long) -> Unit,     pendingInvoiceUrl: String?,@@ -199,45 +218,63 @@ private fun TopUpCard( ) {     val context = LocalContext.current     val messenger = rememberMessenger()+    var amountText by remember { mutableStateOf("") }+    // Parse "$12.34" / "12.34" to integer cents; null while invalid.+    val amountCents: Long? = remember(amountText) {+        val cleaned = amountText.trim().removePrefix("$")+        if (cleaned.isEmpty()) null+        else cleaned.toDoubleOrNull()?.let { (it * 100).roundToLong() }?.takeIf { it > 0 }+    }+    val cardOk = amountCents != null && amountCents in 500..2000+    val cryptoOk = amountCents != null && amountCents in 200..2000+    // Live bonus preview: 5% of the entered amount.+    val bonusPreview: Long? = amountCents?.let { (it * 105) / 100 - it }?.takeIf { cryptoOk }     Card(modifier.fillMaxWidth()) {         Column(Modifier.padding(16.dp)) {-            Text("Top up credit")+            Text("Top up")             Text(-                "Tops up the eSIM wallet directly. ~$1/GB in most countries.",+                "Enter any amount. Card: $5 min. Crypto: $2 min, +5% bonus. $20 max.",                 modifier = Modifier.padding(top = 4.dp),             )-            val presets = listOf(500L to "$5", 1000L to "$10", 2000L to "$20")-            for ((cents, label) in presets) {+            OutlinedTextField(+                value = amountText,+                onValueChange = { amountText = it },+                label = { Text("Amount (USD)") },+                keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Decimal),+                singleLine = true,+                modifier = Modifier.fillMaxWidth().padding(top = 8.dp),+            )+            if (bonusPreview != null && bonusPreview > 0) {+                Text(+                    "Crypto bonus: +${QuoteMath.formatCents(bonusPreview)} extra.",+                    modifier = Modifier.padding(top = 4.dp),+                )+            }+            Row(+                modifier = Modifier.fillMaxWidth().padding(top = 8.dp),+                horizontalArrangement = Arrangement.spacedBy(8.dp),+            ) {                 Button(-                    onClick = { onTopUp(cents) },-                    enabled = !loading,-                    modifier = Modifier.fillMaxWidth().padding(top = 8.dp),+                    onClick = { onBuyWithCard(amountCents!!) },+                    enabled = !loading && cardOk,+                    modifier = Modifier.weight(1f),                 ) {-                    Text("Add $label credit")+                    Text("Card topup")                 }-            }-            Text(-                "Or pay by card — credit lands automatically after payment.",-                modifier = Modifier.padding(top = 8.dp),-            )-            for ((cents, label) in presets) {-                OutlinedButton(-                    onClick = { onBuyWithCard(cents) },-                    enabled = !loading,-                    modifier = Modifier.fillMaxWidth().padding(top = 8.dp),-                ) {-                    Text("Buy $label with card")+                BadgedBox(badge = "+5%", modifier = Modifier.weight(1f)) {+                    OutlinedButton(+                        onClick = { onBuyWithCrypto(amountCents!!) },+                        enabled = !loading && cryptoOk,+                        modifier = Modifier.fillMaxWidth(),+                    ) {+                        Text("Crypto topup")+                    }                 }             }-            Text(-                "Or pay with crypto and get 5% extra credit free — " +-                    "e.g. pay $10, get $10.50. No account needed.",-                modifier = Modifier.padding(top = 8.dp),-            )             if (pendingInvoiceUrl != null) {                 Text(                     "Checkout open in your browser. Come back here when you've paid.",-                    modifier = Modifier.padding(top = 4.dp),+                    modifier = Modifier.padding(top = 8.dp),                 )                 if (pendingBonusCents > 0) {                     Text(@@ -268,17 +305,30 @@ private fun TopUpCard(                 ) {                     Text("Cancel crypto payment")                 }-            } else {-                for ((cents, label) in presets) {-                    OutlinedButton(-                        onClick = { onBuyWithCrypto(cents) },-                        enabled = !loading,-                        modifier = Modifier.fillMaxWidth().padding(top = 8.dp),-                    ) {-                        Text("Buy $label with crypto (+5%)")-                    }-                }             }         }     } }++/** Small pill badge overlapped on the top-end corner of [content]. */+@Composable+private fun BadgedBox(+    badge: String,+    modifier: Modifier = Modifier,+    content: @Composable () -> Unit,+) {+    Box(modifier) {+        content()+        Surface(+            shape = RoundedCornerShape(8.dp),+            color = MaterialTheme.colorScheme.tertiaryContainer,+            modifier = Modifier.align(Alignment.TopEnd).offset(x = 4.dp, y = (-8).dp),+        ) {+            Text(+                badge,+                style = MaterialTheme.typography.labelSmall,+                modifier = Modifier.padding(horizontal = 6.dp, vertical = 2.dp),+            )+        }+    }+}
globalesim/src/main/java/com/vayunmathur/globalesim/ui/InstallScreen.kt
diff --git a/globalesim/src/main/java/com/vayunmathur/globalesim/ui/InstallScreen.kt b/globalesim/src/main/java/com/vayunmathur/globalesim/ui/InstallScreen.ktdeleted file mode 100644index ab5563b9ed..0000000000--- a/globalesim/src/main/java/com/vayunmathur/globalesim/ui/InstallScreen.kt+++ /dev/null@@ -1,86 +0,0 @@-package com.vayunmathur.globalesim.ui--import android.content.Intent-import androidx.compose.foundation.layout.Column-import androidx.compose.foundation.layout.fillMaxWidth-import androidx.compose.foundation.layout.padding-import androidx.compose.runtime.Composable-import androidx.compose.runtime.LaunchedEffect-import androidx.compose.ui.Modifier-import androidx.compose.ui.platform.LocalContext-import androidx.compose.ui.unit.dp-import com.vayunmathur.globalesim.platform.EsimUiState-import com.vayunmathur.library.intents.euicc.EsimLink-import com.vayunmathur.library.ui.AppScaffold-import com.vayunmathur.library.ui.Button-import com.vayunmathur.library.ui.Card-import com.vayunmathur.library.ui.LoadingIndicator-import com.vayunmathur.library.ui.Text-import com.vayunmathur.library.ui.appBarScrollBehavior-import com.vayunmathur.library.ui.rememberMessenger--/**- * Install: one-tap direct install for the account's single eSIM. Goes- * straight through the on-device eSIM manager ([EsimLink.provisioningUri]- * pinned to the LPA package) — this app never duplicates LPA logic and- * shows no code or QR. After a transfer, the same button installs the- * reissued profile on the new phone.- */-@Composable-fun InstallScreen(-    state: EsimUiState,-    onNavigateBack: () -> Unit,-    onDismissError: () -> Unit,-) {-    val messenger = rememberMessenger()-    val error = state.error-    LaunchedEffect(error) {-        if (error != null) {-            messenger.show(error)-            onDismissError()-        }-    }-    val context = LocalContext.current-    val profile = state.profile-    AppScaffold(-        title = "Install eSIM",-        scrollBehavior = appBarScrollBehavior(),-        onNavigateBack = onNavigateBack,-    ) { padding ->-        Column(Modifier.padding(padding).padding(16.dp)) {-            if (state.loading && profile == null) {-                LoadingIndicator()-                return@Column-            }-            if (profile == null || profile.activationCode.isEmpty()) {-                Text("Your eSIM is being created — check back in a minute.")-                return@Column-            }-            Card(Modifier.fillMaxWidth()) {-                Column(Modifier.padding(16.dp)) {-                    Text("Status: ${profile.status}")-                    Text(-                        "One tap installs your global eSIM. It works in 200+ countries.",-                        modifier = Modifier.padding(top = 4.dp),-                    )-                }-            }-            Button(-                onClick = {-                    val intent = Intent(-                        Intent.ACTION_VIEW,-                        EsimLink.provisioningUri(profile.activationCode),-                    ).setPackage(EsimLink.LPA_PACKAGE)-                    context.startActivity(intent)-                },-                modifier = Modifier.fillMaxWidth().padding(top = 16.dp),-            ) {-                Text("Install eSIM")-            }-            Text(-                "Already installed on another phone? Move it with a transfer code instead of installing twice.",-                modifier = Modifier.padding(top = 8.dp),-            )-        }-    }-}
globalesim/src/screenshotTest/kotlin/com/vayunmathur/globalesim/ui/MetadataPreviews.kt
diff --git a/globalesim/src/screenshotTest/kotlin/com/vayunmathur/globalesim/ui/MetadataPreviews.kt b/globalesim/src/screenshotTest/kotlin/com/vayunmathur/globalesim/ui/MetadataPreviews.ktindex 8e159cfd1d..8563cdd345 100644--- a/globalesim/src/screenshotTest/kotlin/com/vayunmathur/globalesim/ui/MetadataPreviews.kt+++ b/globalesim/src/screenshotTest/kotlin/com/vayunmathur/globalesim/ui/MetadataPreviews.kt@@ -52,16 +52,13 @@ class MetadataPreviews {     fun Preview1Purchase() {         DynamicTheme(darkTheme = true) {             HomeScreen(-                state = EsimUiState(profile = demoProfile, budgetCents = 2000),-                onTopUp = {},+                state = EsimUiState(profile = demoProfile),                 onCreateEsim = {},                 onStartCardPurchase = { _, _, _, _ -> },                 onCardPurchaseDone = {},                 onStartCryptoPurchase = {},                 onCheckCryptoStatus = {},                 onClearCryptoInvoice = {},-                onOpenInstall = {},-                onOpenBudget = {},                 onOpenTransfer = {},                 onDismissError = {},             )@@ -79,31 +76,4 @@ class MetadataPreviews {             )         }     }--    @PreviewTest-    @Preview(name = "3-install", device = PHONE, showSystemUi = true)-    @Composable-    fun Preview3Install() {-        DynamicTheme(darkTheme = true) {-            InstallScreen(-                state = EsimUiState(profile = demoProfile),-                onNavigateBack = {},-                onDismissError = {},-            )-        }-    }--    @PreviewTest-    @Preview(name = "4-budget", device = PHONE, showSystemUi = true)-    @Composable-    fun Preview4Budget() {-        DynamicTheme(darkTheme = true) {-            BudgetScreen(-                state = EsimUiState(profile = demoProfile, budgetCents = 2000),-                onNavigateBack = {},-                onRefresh = {},-                onDismissError = {},-            )-        }-    } }