read signatures as a summary for screen readers, and move focus to the signatures after signing and to the transaction status after broadcasting
What changed, and why it matters
This commit improves accessibility for users who rely on screen readers. It makes the wallet announce how many signatures a transaction has, moves keyboard focus to the right place after signing or broadcasting, and labels the broadcast progress bar. There is no security vulnerability here.
No security action needed. This is an accessibility/usability improvement. Reviewers may verify that focus management does not interfere with secure workflow confirmation dialogs, which it does not appear to do.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch adds JavaFX accessibility attributes to SignaturesProgressBar so screen readers can read a text summary of signing status. It also manages focus transitions: after signing, focus moves to the signatures summary; after broadcasting, focus moves to the broadcast progress bar and then to the transaction status label. The blockStatus label gets an accessibleText binding. No cryptographic, network, or trust-model changes are introduced.
Changed components
src/main/java/com/sparrowwallet/sparrow/control/SignaturesProgressBar.javasrc/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.javasrc/main/resources/com/sparrowwallet/sparrow/transaction/headers.fxmlInspect captured patch +50 / −1
### src/main/java/com/sparrowwallet/sparrow/control/SignaturesProgressBar.java
@@ -8,11 +8,14 @@
import javafx.animation.KeyValue;
import javafx.animation.Timeline;
import javafx.beans.property.SimpleObjectProperty;
+import javafx.collections.FXCollections;
import javafx.collections.MapChangeListener;
import javafx.collections.ObservableMap;
import javafx.geometry.Insets;
import javafx.geometry.Orientation;
import javafx.geometry.Pos;
+import javafx.scene.AccessibleAttribute;
+import javafx.scene.AccessibleRole;
import javafx.scene.control.Label;
import javafx.scene.control.ProgressBar;
import javafx.scene.layout.StackPane;
@@ -21,16 +24,23 @@
import java.util.ArrayList;
import java.util.List;
+import java.util.Objects;
public class SignaturesProgressBar extends SegmentedBar<SignaturesProgressBar.SignatureProgressSegment> {
+ private int threshold;
+
public SignaturesProgressBar() {
+ //Read as one summary: each segment is a progress bar, which screen readers announce only as a percentage.
+ //A read-only text field rather than text, as VoiceOver keeps reading the first value it saw of text that later changes.
+ setAccessibleRole(AccessibleRole.TEXT_FIELD);
getStyleClass().add("signatures-progress-bar");
setOrientation(Orientation.HORIZONTAL);
setSegmentViewFactory(SignatureProgressSegmentView::new);
setInfoNodeFactory(segment -> segment.getKeystore() == null ? null : new SignatureProgressSegmentLabel(segment.getKeystore().getLabel()));
}
public void initialize(ObservableMap<TransactionSignature, Keystore> signatureKeystoreMap, int threshold) {
+ this.threshold = threshold;
getSegments().clear();
List<Keystore> signedKeystores = new ArrayList<>(signatureKeystoreMap.values());
@@ -79,7 +89,24 @@ public void initialize(ObservableMap<TransactionSignature, Keystore> signatureKe
newSegment.setKeystore(signedKeystore);
}
}
+
+ notifyAccessibleAttributeChanged(AccessibleAttribute.TEXT);
});
+
+ notifyAccessibleAttributeChanged(AccessibleAttribute.TEXT);
+ }
+
+ @Override
+ public Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters) {
+ return switch(attribute) {
+ case TEXT -> {
+ List<String> signers = getSegments().stream().map(SignatureProgressSegment::getKeystore).filter(Objects::nonNull).map(Keystore::getLabel).toList();
+ yield signers.isEmpty() ? "No signatures, " + threshold + " required" : signers.size() + " of " + threshold + " signatures, signed by " + String.join(", ", signers);
+ }
+ case EDITABLE -> false;
+ case CHILDREN -> FXCollections.emptyObservableList();
+ default -> super.queryAccessibleAttribute(attribute, parameters);
+ };
}
public static class SignatureProgressSegment extends SegmentedBar.Segment {
### src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java
@@ -32,6 +32,7 @@
import com.sparrowwallet.sparrow.wallet.HashIndexEntry;
import com.sparrowwallet.sparrow.wallet.TransactionEntry;
import javafx.application.Platform;
+import javafx.beans.binding.Bindings;
import javafx.collections.FXCollections;
import javafx.collections.ObservableMap;
import javafx.event.ActionEvent;
@@ -502,6 +503,7 @@ public LocalDate fromString(String value) {
signaturesProgressBar.managedProperty().bind(signaturesProgressBar.visibleProperty());
broadcastProgressBar.managedProperty().bind(broadcastProgressBar.visibleProperty());
broadcastProgressBar.visibleProperty().bind(signaturesProgressBar.visibleProperty().not());
+ blockStatus.accessibleTextProperty().bind(Bindings.concat("Transaction status: ", blockStatus.textProperty()));
broadcastButton.managedProperty().bind(broadcastButton.visibleProperty());
showTransactionButton.managedProperty().bind(showTransactionButton.visibleProperty());
@@ -870,6 +872,7 @@ private void updateEditable(boolean editable) {
}
private void updateBlockchainForm(BlockTransaction reportedTransaction, Integer currentHeight) {
+ boolean broadcasting = broadcastProgressBar.isFocused();
signaturesForm.setVisible(false);
blockchainForm.setVisible(true);
updateEditable(false);
@@ -953,6 +956,10 @@ private void updateBlockchainForm(BlockTransaction reportedTransaction, Integer
if(unproven) {
verifyBlockTransaction(blockTransaction);
}
+
+ if(broadcasting) {
+ blockStatus.requestFocus();
+ }
}
/**
@@ -1403,6 +1410,7 @@ public void broadcastTransaction(ActionEvent event) {
if(headersForm.getPsbt() != null) {
if(!extractTransaction()) {
broadcastButton.setDisable(false);
+ broadcastButton.requestFocus();
return;
}
}
@@ -1414,6 +1422,7 @@ public void broadcastTransaction(ActionEvent event) {
"This transaction pays a very high fee rate of " + String.format("%.0f", feeRateAmt) + " sats/vB.\n\nBroadcast this transaction?", ButtonType.YES, ButtonType.NO);
if(optType.isPresent() && optType.get() == ButtonType.NO) {
broadcastButton.setDisable(false);
+ broadcastButton.requestFocus();
return;
}
}
@@ -1455,6 +1464,7 @@ public void broadcastTransaction(ActionEvent event) {
log.error("Timeout searching for broadcasted transaction");
AppServices.showErrorDialog("Timeout searching for broadcasted transaction", "The transaction was broadcast but the server did not register it in the mempool. It is safe to try broadcasting again.");
broadcastButton.setDisable(false);
+ broadcastButton.requestFocus();
}
});
transactionMempoolService.setOnFailed(mempoolWorkerStateEvent -> {
@@ -1464,6 +1474,7 @@ public void broadcastTransaction(ActionEvent event) {
log.error("Timeout searching for broadcasted transaction");
AppServices.showErrorDialog("Timeout searching for broadcasted transaction", "The transaction was broadcast but the server did not indicate it had entered the mempool. It is safe to try broadcasting again.");
broadcastButton.setDisable(false);
+ broadcastButton.requestFocus();
}
});
transactionMempoolService.start();
@@ -1541,10 +1552,13 @@ public void broadcastTransaction(ActionEvent event) {
AppServices.showErrorDialog("Error broadcasting transaction", "The server returned an error when broadcasting the transaction. The server response is contained in the log (See Help > Show Log File).");
}
broadcastButton.setDisable(false);
+ broadcastButton.requestFocus();
});
signaturesProgressBar.setVisible(false);
broadcastProgressBar.setProgress(-1);
+ //Pressing Broadcast disables it, so focus is given to the progress, and then to the transaction status once it reaches the mempool
+ broadcastProgressBar.requestFocus();
broadcastTransactionService.start();
}
@@ -1876,8 +1890,16 @@ public void psbtFinalized(PSBTFinalizedEvent event) {
updateSignedKeystores(headersForm.getSigningWallet());
}
+ //Signing from the sign buttons hides them, so focus is given to the signatures, which are read as a summary
+ boolean signing = false;
+ for(Node node = signButtonBox.getScene() == null ? null : signButtonBox.getScene().getFocusOwner(); node != null && !signing; node = node.getParent()) {
+ signing = node == signButtonBox;
+ }
signButtonBox.setVisible(false);
broadcastButtonBox.setVisible(true);
+ if(signing) {
+ signaturesProgressBar.requestFocus();
+ }
if(Config.get().hasServer() && !AppServices.isConnected() && !AppServices.isConnecting()) {
if(Config.get().getConnectToBroadcast() == null) {
### src/main/resources/com/sparrowwallet/sparrow/transaction/headers.fxml
@@ -273,7 +273,7 @@
<Fieldset text="Signatures" inputGrow="SOMETIMES">
<VBox>
<SignaturesProgressBar fx:id="signaturesProgressBar" />
- <ProgressBar fx:id="broadcastProgressBar" maxWidth="Infinity" minHeight="50" prefHeight="50" />
+ <ProgressBar fx:id="broadcastProgressBar" accessibleText="Broadcasting transaction" maxWidth="Infinity" minHeight="50" prefHeight="50" />
</VBox>
<VBox>
<HBox fx:id="signButtonBox" styleClass="signatures-buttons" spacing="20">Why this scored 19/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.