From f65b33821fa22475e103c9c6efe67b0ea4b39309 Mon Sep 17 00:00:00 2001 From: jvsena42 Date: Mon, 19 Oct 2026 12:02:20 -0300 Subject: [PATCH 1/3] fix: swipe between receive tabs from the usdt qr Co-Authored-By: Claude Opus 5.5 --- .../wallets/usdt/UsdtDepositReceiveScreen.kt | 92 +++++++++++-------- changelog.d/next/usdt-swipe.fixed.md | 1 + journeys/receive/usdt-receive-swipe-tabs.xml | 25 +++++ 3 files changed, 80 insertions(+), 38 deletions(-) create mode 100644 changelog.d/next/usdt-swipe.fixed.md create mode 100644 journeys/receive/usdt-receive-swipe-tabs.xml diff --git a/app/src/main/java/to/bitkit/ui/screens/wallets/usdt/UsdtDepositReceiveScreen.kt b/app/src/main/java/to/bitkit/ui/screens/wallets/usdt/UsdtDepositReceiveScreen.kt index fceb659049..bff9afae02 100644 --- a/app/src/main/java/to/bitkit/ui/screens/wallets/usdt/UsdtDepositReceiveScreen.kt +++ b/app/src/main/java/to/bitkit/ui/screens/wallets/usdt/UsdtDepositReceiveScreen.kt @@ -7,6 +7,7 @@ import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.ColumnScope import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll @@ -52,6 +53,7 @@ import to.bitkit.ui.components.usdtOverviewAmount import to.bitkit.ui.scaffold.SheetTopBar import to.bitkit.ui.screens.wallets.activity.components.CustomTabRowWithSpacing import to.bitkit.ui.screens.wallets.receive.ReceiveTab +import to.bitkit.ui.shared.modifiers.swipeToChangeTab import to.bitkit.ui.theme.AppTextStyles import to.bitkit.ui.theme.Colors import java.text.DecimalFormatSymbols @@ -133,44 +135,58 @@ internal fun ColumnScope.UsdtDepositReceiveScreen( VerticalSpacer(16.dp) } walletUi.error?.let { BodyS(stringResource(it), color = Colors.Brand) } - Content( - page = page, - onPage = { page = it }, - wallet = wallet, - receiveError = walletUi.refreshError, - state = state, - amount = if (page == ReceivePage.AMOUNT) draftAmount else amount, - onNetwork = { - if (state.network != it) { - amount = "" - draftAmount = "" - deposits.selectNetwork(it) - } - page = if (it == null || state.address != null && state.network == it) { - ReceivePage.ADDRESS - } else { - ReceivePage.AMOUNT - } - }, - onAmount = { - if (draftAmount != it) deposits.clearAmountError() - draftAmount = it - }, - onCreate = { - if (state.network == null) { - amount = draftAmount - page = ReceivePage.ADDRESS - } else { - deposits.prepare(draftAmount) - } - }, - onHistory = { app?.navigateToUsdtDeposits() }, - onRefresh = { - draftAmount = if (state.network == null) amount else draftAmount - deposits.selectNetwork(state.network) - page = ReceivePage.AMOUNT - }, - ) + val tabIndex = tabs.indexOf(ReceiveTab.USDT) + Column( + modifier = Modifier + .weight(1f) + .fillMaxWidth() + .then( + if (page == ReceivePage.ADDRESS) { + Modifier.swipeToChangeTab(tabIndex, tabs.size, { onSelectTab(tabs[it]) }) + } else { + Modifier + } + ) + ) { + Content( + page = page, + onPage = { page = it }, + wallet = wallet, + receiveError = walletUi.refreshError, + state = state, + amount = if (page == ReceivePage.AMOUNT) draftAmount else amount, + onNetwork = { + if (state.network != it) { + amount = "" + draftAmount = "" + deposits.selectNetwork(it) + } + page = if (it == null || state.address != null && state.network == it) { + ReceivePage.ADDRESS + } else { + ReceivePage.AMOUNT + } + }, + onAmount = { + if (draftAmount != it) deposits.clearAmountError() + draftAmount = it + }, + onCreate = { + if (state.network == null) { + amount = draftAmount + page = ReceivePage.ADDRESS + } else { + deposits.prepare(draftAmount) + } + }, + onHistory = { app?.navigateToUsdtDeposits() }, + onRefresh = { + draftAmount = if (state.network == null) amount else draftAmount + deposits.selectNetwork(state.network) + page = ReceivePage.AMOUNT + }, + ) + } } @Composable diff --git a/changelog.d/next/usdt-swipe.fixed.md b/changelog.d/next/usdt-swipe.fixed.md new file mode 100644 index 0000000000..d072cf5283 --- /dev/null +++ b/changelog.d/next/usdt-swipe.fixed.md @@ -0,0 +1 @@ +Swiping over the USDT receive QR now changes tabs instead of copying the address. diff --git a/journeys/receive/usdt-receive-swipe-tabs.xml b/journeys/receive/usdt-receive-swipe-tabs.xml new file mode 100644 index 0000000000..c9719c010a --- /dev/null +++ b/journeys/receive/usdt-receive-swipe-tabs.xml @@ -0,0 +1,25 @@ + + + On the Receive sheet, swiping sideways over the QR changes tabs on every tab, USDT included. + With USDT selected, a swipe to the right over its QR selects the tab before it (Spending) and + does not copy the address; a swipe to the left does nothing, since USDT is the last tab. A single + tap on the USDT QR still copies the address and shows the "copied" tooltip. + + Precondition: onboarded dev wallet with USDT enabled (introductory sheet or Settings, General, + Payments), no CJIT invoice pending, start on the wallet home screen. The USDT address loads + without funding; wait for the QR before swiping. + + The copy shows as a tooltip over the QR for about two seconds, so a check for "no copy" reads a + screenshot taken right after the swipe. Swipe with `adb shell input swipe` across the middle of + the QR, about 60% of its width, in 300 ms. + + + Tap Receive (testTag "Receive") + Tap the USDT tab (testTag "Tab-usdt") and wait until the USDT QR is visible + Swipe right across the QR and take a screenshot right away + Verify the Spending tab (testTag "Tab-spending") is selected, the Lightning receive content or the Spending setup is shown, and the screenshot shows no "copied" tooltip + Swipe left across the QR and verify the USDT tab is selected and its QR is visible + Swipe left across the USDT QR and take a screenshot right away; verify the USDT tab stays selected and the screenshot shows no "copied" tooltip + Tap the USDT QR once and verify the "copied" tooltip appears + + From b1c88fcae31604c92671a00c04a47b1bc0be4490 Mon Sep 17 00:00:00 2001 From: jvsena42 Date: Mon, 19 Oct 2026 13:39:48 -0300 Subject: [PATCH 2/3] chore: rename changelog fragment Co-Authored-By: Claude Opus 5.5 --- changelog.d/next/{usdt-swipe.fixed.md => 1582.fixed.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename changelog.d/next/{usdt-swipe.fixed.md => 1582.fixed.md} (100%) diff --git a/changelog.d/next/usdt-swipe.fixed.md b/changelog.d/next/1582.fixed.md similarity index 100% rename from changelog.d/next/usdt-swipe.fixed.md rename to changelog.d/next/1582.fixed.md From f64fef9baa3689dbd1a2636fc3875a8fc07cf0d6 Mon Sep 17 00:00:00 2001 From: jvsena42 Date: Mon, 19 Oct 2026 13:45:45 -0300 Subject: [PATCH 3/3] test: swipe back from spending setup in usdt swipe journey Co-Authored-By: Claude Opus 5.5 --- journeys/receive/usdt-receive-swipe-tabs.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/journeys/receive/usdt-receive-swipe-tabs.xml b/journeys/receive/usdt-receive-swipe-tabs.xml index c9719c010a..95683d4fc5 100644 --- a/journeys/receive/usdt-receive-swipe-tabs.xml +++ b/journeys/receive/usdt-receive-swipe-tabs.xml @@ -11,14 +11,16 @@ The copy shows as a tooltip over the QR for about two seconds, so a check for "no copy" reads a screenshot taken right after the swipe. Swipe with `adb shell input swipe` across the middle of - the QR, about 60% of its width, in 300 ms. + the QR, about 60% of its width, in 300 ms. Back from Spending to USDT goes through the tab + pager, which snaps back from a 300 ms synthetic swipe on the emulator; a 600 ms swipe moves it. + On a wallet without a Lightning channel, Spending shows its setup view instead of a QR. Tap Receive (testTag "Receive") Tap the USDT tab (testTag "Tab-usdt") and wait until the USDT QR is visible Swipe right across the QR and take a screenshot right away Verify the Spending tab (testTag "Tab-spending") is selected, the Lightning receive content or the Spending setup is shown, and the screenshot shows no "copied" tooltip - Swipe left across the QR and verify the USDT tab is selected and its QR is visible + Swipe left across the middle of the Spending content, whether it shows a Lightning QR or the Spending setup, in 600 ms (`adb shell input swipe 900 1200 150 1200 600`); verify the USDT tab is selected and wait until its QR is visible Swipe left across the USDT QR and take a screenshot right away; verify the USDT tab stays selected and the screenshot shows no "copied" tooltip Tap the USDT QR once and verify the "copied" tooltip appears