Skip to content

Commit 66e63f6

Browse files
committed
Dashboard: Hold back the upgrade promo card for launch
Pre-launch decision: build a user base before asking for the upgrade on the dashboard's main surface. Both render sites of UpgradePromoCard (the unsupported branch and the supported branch, after the quick-access promotion) are removed, so the dashboard no longer carries an upgrade ask of its own. The upgrade stays discoverable through the Pro badges, the locked tile/widget, and the settings row. shouldShowUpgradePromo still gates those badges, and the DashboardScreen onUpgrade parameter plus its MainActivity wiring are kept, so reintroducing the card after launch is a one-line change. The composable, its previews, strings, and component test are untouched.
1 parent 4be4964 commit 66e63f6

3 files changed

Lines changed: 15 additions & 15 deletions

File tree

app/src/main/java/eu/darken/amply/main/ui/dashboard/DashboardScreen.kt

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ fun DashboardScreen(
127127
onOpenSupportIssue: () -> Unit,
128128
onEmailSupport: () -> Unit,
129129
onHelp: () -> Unit,
130+
// Unused while UpgradePromoCard is held back for launch (see its docs). Kept — together with the
131+
// root wiring in MainActivity — so re-adding the card is a one-line change here.
130132
onUpgrade: () -> Unit = {},
131133
// Injectable so a screenshot/preview fixture can render a live session at a believable age instead
132134
// of at "0m" — the screen is otherwise pure, and this is the one value it reads from the clock.
@@ -332,12 +334,6 @@ fun DashboardScreen(
332334
)
333335
}
334336
}
335-
// Outside the contributionWanted block: an unsupported device we want no
336-
// contribution data from still gets the promo, same as a supported one. The two
337-
// branches are mutually exclusive, so the item key stays unique.
338-
if (shouldShowUpgradePromo(state.upgrade)) {
339-
item(key = "dashboard.upgrade") { UpgradePromoCard(onUpgrade = onUpgrade) }
340-
}
341337
} else {
342338
// Promote the widget/tile shortcuts only once setup is done (the setup guide above
343339
// has disappeared) and while at least one shortcut is still undiscovered.
@@ -354,20 +350,15 @@ fun DashboardScreen(
354350
widgetAdded = state.quickAccess.widgetAdded,
355351
tileAdded = state.quickAccess.tileAdded,
356352
tileRequestPending = state.tileRequestPending,
357-
// Same settled-and-not-Pro condition as the promo card below: an
358-
// unsettled entitlement badges nothing.
353+
// Settled and not upgraded only: an unsettled entitlement badges
354+
// nothing.
359355
showProBadge = shouldShowUpgradePromo(state.upgrade),
360356
onPinWidget = onPinWidget,
361357
onAddTile = onAddTile,
362358
onDismiss = onDismissQuickAccess,
363359
)
364360
}
365361
}
366-
// Directly after the quick-access promotion, which advertises the two shortcuts
367-
// this card is the way to unlock.
368-
if (shouldShowUpgradePromo(state.upgrade)) {
369-
item(key = "dashboard.upgrade") { UpgradePromoCard(onUpgrade = onUpgrade) }
370-
}
371362
val access = state.charging.access
372363
when {
373364
// System-namespace adapters (OnePlus/ColorOS): writes need Shizuku even
@@ -920,7 +911,7 @@ private fun DashboardScreenPreview() = PreviewWrapper {
920911
quickFullChargeEnabled = true,
921912
// Presence check done, nothing discovered yet — renders the quick-access promotion.
922913
quickAccessChecked = true,
923-
// Settled and not upgraded: the one combination that renders the upgrade promo.
914+
// Settled and not upgraded: the plain app-name title, plus the quick-access Pro badge.
924915
upgrade = UpgradeSnapshot(isPro = false, isSettled = true),
925916
// A resolved interruption: the warning card sits under the hero until dismissed.
926917
interruption = InterruptionEvent(

app/src/main/java/eu/darken/amply/main/ui/dashboard/DashboardViewModel.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,10 @@ data class UpgradeSnapshot(
121121
val isSettled: Boolean,
122122
)
123123

124-
/** The promo card is an ask; it has no business appearing before we know the answer, or after a yes. */
124+
/**
125+
* The upgrade ask — currently the Pro badges, and the promo card once it returns — has no business
126+
* appearing before we know the answer, or after a yes.
127+
*/
125128
fun shouldShowUpgradePromo(upgrade: UpgradeSnapshot?): Boolean =
126129
upgrade != null && upgrade.isSettled && !upgrade.isPro
127130

app/src/main/java/eu/darken/amply/main/ui/dashboard/UpgradePromoCard.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ import eu.darken.amply.common.compose.PreviewWrapper
3030
* The whole card is the tap target: it has exactly one action, and a card-sized ask whose only live
3131
* target was a small button in its corner made the rest of the card look inert. The action label
3232
* below is therefore just a label — the surface owns the tap.
33+
*
34+
* Currently **not rendered on the dashboard**: a pre-launch decision holds the upgrade ask back until
35+
* there is a user base to promote it to (the upgrade stays discoverable through the Pro badges, the
36+
* locked tile/widget, and the settings row). It used to sit in `DashboardScreen` after the alarm card
37+
* — after the quick-access promotion on a supported device, and after the contribution card on an
38+
* unsupported one — and is kept intact for that reintroduction.
3339
*/
3440
@Composable
3541
fun UpgradePromoCard(

0 commit comments

Comments
 (0)