AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 39 Monero

Fix screen-reader gaps that block accessibility-tree automation (#3693)

Public commit record

What the developer wrote

Authored by Seth For Privacy

100/100 · Strong
Fix screen-reader gaps that block accessibility-tree automation (#3693)

* Add TestId helper for accessibility identifiers

Semantics(identifier:) is what XCUITest (accessibilityIdentifier) and
UIAutomator (resource-id) drivers match on; Flutter keys are invisible to
them. TestId.merge folds a leaf control into one node carrying the id,
TestId.container gives a group its own node; both return the child
unchanged for a null id.

TestId.fromKey only accepts ValueKey<String> values matching
^[a-z0-9_]+_key$. Identifiers ship in release builds and identity keys
(AnimatedSwitcher, contact names, balances) can hold user data, so keys
are never published wholesale. The pattern still accepts an interpolated
lowercase seed word, so the no_string_interpolation_in_test_key lint is
the actual guard.

On iOS a node with no label/value/action is not an accessibility
element, so ids belong on the control node (merge), not on bare
containers.

* Plumb testId into shared widgets

Each shared widget takes an optional testId and otherwise falls back to
TestId.fromKey(key), so the ~125 existing *_key keys on Cake widgets
surface as identifiers without touching call sites. Existing keys stay
where they are for find.byKey robots.

Placement:
- Widgets that already build a Semantics/MergeSemantics node get
identifier: on that node (ModernButton, CoinActionButton,
LoadingPrimaryButton, FloatingIconButton, SeedCheckboxRow,
CurrencyPickerRow, AlertCloseButton, StandardSwitch, LineTabSwitcher,
main nav bar).
- Widgets built on framework buttons are wrapped in TestId.merge only
when an id resolves (NewPrimaryButton, PrimaryButton,
PrimaryImageButton, OptionTile, StandardListRow/SettingsCellWithArrow,
SettingsSwitcherCell, StackedButtons link button), so label, role,
toggled state and id share one node.
- BaseAlertDialog action buttons get a button role and ids from their
keys, defaulting to alert_dialog_left/right_button_key, or
alert_dialog_action_button_key for single-action alerts.
- ModalTopBar: title gets its own container header node
<base>_title_key, chrome buttons <base>_leading_key /
<base>_trailing_key, base defaulting to modal_top_bar. The hashCode
keys stay because the trailing AnimatedSwitcher relies on them.
- ListItem.testId is applied by NewListSections; rows with a trailing or
bottom widget use a container so their own buttons stay separately
focusable, all other rows merge.
- BaseTextFormField uses a container, not MergeSemantics: merging folded
suffix buttons (paste, scan) into the text-field node. Only applied
when the field has a hint/label.
- SettingsChoicesCell and LineTabSwitcher use index-based ids so
localized option text never becomes an identifier.

* Add test-key semantics lints

require_test_key_semantics_identifier warns when a ValueKey/Key "*_key"
literal is the key of a framework interactive widget (GestureDetector,
InkWell, Text/Icon/Elevated/Outlined/FilledButton, TextField,
TextFormField, Switch, Checkbox, Radio, ListTile, CupertinoButton) and no
TestId.merge/TestId.container or Semantics(identifier:) encloses it in
the same method. Such keys work for find.byKey but are invisible to
XCUITest/UIAutomator. Cake widgets are not flagged because they now
derive an identifier from their key. A quick fix wraps the widget in
TestId.merge with the same id and adds the import; it is single-location
(IDE) only, dart fix does not apply it.

no_string_interpolation_in_test_key warns when a String or dynamic value
is interpolated into a "*_key" ValueKey/Key. Test keys become release
build accessibility identifiers, and the plan's inventory found seed
words, recipient addresses, wallet names and tx/order ids interpolated
into keys. ints, enums and enum .name are allowed. integration_test/ is
skipped: robots only look keys up, they never ship them.

Tests drive analyzer_testing's AnalysisRuleTest from plain package:test
cases against the mock flutter package. They avoid test_reflective_loader
because its test_ method names would need a nested analysis_options.yaml,
and a nested options file that includes the root one stops the plugin
from reporting on multi-file runs.

* Apply text-field identifier regardless of hint

* Key list text fields by keyValue so the identifier fallback applies

* Never derive list row identifiers from keyValue

NewListSections builds each row's key from ListItem.keyValue, which is an arbitrary runtime string (routes, provider titles, wallet names, node URIs). A user-chosen wallet name such as savings_key passed the fallback regex and shipped as a release accessibility identifier via WalletRemovalPopup. List rows now publish only an explicit ListItem.testId; the five security page rows that relied on the fallback get explicit ids.

* Add semantics_ids codemod for test keys on framework widgets

dart run tool/semantics_ids/main.dart [--apply] [paths...] lists ValueKey/Key
'*_key' literals passed as key: to framework interactive widgets with no
enclosing TestId or Semantics(identifier:), mirroring the
require_test_key_semantics_identifier lint (same widget list and ancestor
walk). --apply wraps each hit in TestId.merge(<same id>, child: ...) and adds
the test_id.dart import.

It parses without resolution so it runs in seconds, matching both
InstanceCreationExpression and unresolved MethodInvocation call forms. It
imports package:analyzer, already a transitive dependency of the root package
via build_runner/mobx_codegen, so no pubspec change is needed (tool/ already
imports other transitive packages such as args/convert). Verified against the
lint: identical 21 hits across lib/.

* Apply semantics_ids codemod to new-ui, placed by hand

The codemod found two hits in lib/new-ui; both sit under an existing
Semantics node, so per the placement rules the identifier goes on that node
instead of a new TestId.merge wrapper:
- assets_top_bar: identifier on the existing MergeSemantics>Semantics(button).
- history_top_bar: the key is inside ExcludeSemantics, so the identifier goes
on the outer Semantics(button, label).
Also moves home_page_wallet_name_text_key onto WalletInfoBar's outer
Semantics(label) for the same ExcludeSemantics reason (Text is not a lint
target, so the codemod does not report it).

* Index home history row ids instead of interpolating the tx id

home_page_transaction_<tx id>_key would publish transaction ids as release
accessibility identifiers (no_string_interpolation_in_test_key). Use the list
index, and surface it as the identifier on the row's existing merged
Semantics via TestId.fromKey(child.key).

HomePageRobot.firstTransactionIdInAllView now maps the index back to the
transaction through dashboardViewModel.items, so transaction_details_test
keeps comparing tx ids.

* Give new-ui settings rows and top bar stable ids

Each SettingsListItem carries a static testId,
settings_page_<route constant in snake_case, minus a trailing Page>_row_key
(e.g. settings_page_privacy_row_key), passed to ListItemRegularRow.testId so
the PR1 wrapper puts it on the row's merged node. keyValue stays the route so
NewSettingsPageRobot and find.byKey keep working. The top bar gets the
settings_page_top_bar base name.

* Give every new-ui ModalTopBar a per-sheet testId base name

All ModalTopBar instances in lib/new-ui (except receive_amount_modal and
wallet_accounts_page, owned by the a11y gap-fix PR) get
testId: "<file stem>_top_bar", so the title/leading/trailing ids become
<sheet>_top_bar_title_key / _leading_key / _trailing_key instead of the shared
modal_top_bar_* fallback. Files with two top bars use the class name:
send_help_page_top_bar, picker_top_bar, picker_slider_page_top_bar.

* Surface send sheet ids on their accessibility nodes

- NewSendAddressInput: identifier from its *_key key on the field's existing
MergeSemantics>Semantics(label) node (send_page_address_input_key).
- NewSendAmountInput: the TextField is deliberately unlabeled (an authored
label made Android announce the amount twice), so it gets a label-less
TestId.merge with the key-derived id; a widget test confirms it stays its
own isTextField node (send_page_amount_input_key).
- ConfirmSwiper: key-derived id on both the swiper's single Semantics node and
the accessible-navigation NewPrimaryButton fallback
(send_page_confirm_swiper_key).
- Fee and coin-control rows in Advanced settings get
send_page_fee_row_key / send_page_coin_control_row_key.
send_page_send_button_key already resolves through NewFuturePrimaryButton.

* Surface swap sheet ids on their accessibility nodes

SwapAmountBox's amount TextField and currency-picker GestureDetector are keyed
with a ternary ValueKey (receive vs deposit), which neither the lint nor the
codemod sees, so they are wrapped in TestId.merge with the same existing key
names: swap_page_{deposit,receive}_amount_field_key and
swap_amount_box_{deposit,receive}_currency_button_key.
The provider preview row gets swap_page_provider_row_key and the unlabeled
direction toggle gets swap_page_reverse_button_key. The swap button already
resolves via LoadingPrimaryButton's exchange_page_exchange_button_key.

* Give receive sheet controls stable ids

- Bottom buttons: receive_page_{copy,set_amount,label,addresses}_button_key via
ModernButton.testId.
- QR (receive_page_qr_code_key), address-type row
(receive_page_address_type_button_key) and label chip
(receive_page_label_chip_key): identifier on their existing
MergeSemantics>Semantics nodes.
- Address text: TestId.merge with its existing receive_page_address_key so the
segmented address is one labelled node.
- Top-bar trailing button: receive_page_share_button_key in large-QR mode,
receive_page_rotate_button_key otherwise.
- Address-type picker rows: index-based
receive_address_type_{common,other}_<index>_key on the row Semantics via
TestId.fromKey(key).
receive_amount_modal.dart is left to the a11y gap-fix PR.

* Index the new-ui wallet picker rows

SwapAddressSelectionModal is the new UI's wallet switcher (swap from/to wallet
picker). Each wallet row gets swap_wallet_picker_wallet_<index>_key, surfaced
on the row's tap target through TestId.merge(TestId.fromKey(widget.key)).
The index is used rather than the wallet name so no user data reaches the
identifier.

* Test new-ui identifiers on settings, send and receive

newui_identifiers_test pumps SettingsMainPage with a mocked dashboard and
checks five settings_page_*_row_key rows plus the settings_page_top_bar ids,
the send amount field staying its own text-field node with its id, the
confirm swiper id, and the four receive bottom-button ids.

platformNodesWithId now reads the identifier from getSemanticsData(), which
is what the platform receives: a merged parent (e.g. CopyWrapper's
MergeSemantics around the copy ModernButton) carries its descendant's
identifier there while its own config field stays empty.

* Use double-quoted test_id imports per prefer_double_quotes

* Apply semantics_ids codemod to lib/src and cake_pay, placed by hand

Wraps keyed framework controls in TestId.merge so their existing test keys
surface as accessibility identifiers. Where a Semantics node already labels
the control, the identifier goes on that node instead of a new wrapper
(contact_list_page add button, header_row transaction filter). The
new_wallet_page generate-name button swaps its label-only Semantics for
TestId.merge with the same label, so label, button role, tap and id are one
node instead of a label node over an unlabelled button.

new_wallet_type_${item.name} keeps its id: item is a WalletType, so .name is
an enum name and not user data.

* Index picker item ids instead of interpolating item names

Picker is generic and built ids from item.toString() (or Currency.name),
which the interpolation lint cannot prove is free of user data. Ids now use
the item's position in the picker's unfiltered items list, so they stay
stable while the search filter is applied, and the button ids surface via
TestId.merge.

Robots resolve the index from the open Picker's items through a new
BaseRobot.pickerIndexWhere helper.

* Index seed verification option ids instead of the seed word

seed_verification_option_<word>_button_key would publish seed words as
release-build accessibility identifiers. Use the option's index, surfaced
with TestId.merge. The robot finds the correct word's index in the view
model's currentOptions.

* Index wallet list row and edit ids instead of the wallet name

Wallets tab ids no longer carry wallet names:
- wallet_list_single_wallet_<i>_key on a single wallet's tappable title
- wallet_list_group_<i>_key on a group header
- wallet_list_group_<i>_wallet_<j>_key on a wallet row inside a group
- wallet_list_single_wallet_<i>_edit_button_key and
wallet_list_group_<i>_wallet_<j>_edit_button_key on edit buttons

GroupedWalletExpansionTile derives the title and child-row ids from its
tileKey via TestId.fromKey, so tiles without a test key are unchanged.
EditWalletButtonWidget surfaces its key on the edit button with
TestId.merge.

WalletListPageRobot.openEditFor looks the wallet up in the page's
singleWalletsList, and WalletFlows expands groups by the new group key.

* Keep tx, trade, order and address data out of data-model test keys

Transaction, trade, order, payjoin and anonpay list items were keyed with
their ids. These ActionListItem keys are never read (renaming the field
breaks nothing), but they are test keys, so they now use the item's
position in the list being built.

The saved recipient-address row reuses the static
standard_list_item_transaction_details_recipient_address_key; it is only
added when the definition-driven row with that key was not shown.

WalletKeysViewModel's _walletName was the wallet type name, not the wallet
name. Interpolate _wallet.type.name directly so the lint can see it is an
enum name; ids are unchanged.

* Use enum names for internal test key prefixes

ExchangeCard's cardInstanceName and DEuroSavingsPage's tooltip key were
app-internal constants passed as Strings, which the interpolation lint
cannot distinguish from user data. Type them as enums and interpolate
.name. The deuro ids are unchanged. ExchangeCard has had no callers since
the old exchange page was removed, so its ids have no consumers. Its two
address buttons get identifiers on their existing labelled Semantics.

* Pass alert dialog keys to the dialog widget

AlertWithOneAction accepted a key and dropped it, and BaseAlertDialog put
its own (always null) key on the barrier GestureDetector. BaseAlertDialog
now forwards super.key, AlertWithOneAction passes its key through,
AlertWithTwoActions passes alertDialogKey, and the GestureDetector no
longer repeats it, so find.byKey on a dialog key matches exactly one
widget.

* Test legacy wallet list, seed verification and alert identifiers

* Publish transaction detail row identifiers from their model keys

Removing the keyValue fallback in #3690 left TransactionDetailsModal rows without identifiers. The rows now pass the view model's static key through testId; every key in that model is a constant and the interpolation lint keeps it that way.

* Give the Set amount sheet stable semantics identifiers

The amount field gets its identifier on the existing Semantics inside the
MergeSemantics that already keeps it a distinct text-field node, so no new
node is added. The sheet's ModalTopBar gets the explicit receive_amount_modal
base id (title, leading close button) and the continue button gets its own
id, so uiautomator/XCUITest can address the sheet without relying on text.

* Use the colon-free amount string for semantics labels

S.amount is the visible caption "Amount: " and carries its own colon (and
trailing space) in every locale, so using it as the Set amount field's
semantics label produced "Amount: " on the node and "Amount:: 2500" in
tools that join label and value. The field now uses S.receive_amount
("Amount"); the visible caption is unchanged and no .arb file is touched.

The send and swap amount error live regions concatenated the same caption
with the error text. They now join S.receive_amount and the error with a
newline, the separator Flutter itself uses when merging labels, which
screen readers read as a pause in every locale.

* Announce PIN entry progress and identify the PIN pad keys

The PIN dots had no semantics, so screen-reader users got no feedback after
pressing a digit. The dots row is now one container live region labelled
"n of m digits entered" (new pin_digits_entered string) with the
pin_code_progress_key identifier. Only the count is exposed, never the
digits.

Digit buttons keep their existing ValueKey and gain the same string as their
identifier through TestId.merge, so the id lands on the TextButton's own
button node. The delete button's existing Semantics gets
pin_code_delete_button_key.

pin_digits_entered is added in English to every strings_*.arb next to
pin_at_top, for the translation workflow to fill in later.

* Make balance and account cards containers with index-based ids

The home balance card and the wallet accounts card both put a button
Semantics around a BalanceCard without container/explicitChildNodes, so every
balance Text folded into the card's label ("Savings\n0\nBTC\nUSD 0.00")
and there was nothing stable to target.

Both existing Semantics now set container and explicitChildNodes, keeping the
balances as their own child nodes under the card, and carry an index-based
identifier: home_page_balance_card_<realIndex>_key and
wallet_accounts_page_account_<index>_key. The user-editable account label is
never used in the id.

* Expose selection state and ids on segmented controls

Chart range options had no semantics beyond their text: no button role, no
selected state. Each option is now a merged button node with selected and
inMutuallyExclusiveGroup, identified as chart_range_<index>_key. ChartRange
is a class of static constants rather than an enum, so the index into
ChartRange.ranges is used instead of the display text, which may be
localised later.

SettingsChoicesCell options get the same button/selected/
inMutuallyExclusiveGroup semantics inside the existing TestId.merge, so
selection is announced with or without a testId.

The Lightning switch and the receive address type rows already had correct
roles and states; they only gain identifiers on their existing Semantics:
home_page_lightning_switch_key and receive_address_type_<index>_key, where
the index is into ReceiveOptionViewModel.options (stable per wallet type,
independent of the common/other grouping and sort).

* Identify the crypto and fiat balance lines on balance cards

With the card Semantics now using explicitChildNodes, each balance Text was
its own loose node ("0", "BTC", "USD 0.00"). The main balance line and
the secondary line are now each one container node, so the amount and its
asset are read together and can be targeted as
balance_card_crypto_balance_key and balance_card_fiat_balance_key. The ids
follow fiatFirst, which swaps which line shows the fiat amount.

The crypto line's container sits inside the existing
ExcludeSemantics(excluding: !selected), so unselected stacked cards still do
not announce, or expose an id for, a balance that is faded out.

* Label theme choices by title instead of toString()

MaterialThemeBase does not override toString(), so each theme preview was
announced as "Instance of 'LightTheme'". It now uses theme.title.

The option also gets display_settings_theme_<family>_key, where family is
themeFamily ("blacktheme") or else the theme type ("light"/"dark"). title
and raw are not used for the id because both change with the Black theme's
accent colour.

theme.title is still an English literal in each theme class; localising it
is left for a follow-up.

* Cover alert action buttons in the gap-fix tests

PR1 already wraps BaseAlertDialog's action GestureDetectors in
TestId.merge(Semantics(button: true)). This asserts that AlertWithOneAction
and AlertWithTwoActions each expose their actions as button nodes with tap
actions and the default alert_dialog_* ids.

AlertWithOneAction still drops its own key (BaseAlertDialog has no
constructor that accepts one, and its build() reuses key on the inner
GestureDetector), so passing it through is not a one-line change and is left
for a follow-up.

Also replaces the deprecated pipelineOwner tree walk in the PIN test with
find.semantics.byPredicate.

* Keep send and swap amount error labels unchanged

* Publish balance line identifiers only on the selected card

Every BalanceCard put the same global id on its lower balance line, so a home screen with several accounts exposed duplicate balance_card_fiat_balance_key (or crypto when fiatFirst) nodes. Unselected cards keep the label but no identifier.

* Stop announcing the account name twice on balance cards

The home and wallet-account card wrappers already label the card with the account name. With explicitChildNodes the BalanceCard header text became a second stop reading the same name, so it is excluded when it is the account name.

* Namespace transaction row ids by history view

The home preview indexes itemsShort (no date headers) and the All modal indexes items, so the same home_page_transaction_<i>_key meant different transactions in each. Preview rows keep home_page_transaction_<i>_key; modal rows become history_modal_transaction_<i>_key, and the robot reads the modal prefix.

* Keep transaction history keys unique across incremental updates; edit grouped wallets in the robot

History keys came from a local counter reset to 0 on every update, so appended items reused keys held by existing rows. The keys are never read, but they should still be unique: all six sites now share one view-model counter. WalletListPageRobot.openEditFor also resolves wallets inside groups, expanding the group first when its edit button is not built.

* Suffix the Lightning preimage row key with _key

It was the only transaction-detail key without the suffix, so TestId.fromKey rejected it and the row published no identifier.

* Hide the account index with the duplicated account name

With the name excluded, the index beside it became a bare "1." stop. It is now excluded under the same condition.

* Label the wallet edit button and expose the coin control checkbox state

The wallet rename control was an unlabelled icon button and the coin control
checkbox a bare GestureDetector, so neither TalkBack nor the e2e agent could
find or operate them (shadow QA could not rename wallets or deselect UTXOs).

* Stub a card order in the CardsView a11y tests

CardsView now builds its stack from cardOrder and picks designs through
cardAccountIndices, so an empty order rendered no cards.

* Wait for the wrong-PIN bar to clear before entering the right PIN

The failed-auth Flushbar has a 1s timer. If the correct PIN closes the
auth route while it is still up, the timer's pop trips a navigator
assertion. The extra PIN-pad semantics on this branch slow the Android
accessibility bridge enough to hit that window in show_keys_auth_test.

* Use TestId.container in the test-key quick fix for text fields

MergeSemantics would fold a field's suffix controls (paste, scan) into the
field node, so they stop being separately focusable. Text fields get
TestId.container instead, as BaseTextFormField already does.

* Drop the unused key on list text-field rows

It was added so a keyValue identifier fallback would apply; that fallback was
removed and the widget never reads its key.

* Address review: codemod guards, container on amount fields, ids on five top bars

- The codemod wraps TextField/TextFormField in TestId.container, like the lint
quick fix, and no longer picks up interpolated keys: one hit at this head
would have copied a seed word into an identifier.
- The send and swap amount fields use TestId.container.
- Five ModalTopBars that arrived through base merges get their own testId.

* Address review: unique saved-recipient key, delete dead ExchangeCard, CI check for test keys

- The saved-recipient fallback row no longer shares its key with the
recipient-address row.
- ExchangeCard is built by no screen, so it is deleted instead of retyped.
- A workflow fails when a test key under lib/ interpolates anything other
than a list index or an enum name. Until now only an IDE lint kept seed
words, addresses and wallet names out of release identifiers.

* Address review: translate the PIN progress announcement, one stop per checkbox row

- pin_digits_entered is translated in the 30 non-English locales. Each keeps
${entered} before ${total}: the generator takes a locale's parameters in
the order its own string uses them.
- A ListItemCheckbox row without a testId, and a coin control row, were two
screen-reader stops: the label, then an unnamed checked box. Each is now
one node carrying the name and the checked state. Tests cover a row with
and without a testId and the coin control row.

* Announce a labelled SVG once when it falls back to the raw asset

The fallback picture is built inside the first one's semantics node, so it
repeated the label as a second image node.

* Test-key check: allow a list position from indexOf

chart_range_${ChartRange.ranges.indexOf(item)}_key on the next branch in the
stack interpolates an int index and tripped the check.

* Keep the account name on a BalanceCard that nothing labels

The card dropped its account name and index from the tree so the home and
wallet-accounts wrappers would not repeat them. The card customizer shows the
card without such a wrapper, so the exclusion is now opt-in for those two.

* Add semantics identifiers to new-UI release-checklist screens and a semantics_ids codemod (#3694)

* Add semantics_ids codemod for test keys on framework widgets

dart run tool/semantics_ids/main.dart [--apply] [paths...] lists ValueKey/Key
'*_key' literals passed as key: to framework interactive widgets with no
enclosing TestId or Semantics(identifier:), mirroring the
require_test_key_semantics_identifier lint (same widget list and ancestor
walk). --apply wraps each hit in TestId.merge(<same id>, child: ...) and adds
the test_id.dart import.

It parses without resolution so it runs in seconds, matching both
InstanceCreationExpression and unresolved MethodInvocation call forms. It
imports package:analyzer, already a transitive dependency of the root package
via build_runner/mobx_codegen, so no pubspec change is needed (tool/ already
imports other transitive packages such as args/convert). Verified against the
lint: identical 21 hits across lib/.

* Apply semantics_ids codemod to new-ui, placed by hand

The codemod found two hits in lib/new-ui; both sit under an existing
Semantics node, so per the placement rules the identifier goes on that node
instead of a new TestId.merge wrapper:
- assets_top_bar: identifier on the existing MergeSemantics>Semantics(button).
- history_top_bar: the key is inside ExcludeSemantics, so the identifier goes
on the outer Semantics(button, label).
Also moves home_page_wallet_name_text_key onto WalletInfoBar's outer
Semantics(label) for the same ExcludeSemantics reason (Text is not a lint
target, so the codemod does not report it).

* Index home history row ids instead of interpolating the tx id

home_page_transaction_<tx id>_key would publish transaction ids as release
accessibility identifiers (no_string_interpolation_in_test_key). Use the list
index, and surface it as the identifier on the row's existing merged
Semantics via TestId.fromKey(child.key).

HomePageRobot.firstTransactionIdInAllView now maps the index back to the
transaction through dashboardViewModel.items, so transaction_details_test
keeps comparing tx ids.

* Give new-ui settings rows and top bar stable ids

Each SettingsListItem carries a static testId,
settings_page_<route constant in snake_case, minus a trailing Page>_row_key
(e.g. settings_page_privacy_row_key), passed to ListItemRegularRow.testId so
the PR1 wrapper puts it on the row's merged node. keyValue stays the route so
NewSettingsPageRobot and find.byKey keep working. The top bar gets the
settings_page_top_bar base name.

* Give every new-ui ModalTopBar a per-sheet testId base name

All ModalTopBar instances in lib/new-ui (except receive_amount_modal and
wallet_accounts_page, owned by the a11y gap-fix PR) get
testId: "<file stem>_top_bar", so the title/leading/trailing ids become
<sheet>_top_bar_title_key / _leading_key / _trailing_key instead of the shared
modal_top_bar_* fallback. Files with two top bars use the class name:
send_help_page_top_bar, picker_top_bar, picker_slider_page_top_bar.

* Surface send sheet ids on their accessibility nodes

- NewSendAddressInput: identifier from its *_key key on the field's existing
MergeSemantics>Semantics(label) node (send_page_address_input_key).
- NewSendAmountInput: the TextField is deliberately unlabeled (an authored
label made Android announce the amount twice), so it gets a label-less
TestId.merge with the key-derived id; a widget test confirms it stays its
own isTextField node (send_page_amount_input_key).
- ConfirmSwiper: key-derived id on both the swiper's single Semantics node and
the accessible-navigation NewPrimaryButton fallback
(send_page_confirm_swiper_key).
- Fee and coin-control rows in Advanced settings get
send_page_fee_row_key / send_page_coin_control_row_key.
send_page_send_button_key already resolves through NewFuturePrimaryButton.

* Surface swap sheet ids on their accessibility nodes

SwapAmountBox's amount TextField and currency-picker GestureDetector are keyed
with a ternary ValueKey (receive vs deposit), which neither the lint nor the
codemod sees, so they are wrapped in TestId.merge with the same existing key
names: swap_page_{deposit,receive}_amount_field_key and
swap_amount_box_{deposit,receive}_currency_button_key.
The provider preview row gets swap_page_provider_row_key and the unlabeled
direction toggle gets swap_page_reverse_button_key. The swap button already
resolves via LoadingPrimaryButton's exchange_page_exchange_button_key.

* Give receive sheet controls stable ids

- Bottom buttons: receive_page_{copy,set_amount,label,addresses}_button_key via
ModernButton.testId.
- QR (receive_page_qr_code_key), address-type row
(receive_page_address_type_button_key) and label chip
(receive_page_label_chip_key): identifier on their existing
MergeSemantics>Semantics nodes.
- Address text: TestId.merge with its existing receive_page_address_key so the
segmented address is one labelled node.
- Top-bar trailing button: receive_page_share_button_key in large-QR mode,
receive_page_rotate_button_key otherwise.
- Address-type picker rows: index-based
receive_address_type_{common,other}_<index>_key on the row Semantics via
TestId.fromKey(key).
receive_amount_modal.dart is left to the a11y gap-fix PR.

* Index the new-ui wallet picker rows

SwapAddressSelectionModal is the new UI's wallet switcher (swap from/to wallet
picker). Each wallet row gets swap_wallet_picker_wallet_<index>_key, surfaced
on the row's tap target through TestId.merge(TestId.fromKey(widget.key)).
The index is used rather than the wallet name so no user data reaches the
identifier.

* Test new-ui identifiers on settings, send and receive

newui_identifiers_test pumps SettingsMainPage with a mocked dashboard and
checks five settings_page_*_row_key rows plus the settings_page_top_bar ids,
the send amount field staying its own text-field node with its id, the
confirm swiper id, and the four receive bottom-button ids.

platformNodesWithId now reads the identifier from getSemanticsData(), which
is what the platform receives: a merged parent (e.g. CopyWrapper's
MergeSemantics around the copy ModernButton) carries its descendant's
identifier there while its own config field stays empty.

* Use double-quoted test_id imports per prefer_double_quotes

* Namespace transaction row ids by history view

The home preview indexes itemsShort (no date headers) and the All modal indexes items, so the same home_page_transaction_<i>_key meant different transactions in each. Preview rows keep home_page_transaction_<i>_key; modal rows become history_modal_transaction_<i>_key, and the robot reads the modal prefix.

* Address review: codemod guards, container on amount fields, ids on five top bars

- The codemod wraps TextField/TextFormField in TestId.container, like the lint
quick fix, and no longer picks up interpolated keys: one hit at this head
would have copied a seed word into an identifier.
- The send and swap amount fields use TestId.container.
- Five ModalTopBars that arrived through base merges get their own testId.

* Semantics identifier tests: #3469 widget tests, expectTestId, tier0 identifiers suite (#3696)

* Add semantics widget tests for the new a11y primitives

CW-1574. Screen-reader tests for the accessibility primitives introduced
by the six a11y branches, cherry-picked from #3469:

- ModernButton: single button node, semanticLabel over the visible caption,
decorative icon, semantic tap.
- ModalTopBar: leading button defaults to the localized "Close", custom
leading/trailing labels, title as a header, no phantom trailing node.
- ConfirmSwiper: button variant under accessibleNavigation (with swiperText
fallback) is tappable; the swiper variant is one unnamed-action node that
still confirms on a horizontal drag.
- FloatingIconButton, CakeImageWidget, RoundedCheckbox, PrimaryButton /
LoadingPrimaryButton, AddressFormatter.

AddressFormatter is the security-critical one: both the full and truncated
renderings must announce the entire address, never the chunked or
ellipsised visual form.

One test is skipped and documents a real defect rather than asserting it:
RoundedCheckbox(value: false) renders Offstage(), whose zero-rect node
Flutter drops, so an unselected option announces nothing.

* Update semantics tests for the review round, add CopyWrapper coverage

Follows the five review fix commits merged into this branch.

ModalTopBar: the implicit "Close" default is gone, so the test that pinned
it is replaced by tests that the new constructor asserts fire -- a
leadingIcon without a non-empty leadingSemanticLabel, and the trailing
equivalent -- plus the cases that must still be accepted (no icons at all,
a leadingWidget that carries its own semantics). The explicit-label,
header and tap tests carry over with labels now supplied.

ModernButton: new tests for the constructor assert on both constructors --
icon-only with no name is rejected, an empty visible label does not count,
and either a visible label or a semanticLabel satisfies it.

PrimaryButton: its Semantics wrapper is gone, so the tests now pin the
TextButton-provided behaviour that replaced it. The reviewer's claim holds
for the ordinary cases (label and disabled state survive), with one
exception worth flagging: isDisabled + onDisabledPressed now reports
ENABLED, because there is no longer an `enabled:` annotation independent of
the TextButton callback. Asserted as-is rather than worked around.
LoadingPrimaryButton keeps its wrapper and its tests unchanged.

CopyWrapper (new file): builder mode exposes one merged node with the copy
custom action and no duplicate stop; nothing-to-copy returns the child with
no phantom actionable node or hint; copying flips the label and marks the
node a live region, matching the move off SemanticsService.announce;
requireLongPress swaps the hint, drops `button`, and only responds to a
long press; controlBuilder mode stacks no extra gesture or action on the
caller's control and hands it a null onCopy when there is nothing to copy.

* Rebase the #3469 semantics tests onto the current widgets

Drop the ModernButton and ModalTopBar constructor-assert groups: #3483
replaced those asserts with the modern_button_semantics and
modal_top_bar_semantics lints, so the constructors now accept an
unnamed icon and the rule is enforced at analysis time instead.

Move the duplicated simulatedAccessibilityTraversal helper into
semantics_helpers.dart as screenReaderStops, migrate the deprecated
containsSemantics matcher to isSemantics, replace the deprecated
binding.pipelineOwner lookup, and strip the comments.

The skipped RoundedCheckbox test still documents a real defect:
value: false renders Offstage(), a zero-rect subtree Flutter drops from
the semantics tree, so the checked: false state never reaches a screen
reader. Giving the unchecked indicator the checked one's 20x20 footprint
fixes it but shifts layout in the two pickers that use it.

Add a ModalTopBar test that a sheet has exactly one header node, that it
carries <testId>_title_key with the title alone (bottomText stays out),
and that the leading and trailing buttons carry their own ids.

* Add expectTestId and a tier0 semantics identifiers suite

BaseRobot.expectTestId waits for find.bySemanticsIdentifier with
pumpUntilFound, takes the same timeout screenshot, and also screenshots
before failing on a duplicate id. It holds its own ensureSemantics
handle so it works even if a suite turns semanticsEnabled off; on a
physical iOS device that handle is what makes Flutter build the tree.
tapTestId taps by identifier for controls that carry a testId but no
ValueKey, such as the receive sheet buttons, keeping find calls in the
robot layer.

semantics_identifiers_test creates a Solana wallet and asserts the
navbar, home action, settings, receive, set amount and send identifiers
added by the TestId plumbing and the new-ui id pass, each after
waiting for its screen. The set amount sheet has no testId yet, so it is
checked through the ModalTopBar fallback modal_top_bar_title_key; once
#3693 gives it testId "receive_amount_modal" that becomes
receive_amount_modal_title_key and modal_top_bar_leading_key becomes
receive_amount_modal_leading_key. No alert is reachable without a
funded, synced wallet, so alert_dialog_action_button_key stays covered
by the widget tests only.

The runner discovers suites by glob; the suite is added to the tier0
table in docs/INTEGRATION_TESTS.md.

* Count exported semantics nodes in expectTestId

find.bySemanticsIdentifier also matches render objects whose node was merged into a parent, so an identifier that never reaches the accessibility client still passed. The assertion now walks the semantics tree and requires exactly one node that is not merged into its parent.

* Walk the Set amount sheet by identifier in the tier0 suite

* Hold a semantics handle in tapTestId and enterTextByTestId

find.bySemanticsIdentifier only sees nodes while semantics is enabled, and expectTestId releases its handle on return, so the tap and text helpers now hold their own instead of relying on something else keeping semantics on.

* Address review: pin the swiper's scroll actions, cover SVG assets, drop the skipped test

- The ConfirmSwiper test now fails if the bare GestureDetector's scroll
actions come back; it passed with the old broken shape before.
- CakeImageWidget is tested with an .svg asset, the path 123 of 125 callers use.
- The skipped RoundedCheckbox test pinned nothing and is removed.

* Put list text-field test ids on the field, not the merged row

* Surface legacy screen test keys as accessibility identifiers and drop user data from ids (#3695)

* Add semantics_ids codemod for test keys on framework widgets

dart run tool/semantics_ids/main.dart [--apply] [paths...] lists ValueKey/Key
'*_key' literals passed as key: to framework interactive widgets with no
enclosing TestId or Semantics(identifier:), mirroring the
require_test_key_semantics_identifier lint (same widget list and ancestor
walk). --apply wraps each hit in TestId.merge(<same id>, child: ...) and adds
the test_id.dart import.

It parses without resolution so it runs in seconds, matching both
InstanceCreationExpression and unresolved MethodInvocation call forms. It
imports package:analyzer, already a transitive dependency of the root package
via build_runner/mobx_codegen, so no pubspec change is needed (tool/ already
imports other transitive packages such as args/convert). Verified against the
lint: identical 21 hits across lib/.

* Apply semantics_ids codemod to new-ui, placed by hand

The codemod found two hits in lib/new-ui; both sit under an existing
Semantics node, so per the placement rules the identifier goes on that node
instead of a new TestId.merge wrapper:
- assets_top_bar: identifier on the existing MergeSemantics>Semantics(button).
- history_top_bar: the key is inside ExcludeSemantics, so the identifier goes
on the outer Semantics(button, label).
Also moves home_page_wallet_name_text_key onto WalletInfoBar's outer
Semantics(label) for the same ExcludeSemantics reason (Text is not a lint
target, so the codemod does not report it).

* Index home history row ids instead of interpolating the tx id

home_page_transaction_<tx id>_key would publish transaction ids as release
accessibility identifiers (no_string_interpolation_in_test_key). Use the list
index, and surface it as the identifier on the row's existing merged
Semantics via TestId.fromKey(child.key).

HomePageRobot.firstTransactionIdInAllView now maps the index back to the
transaction through dashboardViewModel.items, so transaction_details_test
keeps comparing tx ids.

* Give new-ui settings rows and top bar stable ids

Each SettingsListItem carries a static testId,
settings_page_<route constant in snake_case, minus a trailing Page>_row_key
(e.g. settings_page_privacy_row_key), passed to ListItemRegularRow.testId so
the PR1 wrapper puts it on the row's merged node. keyValue stays the route so
NewSettingsPageRobot and find.byKey keep working. The top bar gets the
settings_page_top_bar base name.

* Give every new-ui ModalTopBar a per-sheet testId base name

All ModalTopBar instances in lib/new-ui (except receive_amount_modal and
wallet_accounts_page, owned by the a11y gap-fix PR) get
testId: "<file stem>_top_bar", so the title/leading/trailing ids become
<sheet>_top_bar_title_key / _leading_key / _trailing_key instead of the shared
modal_top_bar_* fallback. Files with two top bars use the class name:
send_help_page_top_bar, picker_top_bar, picker_slider_page_top_bar.

* Surface send sheet ids on their accessibility nodes

- NewSendAddressInput: identifier from its *_key key on the field's existing
MergeSemantics>Semantics(label) node (send_page_address_input_key).
- NewSendAmountInput: the TextField is deliberately unlabeled (an authored
label made Android announce the amount twice), so it gets a label-less
TestId.merge with the key-derived id; a widget test confirms it stays its
own isTextField node (send_page_amount_input_key).
- ConfirmSwiper: key-derived id on both the swiper's single Semantics node and
the accessible-navigation NewPrimaryButton fallback
(send_page_confirm_swiper_key).
- Fee and coin-control rows in Advanced settings get
send_page_fee_row_key / send_page_coin_control_row_key.
send_page_send_button_key already resolves through NewFuturePrimaryButton.

* Surface swap sheet ids on their accessibility nodes

SwapAmountBox's amount TextField and currency-picker GestureDetector are keyed
with a ternary ValueKey (receive vs deposit), which neither the lint nor the
codemod sees, so they are wrapped in TestId.merge with the same existing key
names: swap_page_{deposit,receive}_amount_field_key and
swap_amount_box_{deposit,receive}_currency_button_key.
The provider preview row gets swap_page_provider_row_key and the unlabeled
direction toggle gets swap_page_reverse_button_key. The swap button already
resolves via LoadingPrimaryButton's exchange_page_exchange_button_key.

* Give receive sheet controls stable ids

- Bottom buttons: receive_page_{copy,set_amount,label,addresses}_button_key via
ModernButton.testId.
- QR (receive_page_qr_code_key), address-type row
(receive_page_address_type_button_key) and label chip
(receive_page_label_chip_key): identifier on their existing
MergeSemantics>Semantics nodes.
- Address text: TestId.merge with its existing receive_page_address_key so the
segmented address is one labelled node.
- Top-bar trailing button: receive_page_share_button_key in large-QR mode,
receive_page_rotate_button_key otherwise.
- Address-type picker rows: index-based
receive_address_type_{common,other}_<index>_key on the row Semantics via
TestId.fromKey(key).
receive_amount_modal.dart is left to the a11y gap-fix PR.

* Index the new-ui wallet picker rows

SwapAddressSelectionModal is the new UI's wallet switcher (swap from/to wallet
picker). Each wallet row gets swap_wallet_picker_wallet_<index>_key, surfaced
on the row's tap target through TestId.merge(TestId.fromKey(widget.key)).
The index is used rather than the wallet name so no user data reaches the
identifier.

* Test new-ui identifiers on settings, send and receive

newui_identifiers_test pumps SettingsMainPage with a mocked dashboard and
checks five settings_page_*_row_key rows plus the settings_page_top_bar ids,
the send amount field staying its own text-field node with its id, the
confirm swiper id, and the four receive bottom-button ids.

platformNodesWithId now reads the identifier from getSemanticsData(), which
is what the platform receives: a merged parent (e.g. CopyWrapper's
MergeSemantics around the copy ModernButton) carries its descendant's
identifier there while its own config field stays empty.

* Use double-quoted test_id imports per prefer_double_quotes

* Apply semantics_ids codemod to lib/src and cake_pay, placed by hand

Wraps keyed framework controls in TestId.merge so their existing test keys
surface as accessibility identifiers. Where a Semantics node already labels
the control, the identifier goes on that node instead of a new wrapper
(contact_list_page add button, header_row transaction filter). The
new_wallet_page generate-name button swaps its label-only Semantics for
TestId.merge with the same label, so label, button role, tap and id are one
node instead of a label node over an unlabelled button.

new_wallet_type_${item.name} keeps its id: item is a WalletType, so .name is
an enum name and not user data.

* Index picker item ids instead of interpolating item names

Picker is generic and built ids from item.toString() (or Currency.name),
which the interpolation lint cannot prove is free of user data. Ids now use
the item's position in the picker's unfiltered items list, so they stay
stable while the search filter is applied, and the button ids surface via
TestId.merge.

Robots resolve the index from the open Picker's items through a new
BaseRobot.pickerIndexWhere helper.

* Index seed verification option ids instead of the seed word

seed_verification_option_<word>_button_key would publish seed words as
release-build accessibility identifiers. Use the option's index, surfaced
with TestId.merge. The robot finds the correct word's index in the view
model's currentOptions.

* Index wallet list row and edit ids instead of the wallet name

Wallets tab ids no longer carry wallet names:
- wallet_list_single_wallet_<i>_key on a single wallet's tappable title
- wallet_list_group_<i>_key on a group header
- wallet_list_group_<i>_wallet_<j>_key on a wallet row inside a group
- wallet_list_single_wallet_<i>_edit_button_key and
wallet_list_group_<i>_wallet_<j>_edit_button_key on edit buttons

GroupedWalletExpansionTile derives the title and child-row ids from its
tileKey via TestId.fromKey, so tiles without a test key are unchanged.
EditWalletButtonWidget surfaces its key on the edit button with
TestId.merge.

WalletListPageRobot.openEditFor looks the wallet up in the page's
singleWalletsList, and WalletFlows expands groups by the new group key.

* Keep tx, trade, order and address data out of data-model test keys

Transaction, trade, order, payjoin and anonpay list items were keyed with
their ids. These ActionListItem keys are never read (renaming the field
breaks nothing), but they are test keys, so they now use the item's
position in the list being built.

The saved recipient-address row reuses the static
standard_list_item_transaction_details_recipient_address_key; it is only
added when the definition-driven row with that key was not shown.

WalletKeysViewModel's _walletName was the wallet type name, not the wallet
name. Interpolate _wallet.type.name directly so the lint can see it is an
enum name; ids are unchanged.

* Use enum names for internal test key prefixes

ExchangeCard's cardInstanceName and DEuroSavingsPage's tooltip key were
app-internal constants passed as Strings, which the interpolation lint
cannot distinguish from user data. Type them as enums and interpolate
.name. The deuro ids are unchanged. ExchangeCard has had no callers since
the old exchange page was removed, so its ids have no consumers. Its two
address buttons get identifiers on their existing labelled Semantics.

* Pass alert dialog keys to the dialog widget

AlertWithOneAction accepted a key and dropped it, and BaseAlertDialog put
its own (always null) key on the barrier GestureDetector. BaseAlertDialog
now forwards super.key, AlertWithOneAction passes its key through,
AlertWithTwoActions passes alertDialogKey, and the GestureDetector no
longer repeats it, so find.byKey on a dialog key matches exactly one
widget.

* Test legacy wallet list, seed verification and alert identifiers

* Publish transaction detail row identifiers from their model keys

Removing the keyValue fallback in #3690 left TransactionDetailsModal rows without identifiers. The rows now pass the view model's static key through testId; every key in that model is a constant and the interpolation lint keeps it that way.

* Namespace transaction row ids by history view

The home preview indexes itemsShort (no date headers) and the All modal indexes items, so the same home_page_transaction_<i>_key meant different transactions in each. Preview rows keep home_page_transaction_<i>_key; modal rows become history_modal_transaction_<i>_key, and the robot reads the modal prefix.

* Keep transaction history keys unique across incremental updates; edit grouped wallets in the robot

History keys came from a local counter reset to 0 on every update, so appended items reused keys held by existing rows. The keys are never read, but they should still be unique: all six sites now share one view-model counter. WalletListPageRobot.openEditFor also resolves wallets inside groups, expanding the group first when its edit button is not built.

* Suffix the Lightning preimage row key with _key

It was the only transaction-detail key without the suffix, so TestId.fromKey rejected it and the row published no identifier.

* Address review: codemod guards, container on amount fields, ids on five top bars

- The codemod wraps TextField/TextFormField in TestId.container, like the lint
quick fix, and no longer picks up interpolated keys: one hit at this head
would have copied a seed word into an identifier.
- The send and swap amount fields use TestId.container.
- Five ModalTopBars that arrived through base merges get their own testId.

* Address review: unique saved-recipient key, delete dead ExchangeCard, CI check for test keys

- The saved-recipient fallback row no longer shares its key with the
recipient-address row.
- ExchangeCard is built by no screen, so it is deleted instead of retyped.
- A workflow fails when a test key under lib/ interpolates anything other
than a list index or an enum name. Until now only an IDE lint kept seed
words, addresses and wallet names out of release identifiers.

* Test-key check: allow a list position from indexOf

chart_range_${ChartRange.ranges.indexOf(item)}_key on the next branch in the
stack interpolates an int index and tripped the check.

* Tidy spacing in picker merge resolution

* Wallet list id test: expect the coin name and current-wallet labels from dev

* Restart transaction history key indexes when the list is rebuilt

* Merge picker and wallet selector rows with their checkbox for screen readers

* Expose the contact currency picker as a button, not a text field

* Test-key check: stop allowing item.name

* Keep the checkbox a separate stop on rows with their own tap

---------

Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference✓ Names security-relevant behavior explicitly
The short version

What changed, and why it matters

This is a large accessibility and test-automation improvement for the Cake Wallet Flutter app. It adds stable identifiers to buttons, text fields, lists, and dialogs so screen readers and automated UI tests can find them. The patch also removes user data such as wallet names, transaction IDs, and seed words from those identifiers, which reduces the risk of leaking sensitive information through the operating system's accessibility tree. There is no traditional security vulnerability being fixed, but the change hardens privacy in the accessibility layer and improves automated testing coverage.

Recommended action

No urgent security patch is required. Review the new lints and CI workflow to ensure they are enabled in all active branches, and confirm that no remaining `*_key` literals interpolate user data. Consider auditing other identifiers outside lib/ for similar leaks.

Security signals we found

01

Removed user-data interpolation from accessibility identifiers (tx ids, wallet names, seed words, addresses)

02

Added stable, index-based or enum-based semantics identifiers across UI components

03

Added custom lints and CI workflow to prevent future user-data interpolation in test keys

04

Improved screen-reader semantics for PIN pad, balance cards, checkboxes, alerts, and navigation

05

Added widget and integration tests covering accessibility identifiers and traversal

06

No traditional vulnerability class (e.g., injection, buffer overflow, cryptographic flaw) is present in the diff

Risk score

Why this scored 39/100

Our methodology →
Potential impact 8/30
Exploitability 3/25
Stealth signal 4/15
Affected reach 12/15
Confidence 8/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.