fix naming on wallet type page (#3279)
What changed, and why it matters
This commit is a routine user-interface polish change. It splits wallet names into separate 'name' and 'ticker' fields (e.g., 'Monero' and 'XMR' instead of 'Monero (XMR)'), adds a small layout padding tweak, and lets users long-press a transaction amount to copy it. There is nothing in the code that affects security, funds, cryptography, or private data.
No security action needed. Treat as a normal UI/UX improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff refactors walletTypeToDisplayName to return only the coin name and introduces walletTypeToDisplayTicker for the ticker symbol. It updates new_wallet_type_page.dart to use the two helpers and adjusts bottom padding. It also wraps the transaction-history crypto amount in a CopyWrapper with requireLongPress=true so the value can be copied via long-press. A pubspec.lock update bumps the trezor-flutter git ref, but no security-relevant change is visible in this commit.
Changed components
cw_core/lib/wallet_type.dartlib/src/screens/new_wallet/new_wallet_type_page.dartlib/new-ui/widgets/coins_page/assets_history/transaction_details_modal.dartlib/new-ui/widgets/copy_wrapper.dartcw_monero/pubspec.lockInspect captured patch +68 / −55
diff --git a/cw_core/lib/wallet_type.dart b/cw_core/lib/wallet_type.dart
index 10a472d6..7ef16d8a 100644
--- a/cw_core/lib/wallet_type.dart
+++ b/cw_core/lib/wallet_type.dart
@@ -238,50 +238,51 @@ String walletTypeToString(WalletType type) {
}
}
-String walletTypeToDisplayName(WalletType type) {
- switch (type) {
- case WalletType.monero:
- return 'Monero (XMR)';
- case WalletType.bitcoin:
- return 'Bitcoin (BTC)';
- case WalletType.litecoin:
- return 'Litecoin (LTC)';
- case WalletType.haven:
- return 'Haven (XHV)';
- case WalletType.ethereum:
- return 'Ethereum (ETH)';
- case WalletType.bitcoinCash:
- return 'Bitcoin Cash (BCH)';
- case WalletType.nano:
- return 'Nano (XNO)';
- case WalletType.banano:
- return 'Banano (BAN)';
- case WalletType.polygon:
- return 'Polygon (POL)';
- case WalletType.solana:
- return 'Solana (SOL)';
- case WalletType.tron:
- return 'Tron (TRX)';
- case WalletType.wownero:
- return 'Wownero (WOW)';
- case WalletType.zano:
- return 'Zano (ZANO)';
- case WalletType.decred:
- return 'Decred (DCR)';
- case WalletType.dogecoin:
- return 'Dogecoin (DOGE)';
- case WalletType.base:
- return 'Base';
- case WalletType.arbitrum:
- return 'Arbitrum (ARB)';
- case WalletType.zcash:
- return 'Zcash (ZEC)';
- case WalletType.bsc:
- return 'BNB Smart Chain (BNB)';
- case WalletType.none:
- return '';
- }
-}
+String walletTypeToDisplayName(WalletType type) => switch (type) {
+ WalletType.monero => 'Monero',
+ WalletType.bitcoin => 'Bitcoin',
+ WalletType.litecoin => 'Litecoin',
+ WalletType.haven => 'Haven',
+ WalletType.ethereum => 'Ethereum',
+ WalletType.bitcoinCash => 'Bitcoin Cash',
+ WalletType.nano => 'Nano',
+ WalletType.banano => 'Banano',
+ WalletType.polygon => 'Polygon',
+ WalletType.solana => 'Solana',
+ WalletType.tron => 'Tron',
+ WalletType.wownero => 'Wownero',
+ WalletType.zano => 'Zano',
+ WalletType.decred => 'Decred',
+ WalletType.dogecoin => 'Dogecoin',
+ WalletType.base => 'Base',
+ WalletType.arbitrum => 'Arbitrum',
+ WalletType.zcash => 'Zcash',
+ WalletType.bsc => 'BNB Smart Chain',
+ WalletType.none => ''
+ };
+
+String walletTypeToDisplayTicker(WalletType type) => switch (type) {
+ WalletType.monero => 'XMR',
+ WalletType.bitcoin => 'BTC',
+ WalletType.litecoin => 'LTC',
+ WalletType.haven => 'XHV',
+ WalletType.ethereum => 'ETH',
+ WalletType.bitcoinCash => 'BCH',
+ WalletType.nano => 'XNO',
+ WalletType.banano => 'BAN',
+ WalletType.polygon => 'POL',
+ WalletType.solana => 'SOL',
+ WalletType.tron => 'TRX',
+ WalletType.wownero => 'WOW',
+ WalletType.zano => 'ZANO',
+ WalletType.decred => 'DCR',
+ WalletType.dogecoin => 'DOGE',
+ WalletType.base => '',
+ WalletType.arbitrum => 'ARB',
+ WalletType.zcash => 'ZEC',
+ WalletType.bsc => 'BNB',
+ WalletType.none => ''
+ };
WalletType? _cryptoCurrencyToWalletType(CryptoCurrency type) {
switch (type) {
diff --git a/cw_monero/pubspec.lock b/cw_monero/pubspec.lock
index fc33c6fe..2cd06b9d 100644
--- a/cw_monero/pubspec.lock
+++ b/cw_monero/pubspec.lock
@@ -982,8 +982,8 @@ packages:
dependency: "direct main"
description:
path: trezor-flutter
- ref: "4bf54339a1caefd4c53a4a8873a9686ec13a9107"
- resolved-ref: "4bf54339a1caefd4c53a4a8873a9686ec13a9107"
+ ref: becd18ac474d343d94b6191d89fad43270d2a02e
+ resolved-ref: becd18ac474d343d94b6191d89fad43270d2a02e
url: "https://github.com/cake-tech/trezor-flutter.git"
source: git
version: "0.1.0"
@@ -991,8 +991,8 @@ packages:
dependency: transitive
description:
path: trezor_usb_transport
- ref: "4bf54339a1caefd4c53a4a8873a9686ec13a9107"
- resolved-ref: "4bf54339a1caefd4c53a4a8873a9686ec13a9107"
+ ref: becd18ac474d343d94b6191d89fad43270d2a02e
+ resolved-ref: becd18ac474d343d94b6191d89fad43270d2a02e
url: "https://github.com/cake-tech/trezor-flutter.git"
source: git
version: "0.0.1"
diff --git a/lib/new-ui/widgets/coins_page/assets_history/transaction_details_modal.dart b/lib/new-ui/widgets/coins_page/assets_history/transaction_details_modal.dart
index 2eb69205..d81db4ac 100644
--- a/lib/new-ui/widgets/coins_page/assets_history/transaction_details_modal.dart
+++ b/lib/new-ui/widgets/coins_page/assets_history/transaction_details_modal.dart
@@ -1,6 +1,7 @@
import 'package:cake_wallet/entities/new_ui_entities/list_item/list_item.dart';
import 'package:cake_wallet/entities/new_ui_entities/list_item/list_item_regular_row.dart';
import 'package:cake_wallet/generated/i18n.dart';
+import 'package:cake_wallet/new-ui/widgets/copy_wrapper.dart';
import 'package:cake_wallet/new-ui/widgets/receive_page/receive_top_bar.dart';
import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/src/screens/transaction_details/confirmations_list_item.dart';
@@ -81,9 +82,17 @@ class _TransactionDetailsModalState extends State<TransactionDetailsModal> {
widget.transactionDetailsViewModel.formattedStatus,
style: TextStyle(fontSize: 20, fontWeight: FontWeight.w500),
),
- Text(
- widget.transactionDetailsViewModel.formattedCryptoAmount,
- style: TextStyle(fontSize: 28),
+ CopyWrapper(
+ requireLongPress: true,
+ data: ClipboardData(text: widget.transactionDetailsViewModel.formattedCryptoAmount),
+ builder: (context, copied)=> AnimatedSwitcher(
+ duration: Duration(milliseconds: 300),
+ child: Text(
+ key: ValueKey(copied),
+ copied ? S.of(context).copied : widget.transactionDetailsViewModel.formattedCryptoAmount,
+ style: TextStyle(fontSize: 28, color: copied ? Theme.of(context).colorScheme.primary : Theme.of(context).colorScheme.onSurface),
+ ),
+ ),
),
Padding(
padding: const EdgeInsets.all(16.0),
diff --git a/lib/new-ui/widgets/copy_wrapper.dart b/lib/new-ui/widgets/copy_wrapper.dart
index 83ed13a4..58793066 100644
--- a/lib/new-ui/widgets/copy_wrapper.dart
+++ b/lib/new-ui/widgets/copy_wrapper.dart
@@ -9,12 +9,14 @@ class CopyWrapper extends StatefulWidget {
const CopyWrapper(
{super.key,
this.data,
+ this.requireLongPress = false,
this.isSensitive = false,
required this.builder,
this.duration = const Duration(milliseconds: 1200)});
final ClipboardData? data;
final bool isSensitive;
+ final bool requireLongPress;
final Widget Function(BuildContext, bool) builder;
final Duration duration;
@@ -40,7 +42,8 @@ class _CopyWrapperState extends State<CopyWrapper> {
Widget build(BuildContext context) {
return GestureDetector(
behavior: HitTestBehavior.translucent,
- onTap: handleCopy,
+ onTap: widget.requireLongPress ? null : handleCopy,
+ onLongPress: !widget.requireLongPress ? null : handleCopy,
child: widget.builder(context, copied),
);
}
diff --git a/lib/src/screens/new_wallet/new_wallet_type_page.dart b/lib/src/screens/new_wallet/new_wallet_type_page.dart
index dee66e95..7bcf3edf 100644
--- a/lib/src/screens/new_wallet/new_wallet_type_page.dart
+++ b/lib/src/screens/new_wallet/new_wallet_type_page.dart
@@ -137,7 +137,7 @@ class WalletTypeFormState extends State<WalletTypeForm> {
),
Flexible(
child: Padding(
- padding: const EdgeInsets.symmetric(horizontal: 18),
+ padding: const EdgeInsets.only(left: 18, right: 18, bottom: 12),
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surfaceContainer,
@@ -172,10 +172,10 @@ class WalletTypeFormState extends State<WalletTypeForm> {
imageUrl: curr.iconPath,
),
const SizedBox(width: 12),
- Text(curr.fullName ?? curr.name),
+ Text(walletTypeToDisplayName(item)),
const SizedBox(width: 4),
Text(
- curr.title,
+ walletTypeToDisplayTicker(item),
style: TextStyle(
color: Theme.of(context).colorScheme.onSurfaceVariant,
),
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.