give icon-only buttons accessible names so screen readers can announce them
What changed, and why it matters
This commit adds text labels to icon-only buttons so screen readers can describe them to visually impaired users. It is an accessibility improvement, not a security fix.
No security action required. Treat as a routine accessibility/usability improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch adds setAccessibleText() calls and accessibleText FXML attributes to icon-only JavaFX buttons across the Sparrow Wallet UI. These labels are consumed by assistive technologies (screen readers) and do not change application logic, event handlers, input validation, or cryptographic behavior.
Changed components
UI accessibility layer (JavaFX accessibleText properties)EntryCell, PrivateKeySweepDialog, TransactionDiagram, TransactionDiagramLabel, KeystoreControllerFXML views: paynym, server settings, transaction headers, addresses, keystore, payment, settings, transactions, utxosInspect captured patch +33 / −16
### src/main/java/com/sparrowwallet/sparrow/control/EntryCell.java
@@ -99,6 +99,7 @@ protected void updateItem(Entry entry, boolean empty) {
actionBox.getStyleClass().add("cell-actions");
Button viewTransactionButton = new Button("");
viewTransactionButton.setGraphic(getViewTransactionGlyph());
+ viewTransactionButton.setAccessibleText("View Transaction");
viewTransactionButton.setOnAction(event -> {
EventManager.get().post(new ViewTransactionEvent(this.getScene().getWindow(), transactionEntry.getBlockTransaction()));
});
@@ -109,6 +110,7 @@ protected void updateItem(Entry entry, boolean empty) {
Config.get().isIncludeMempoolOutputs() && transactionEntry.getWallet().allInputsFromWallet(blockTransaction.getHash())) {
Button increaseFeeButton = new Button("");
increaseFeeButton.setGraphic(getIncreaseFeeRBFGlyph());
+ increaseFeeButton.setAccessibleText("Increase Fee (RBF)");
increaseFeeButton.setOnAction(event -> {
increaseFee(transactionEntry, false);
});
@@ -118,6 +120,7 @@ protected void updateItem(Entry entry, boolean empty) {
if(blockTransaction.getHeight() <= 0 && containsWalletOutputs(transactionEntry)) {
Button cpfpButton = new Button("");
cpfpButton.setGraphic(getIncreaseFeeCPFPGlyph());
+ cpfpButton.setAccessibleText("Increase Effective Fee (CPFP)");
cpfpButton.setOnAction(event -> {
createCpfp(transactionEntry);
});
@@ -141,6 +144,7 @@ protected void updateItem(Entry entry, boolean empty) {
if(!nodeEntry.getNode().getWallet().isBip47() && nodeEntry.getNode().getWallet().getPolicyType() != PolicyType.SINGLE_SP) {
Button receiveButton = new Button("");
receiveButton.setGraphic(getReceiveGlyph());
+ receiveButton.setAccessibleText("Receive To");
receiveButton.setOnAction(event -> {
EventManager.get().post(new ReceiveActionEvent(nodeEntry));
Platform.runLater(() -> EventManager.get().post(new ReceiveToEvent(nodeEntry)));
@@ -151,6 +155,7 @@ protected void updateItem(Entry entry, boolean empty) {
if(canSignMessage(nodeEntry.getNode())) {
Button signMessageButton = new Button("");
signMessageButton.setGraphic(getSignMessageGlyph());
+ signMessageButton.setAccessibleText("Sign/Verify Message");
signMessageButton.setOnAction(event -> {
MessageSignDialog messageSignDialog = new MessageSignDialog(nodeEntry.getWallet(), nodeEntry.getNode());
messageSignDialog.initOwner(getTreeTableView().getScene().getWindow());
@@ -178,6 +183,7 @@ protected void updateItem(Entry entry, boolean empty) {
actionBox.getStyleClass().add("cell-actions");
Button viewTransactionButton = new Button("");
viewTransactionButton.setGraphic(getViewTransactionGlyph());
+ viewTransactionButton.setAccessibleText("View Transaction");
viewTransactionButton.setOnAction(event -> {
EventManager.get().post(new ViewTransactionEvent(this.getScene().getWindow(), hashIndexEntry.getBlockTransaction(), hashIndexEntry));
});
@@ -186,6 +192,7 @@ protected void updateItem(Entry entry, boolean empty) {
if(hashIndexEntry.getType().equals(HashIndexEntry.Type.OUTPUT) && hashIndexEntry.isSpendable() && !hashIndexEntry.getHashIndex().isSpent()) {
Button spendUtxoButton = new Button("");
spendUtxoButton.setGraphic(getSendGlyph());
+ spendUtxoButton.setAccessibleText("Send Selected");
spendUtxoButton.setOnAction(event -> {
sendSelectedUtxos(getTreeTableView(), hashIndexEntry);
});
### src/main/java/com/sparrowwallet/sparrow/control/PrivateKeySweepDialog.java
@@ -95,8 +95,10 @@ public PrivateKeySweepDialog(Wallet wallet) {
HBox keyBox = new HBox(5);
VBox keyButtonBox = new VBox(5);
Button scanKey = new Button("", getGlyph(FontAwesome5.Glyph.CAMERA));
+ scanKey.setAccessibleText("Scan QR Code");
scanKey.setOnAction(event -> scanPrivateKey());
Button readKey = new Button("", getGlyph(FontAwesome5.Glyph.FILE_IMPORT));
+ readKey.setAccessibleText("Import File");
readKey.setOnAction(event -> readPrivateKey());
keyButtonBox.getChildren().addAll(scanKey, readKey);
keyBox.getChildren().addAll(key, keyButtonBox);
@@ -106,6 +108,7 @@ public PrivateKeySweepDialog(Wallet wallet) {
if(CardApi.isReaderAvailable()) {
VBox cardButtonBox = new VBox(5);
Button cardKey = new Button("", getGlyph(FontAwesome5.Glyph.WIFI));
+ cardKey.setAccessibleText("Read From Card");
cardKey.setOnAction(event -> unsealPrivateKey());
cardButtonBox.getChildren().add(cardKey);
keyBox.getChildren().add(cardButtonBox);
### src/main/java/com/sparrowwallet/sparrow/control/TransactionDiagram.java
@@ -460,6 +460,7 @@ private Pane getInputsLabels(List<Map<BlockTransactionHashIndex, WalletNode>> di
Button excludeUtxoButton = new Button("");
excludeUtxoButton.setGraphic(getExcludeGlyph());
+ excludeUtxoButton.setAccessibleText("Exclude UTXO");
excludeUtxoButton.setOnAction(event -> {
EventManager.get().post(new ExcludeUtxoEvent(walletTx, input));
});
@@ -877,6 +878,7 @@ private OutputNode buildHdChangeNode(WalletTransaction.ChangeOutput changeOutput
if(!isFinal()) {
Button nextChangeAddressButton = new Button("");
nextChangeAddressButton.setGraphic(getChangeReplaceGlyph());
+ nextChangeAddressButton.setAccessibleText("Use Next Change Address");
nextChangeAddressButton.setOnAction(event -> {
EventManager.get().post(new ReplaceChangeAddressEvent(walletTx));
});
### src/main/java/com/sparrowwallet/sparrow/control/TransactionDiagramLabel.java
@@ -28,6 +28,7 @@ public TransactionDiagramLabel() {
left = new Button("");
left.setGraphic(getLeftGlyph());
+ left.setAccessibleText("Previous Output");
left.setOnAction(event -> {
int index = displayedIndex.get();
if(index > 0) {
@@ -38,6 +39,7 @@ public TransactionDiagramLabel() {
right = new Button("");
right.setGraphic(getRightGlyph());
+ right.setAccessibleText("Next Output");
right.setOnAction(event -> {
int index = displayedIndex.get();
if(index < outputs.size() - 1) {
### src/main/java/com/sparrowwallet/sparrow/wallet/KeystoreController.java
@@ -271,6 +271,7 @@ private void setXpubContext(ExtendedKey extendedKey) {
xpubField.setText(Network.get().getXpubHeader().getDisplayName() + " / " + header.getDisplayName() + ":");
switchXpubHeader.setDisable(false);
switchXpubHeader.setTooltip(new Tooltip("Show as " + header.getDisplayName()));
+ switchXpubHeader.setAccessibleText("Show as " + header.getDisplayName());
} else {
xpubField.setText(Network.get().getXpubHeader().getDisplayName() + ":");
switchXpubHeader.setDisable(true);
@@ -725,10 +726,12 @@ public void switchXpubHeader(ActionEvent event) {
String otherPub = keystore.getExtendedPublicKey().getExtendedKey(header);
xpub.setText(otherPub);
switchXpubHeader.setTooltip(new Tooltip("Show as " + Network.get().getXpubHeader().getDisplayName()));
+ switchXpubHeader.setAccessibleText("Show as " + Network.get().getXpubHeader().getDisplayName());
} else {
String xPub = keystore.getExtendedPublicKey().getExtendedKey();
xpub.setText(xPub);
switchXpubHeader.setTooltip(new Tooltip("Show as " + header.getDisplayName()));
+ switchXpubHeader.setAccessibleText("Show as " + header.getDisplayName());
}
}
}
### src/main/resources/com/sparrowwallet/sparrow/paynym/paynym.fxml
@@ -44,7 +44,7 @@
<Label text="Payment code:" styleClass="field-label" />
<HBox spacing="10">
<PaymentCodeTextField fx:id="paymentCode" styleClass="field-control" editable="false"/>
- <Button onAction="#showQR">
+ <Button accessibleText="Show QR Code" onAction="#showQR">
<graphic>
<Glyph fontFamily="Font Awesome 5 Free Solid" fontSize="12" icon="QRCODE" />
</graphic>
@@ -61,7 +61,7 @@
<Label text="Find Contact:" styleClass="field-label" />
<HBox spacing="10">
<CopyableTextField fx:id="searchPayNyms" promptText="PayNym or Payment code" styleClass="field-control"/>
- <Button fx:id="searchPayNymsScan" onAction="#scanQR">
+ <Button accessibleText="Scan QR Code" fx:id="searchPayNymsScan" onAction="#scanQR">
<graphic>
<Glyph fontFamily="Font Awesome 5 Free Solid" fontSize="12" icon="CAMERA" />
</graphic>
### src/main/resources/com/sparrowwallet/sparrow/settings/server.fxml
@@ -127,7 +127,7 @@
</Field>
<Field fx:id="coreDataDirField" text="Data Folder:" styleClass="label-button">
<TextField fx:id="coreDataDir"/>
- <Button fx:id="coreDataDirSelect" maxWidth="35" minWidth="-Infinity" prefWidth="35">
+ <Button accessibleText="Select Data Folder" fx:id="coreDataDirSelect" maxWidth="35" minWidth="-Infinity" prefWidth="35">
<graphic>
<Glyph fontFamily="FontAwesome" icon="EDIT" fontSize="13" />
</graphic>
@@ -161,7 +161,7 @@
</Field>
<Field text="Certificate:" styleClass="label-button">
<TextField fx:id="electrumCertificate" promptText="Optional server certificate (.crt)"/>
- <Button fx:id="electrumCertificateSelect" maxWidth="35" minWidth="-Infinity" prefWidth="35">
+ <Button accessibleText="Select Certificate" fx:id="electrumCertificateSelect" maxWidth="35" minWidth="-Infinity" prefWidth="35">
<graphic>
<Glyph fontFamily="FontAwesome" icon="EDIT" fontSize="13" />
</graphic>
### src/main/resources/com/sparrowwallet/sparrow/transaction/headers.fxml
@@ -50,15 +50,15 @@
<IdLabel fx:id="id"/>
<SegmentedButton>
<buttons>
- <ToggleButton accessibleRole="BUTTON" fx:id="copyTxid" onAction="#copyId">
+ <ToggleButton accessibleText="Copy Transaction ID" accessibleRole="BUTTON" fx:id="copyTxid" onAction="#copyId">
<graphic>
<Glyph fontFamily="Font Awesome 5 Free Solid" fontSize="12" icon="COPY" />
</graphic>
<tooltip>
<Tooltip text="Copy the transaction id to the clipboard"/>
</tooltip>
</ToggleButton>
- <ToggleButton accessibleRole="BUTTON" fx:id="openBlockExplorer" onAction="#openInBlockExplorer">
+ <ToggleButton accessibleText="Open in Block Explorer" accessibleRole="BUTTON" fx:id="openBlockExplorer" onAction="#openInBlockExplorer">
<graphic>
<Glyph fontFamily="Font Awesome 5 Free Solid" fontSize="12" icon="UP_RIGHT_FROM_SQUARE" />
</graphic>
### src/main/resources/com/sparrowwallet/sparrow/wallet/addresses.fxml
@@ -25,7 +25,7 @@
<top>
<HBox alignment="CENTER_LEFT">
<Label styleClass="addresses-treetable-label" text="Receive Addresses"/>
- <Button onAction="#exportReceiveAddresses" styleClass="icon-button">
+ <Button accessibleText="Export Receive Addresses" onAction="#exportReceiveAddresses" styleClass="icon-button">
<graphic>
<Glyph fontFamily="Font Awesome 5 Free Solid" icon="ARROW_CIRCLE_DOWN" fontSize="12" />
</graphic>
@@ -52,7 +52,7 @@
<top>
<HBox alignment="CENTER_LEFT">
<Label styleClass="addresses-treetable-label" text="Change Addresses"/>
- <Button onAction="#exportChangeAddresses" styleClass="icon-button">
+ <Button accessibleText="Export Change Addresses" onAction="#exportChangeAddresses" styleClass="icon-button">
<graphic>
<Glyph fontFamily="Font Awesome 5 Free Solid" icon="ARROW_CIRCLE_DOWN" fontSize="12" />
</graphic>
### src/main/resources/com/sparrowwallet/sparrow/wallet/keystore.fxml
@@ -86,23 +86,23 @@
<Field fx:id="xpubField" text="xpub:">
<TextArea fx:id="xpub" wrapText="true" prefRowCount="2" maxHeight="52" />
<VBox styleClass="xpub-buttons" HBox.hgrow="NEVER">
- <Button fx:id="scanXpubQR" onAction="#scanXpubQR">
+ <Button accessibleText="Scan QR Code" fx:id="scanXpubQR" onAction="#scanXpubQR">
<graphic>
<Glyph fontFamily="Font Awesome 5 Free Solid" fontSize="12" icon="CAMERA" />
</graphic>
<tooltip>
<Tooltip text="Scan a QR code" />
</tooltip>
</Button>
- <Button fx:id="displayXpubQR" onAction="#displayXpubQR">
+ <Button accessibleText="Show QR Code" fx:id="displayXpubQR" onAction="#displayXpubQR">
<graphic>
<Glyph fontFamily="Font Awesome 5 Free Solid" fontSize="12" icon="QRCODE" />
</graphic>
<tooltip>
<Tooltip text="Display as a QR code" />
</tooltip>
</Button>
- <Button fx:id="switchXpubHeader" onAction="#switchXpubHeader">
+ <Button accessibleText="Switch Key Header" fx:id="switchXpubHeader" onAction="#switchXpubHeader">
<graphic>
<Glyph fontFamily="Font Awesome 5 Free Solid" fontSize="12" icon="EXCHANGE_ALT" />
</graphic>
### src/main/resources/com/sparrowwallet/sparrow/wallet/payment.fxml
@@ -85,7 +85,7 @@
<Form GridPane.columnIndex="2" GridPane.rowIndex="0">
<Fieldset inputGrow="ALWAYS" style="-fx-padding: 5 0 0 0">
<HBox>
- <Button text="" fx:id="scanQrButton" onAction="#scanQrAddress" prefHeight="30">
+ <Button accessibleText="Scan QR Code" text="" fx:id="scanQrButton" onAction="#scanQrAddress" prefHeight="30">
<graphic>
<Glyph fontFamily="Font Awesome 5 Free Solid" fontSize="12" icon="CAMERA" />
</graphic>
### src/main/resources/com/sparrowwallet/sparrow/wallet/settings.fxml
@@ -83,15 +83,15 @@
<DescriptorArea fx:id="descriptor" editable="false" styleClass="uneditable-codearea" prefHeight="27" maxHeight="27" />
</content>
</VirtualizedScrollPane>
- <Button fx:id="scanDescriptorQR" onAction="#scanDescriptorQR">
+ <Button accessibleText="Scan QR Code" fx:id="scanDescriptorQR" onAction="#scanDescriptorQR">
<graphic>
<Glyph fontFamily="Font Awesome 5 Free Solid" fontSize="12" icon="CAMERA" />
</graphic>
<tooltip>
<Tooltip text="Scan a QR code" />
</tooltip>
</Button>
- <Button fx:id="showDescriptorQR" onAction="#showDescriptorQR">
+ <Button accessibleText="Show QR Code" fx:id="showDescriptorQR" onAction="#showDescriptorQR">
<graphic>
<Glyph fontFamily="Font Awesome 5 Free Solid" fontSize="12" icon="QRCODE" />
</graphic>
### src/main/resources/com/sparrowwallet/sparrow/wallet/transactions.fxml
@@ -42,7 +42,7 @@
</Field>
<Field text="Transactions:">
<CopyableLabel fx:id="transactionCount" />
- <Button fx:id="exportCsv" maxHeight="25" onAction="#exportCSV" translateY="-1" styleClass="icon-button">
+ <Button accessibleText="Export Transactions" fx:id="exportCsv" maxHeight="25" onAction="#exportCSV" translateY="-1" styleClass="icon-button">
<graphic>
<Glyph fontFamily="Font Awesome 5 Free Solid" icon="ARROW_CIRCLE_DOWN" fontSize="12" />
</graphic>
### src/main/resources/com/sparrowwallet/sparrow/wallet/utxos.fxml
@@ -42,7 +42,7 @@
</Field>
<Field text="UTXOs:">
<CopyableLabel fx:id="utxoCount" />
- <Button fx:id="exportCsv" maxHeight="25" onAction="#exportUtxos" translateY="-1" styleClass="icon-button">
+ <Button accessibleText="Export UTXOs" fx:id="exportCsv" maxHeight="25" onAction="#exportUtxos" translateY="-1" styleClass="icon-button">
<graphic>
<Glyph fontFamily="Font Awesome 5 Free Solid" icon="ARROW_CIRCLE_DOWN" fontSize="12" />
</graphic>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.