a11y: Wallets tab screen-reader fixes (edit labels, coin names, single rows, current wallet) (#3752)
What changed, and why it matters
This commit improves accessibility for screen-reader users. It adds spoken labels to buttons that were previously unlabeled, announces which cryptocurrency each wallet holds, removes a duplicate invisible tap target, and makes the currently selected wallet non-interactive so it is not accidentally reselected. There are no security changes.
No security action required. Treat as a normal accessibility improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff is purely an accessibility (a11y) refactor in Flutter/Dart. It wraps Text widgets in Semantics nodes, adds semanticLabel values, replaces a childless ExpansionTile with a ListTile for single-seed wallets, disables onTap for the current wallet, and localizes a hardcoded ‘Transaction Filter’ label. No cryptographic, authentication, authorization, input-validation, or network changes are present.
Changed components
lib/src/screens/new_wallet/new_wallet_type_page.dartlib/src/screens/new_wallet/wallet_group_display_page.dartlib/src/screens/new_wallet/widgets/grouped_wallet_expansion_tile.dartlib/src/screens/wallet_list/edit_wallet_button_widget.dartlib/src/screens/wallet_list/wallet_list_page.dartlib/src/screens/welcome/welcome_page.dartInspect captured patch +53 / −11
### lib/src/screens/new_wallet/new_wallet_type_page.dart
@@ -182,7 +182,10 @@ class WalletTypeFormState extends State<WalletTypeForm> {
imageUrl: getCryptoCurrencyIconForWalletListItem(item),
),
const SizedBox(width: 12),
- Text(walletTypeToDisplayName(item)),
+ Semantics(
+ button: true,
+ child: Text(walletTypeToDisplayName(item)),
+ ),
const SizedBox(width: 4),
Text(
walletTypeToDisplayTicker(item),
### lib/src/screens/new_wallet/wallet_group_display_page.dart
@@ -8,6 +8,7 @@ import 'package:cake_wallet/src/widgets/primary_button.dart';
import 'package:cake_wallet/themes/core/material_base_theme.dart';
import 'package:cake_wallet/view_model/wallet_groups_display_view_model.dart';
import 'package:cw_core/currency_for_wallet_type.dart';
+import 'package:cw_core/wallet_type.dart';
import 'package:flutter/material.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
@@ -92,6 +93,8 @@ class WalletGroupsDisplayBody extends StatelessWidget {
return GroupedWalletExpansionTile(
borderRadius: BorderRadius.all(Radius.circular(16)),
title: wallet.name,
+ titleSemanticsLabel:
+ '${wallet.name}, ${walletTypeToDisplayName(wallet.type)}',
isSelected:
walletGroupsDisplayViewModel.selectedSingleWallet == wallet,
leadingWidget: CakeImageWidget(
### lib/src/screens/new_wallet/widgets/grouped_wallet_expansion_tile.dart
@@ -1,12 +1,15 @@
+import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
import 'package:cw_core/currency_for_wallet_type.dart';
+import 'package:cw_core/wallet_type.dart';
import 'package:flutter/material.dart';
import 'package:cake_wallet/view_model/wallet_list/wallet_list_item.dart';
class GroupedWalletExpansionTile extends StatelessWidget {
GroupedWalletExpansionTile({
required this.title,
required this.isSelected,
+ this.titleSemanticsLabel,
this.childWallets = const [],
this.onTitleTapped,
this.onChildItemTapped = _defaultVoidCallback,
@@ -35,6 +38,7 @@ class GroupedWalletExpansionTile extends StatelessWidget {
final void Function(bool)? onExpansionChanged;
final String title;
+ final String? titleSemanticsLabel;
final Widget? leadingWidget;
final Widget? trailingWidget;
final Widget Function(WalletListItem)? childTrailingWidget;
@@ -65,6 +69,36 @@ class GroupedWalletExpansionTile extends StatelessWidget {
(isSelected
? Theme.of(context).colorScheme.onPrimary
: Theme.of(context).colorScheme.onSurfaceVariant);
+ final currentSuffix = ', ${S.of(context).current_wallet}';
+ if (childWallets.isEmpty) {
+ return Padding(
+ padding: const EdgeInsets.symmetric(vertical: 6),
+ child: Material(
+ color: backgroundColor,
+ shape: RoundedSuperellipseBorder(borderRadius: BorderRadius.circular(18)),
+ clipBehavior: Clip.antiAlias,
+ child: ListTile(
+ contentPadding:
+ EdgeInsets.symmetric(vertical: 1, horizontal: !isCurrentlySelectedWallet ? 16 : 0),
+ leading: leadingWidget,
+ title: Text(
+ title,
+ semanticsLabel: isCurrentlySelectedWallet
+ ? '${titleSemanticsLabel ?? title}$currentSuffix'
+ : titleSemanticsLabel,
+ style: Theme.of(context).textTheme.bodyMedium!.copyWith(
+ fontSize: 18,
+ fontWeight: FontWeight.w500,
+ color: effectiveTextColor,
+ ),
+ textAlign: TextAlign.left,
+ ),
+ trailing: trailingWidget ?? const SizedBox.shrink(),
+ onTap: onTitleTapped,
+ ),
+ ),
+ );
+ }
return Padding(
padding: EdgeInsets.symmetric(vertical: 6),
child: ExpansionTile(
@@ -81,14 +115,8 @@ class GroupedWalletExpansionTile extends StatelessWidget {
EdgeInsets.symmetric(vertical: 1, horizontal: !isCurrentlySelectedWallet ? 16 : 0),
iconColor: effectiveArrowColor,
collapsedIconColor: effectiveArrowColor,
- leading: (childWallets.isEmpty && onTitleTapped != null && leadingWidget != null)
- ? GestureDetector(
- behavior: HitTestBehavior.opaque,
- onTap: onTitleTapped,
- child: leadingWidget,
- )
- : leadingWidget,
- trailing: trailingWidget ?? (childWallets.isEmpty ? SizedBox.shrink() : null),
+ leading: leadingWidget,
+ trailing: trailingWidget,
title: GestureDetector(
onTap: onTitleTapped,
child: Text(
@@ -139,6 +167,8 @@ class GroupedWalletExpansionTile extends StatelessWidget {
),
title: Text(
item.name,
+ semanticsLabel: '${item.name}, ${walletTypeToDisplayName(item.type)}'
+ '${item.isCurrent && shouldShowCurrentWalletPointer ? currentSuffix : ''}',
maxLines: 2,
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
fontSize: 18,
### lib/src/screens/wallet_list/edit_wallet_button_widget.dart
@@ -1,3 +1,4 @@
+import 'package:cake_wallet/generated/i18n.dart';
import 'package:flutter/material.dart';
class EditWalletButtonWidget extends StatelessWidget {
@@ -28,6 +29,7 @@ class EditWalletButtonWidget extends StatelessWidget {
Icons.edit,
size: 14,
color: Theme.of(context).colorScheme.onSurfaceVariant,
+ semanticLabel: S.of(context).edit,
),
),
if (isGroup) ...{
### lib/src/screens/wallet_list/wallet_list_page.dart
@@ -94,7 +94,7 @@ class WalletListPage extends BasePage {
);
},
child: Semantics(
- label: 'Transaction Filter',
+ label: S.of(context).order_by,
button: true,
enabled: true,
child: Container(
@@ -107,6 +107,7 @@ class WalletListPage extends BasePage {
child: Image.asset(
'assets/images/filter_icon.png',
color: Theme.of(context).colorScheme.primary,
+ excludeFromSemantics: true,
),
),
),
@@ -308,10 +309,12 @@ class WalletListBodyState extends State<WalletListBody> {
),
),
title: wallet.name,
+ titleSemanticsLabel:
+ '${wallet.name}, ${walletTypeToDisplayName(wallet.type)}',
isSelected: false,
borderRadius: BorderRadius.all(Radius.circular(18)),
margin: EdgeInsets.only(left: 20, right: 20, bottom: 12),
- onTitleTapped: () => wallet.isCurrent ? null : _loadWallet(wallet),
+ onTitleTapped: wallet.isCurrent ? null : () => _loadWallet(wallet),
trailingWidget: wallet.isCurrent
? null
: EditWalletButtonWidget(
### lib/src/screens/welcome/welcome_page.dart
@@ -34,6 +34,7 @@ class WelcomePage extends BasePage {
icon: Icon(
Icons.info_outline,
size: 26,
+ semanticLabel: S.of(context).help,
),
onPressed: () async {
await launchUrl(_url, mode: LaunchMode.externalApplication);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.