diff --git a/app/src/main/java/to/bitkit/ui/screens/wallets/usdt/UsdtActivityDetail.kt b/app/src/main/java/to/bitkit/ui/screens/wallets/usdt/UsdtActivityDetail.kt index 1aedaf3cc5..5464b5a1cc 100644 --- a/app/src/main/java/to/bitkit/ui/screens/wallets/usdt/UsdtActivityDetail.kt +++ b/app/src/main/java/to/bitkit/ui/screens/wallets/usdt/UsdtActivityDetail.kt @@ -40,8 +40,10 @@ import com.synonym.bitkitcore.usdtFormatAmount import to.bitkit.R import to.bitkit.env.Env import to.bitkit.ext.UiDateStyle +import to.bitkit.ext.ellipsisMiddle import to.bitkit.ext.uiDateStyleFor import to.bitkit.models.PubkyPublicKeyFormat +import to.bitkit.models.Toast import to.bitkit.ui.appViewModel import to.bitkit.ui.components.BodyMSB import to.bitkit.ui.components.BodyS @@ -61,7 +63,9 @@ import to.bitkit.ui.screens.wallets.activity.components.AmountViewContent import to.bitkit.ui.screens.wallets.activity.components.CircularIcon import to.bitkit.ui.settingsViewModel import to.bitkit.ui.shared.UiConstants +import to.bitkit.ui.shared.modifiers.clickableAlpha import to.bitkit.ui.theme.Colors +import to.bitkit.ui.utils.copyToClipboard import to.bitkit.ui.utils.uiDateText @Composable @@ -240,8 +244,23 @@ internal val UsdtTransfer.detailTitleResource: Int get() = when { @Composable private fun UsdtTechnicalDetails(transfer: UsdtTransfer, hideBalance: Boolean, walletAddress: String) { transfer.txHash?.let { hash -> - UsdtDetailField(caption = stringResource(R.string.wallet__activity_tx_id)) { - SelectionContainer { BodySSB(hash, style = UsdtDetailStyles.Body) } + val app = appViewModel + val copiedText = stringResource(R.string.common__copied) + UsdtDetailField( + caption = stringResource(R.string.wallet__activity_tx_id), + modifier = Modifier + .clickableAlpha( + onClick = copyToClipboard(hash) { + app?.toast( + type = Toast.ToastType.SUCCESS, + title = copiedText, + description = it.ellipsisMiddle(40), + ) + } + ) + .testTag("UsdtActivityTxId") + ) { + BodySSB(hash, style = UsdtDetailStyles.Body) } } val sender = transfer.sender ?: walletAddress.takeIf { !transfer.isIncoming && it.isNotEmpty() } diff --git a/changelog.d/next/1633.fixed.md b/changelog.d/next/1633.fixed.md new file mode 100644 index 0000000000..28ccf7312f --- /dev/null +++ b/changelog.d/next/1633.fixed.md @@ -0,0 +1 @@ +Tapping the transaction ID in USDT activity details now copies it. diff --git a/journeys/usdt-bridge-details.xml b/journeys/usdt-bridge-details.xml index 17557d9cf4..f153e2ccb5 100644 --- a/journeys/usdt-bridge-details.xml +++ b/journeys/usdt-bridge-details.xml @@ -11,6 +11,7 @@ While Cross-Network Deposits is open, inject a confirmed incoming USDT transfer through the isolated fixture. Verify no received sheet interrupts deposit details or refund review. Return to the USDT wallet and verify the received celebration appears once after any active sheet is dismissed. Dismiss it and revisit deposit details, then return to the wallet; verify the same receipt does not appear again. Open the outgoing delivering USDT activity. Verify the Delivering USDT title, outgoing amount, teal up arrow, yellow Delivering status and actual receiving network. Tap Details (id "UsdtActivityDetails"). Verify the source transaction, sender and recipient addresses, sender and recipient networks, Orchestra provider and bridge reference. Verify Open Block Explorer (id "UsdtActivityExplorer") and Hide details remain reachable. + Tap the transaction ID (id "UsdtActivityTxId"). Verify from a screenshot that a "Copied To Clipboard" toast appears with the hash, and verify the clipboard holds the full source transaction hash. For a delayed, failed, refunding, refunded or support-needed bridge fixture, verify Contact Support (id "UsdtContactSupport") and Copy Details (id "UsdtCopyDetails") appear side by side as small 40-point buttons, matching the Request refund / Hide details row. Verify both remain reachable and their labels are not clipped, without submitting either action. Return to the USDT activity list. Verify Pending uses a yellow hourglass and 16% yellow circle, Failed uses a red x-circle and 16% red circle, and Transferring uses the teal transfer arrows. Sent and Received remain teal. Open USDT Receive and inject one confirmed incoming USDT transfer through the isolated fixture. Verify Receive is replaced by one received celebration. Dismiss it and verify the same transfer is not celebrated again; a different subsequent transfer must still be shown.