title the verify download dialog, name its browse buttons and results, move focus to the results and let escape close it
What changed, and why it matters
This commit improves the accessibility and keyboard behavior of Sparrow Wallet's 'Verify Download' dialog. It adds a window title, labels the browse buttons and result fields for screen readers, moves keyboard focus to the verification results when they appear, and makes the Escape key close the dialog instead of silently clearing the selected files. There is no security vulnerability being fixed here; it is a user-experience and accessibility improvement.
No security action required. Treat as a normal accessibility/UX improvement. If reviewing for release, verify the focus and Escape-key behavior match intended accessibility expectations and do not regress the Clear/Close button actions.
Security signals we found
No security-relevant code paths modified
No cryptographic, signature, hash, or manifest parsing logic changed
No input validation, privilege, or network behavior changed
Change is purely accessibility/keyboard focus/screen-reader labeling
Evidence from the diff
The patch modifies DownloadVerifierDialog.java to: set a dialog title; set AccessibleText on browse buttons; bind result labels to AccessibleRole.TEXT_FIELD with accessibleText derived from their title and text; make result labels focusable only when non-empty; move focus to the signedBy result label after verification completes; prevent the Clear button from acting as the default cancel button; and make the Close button the cancel button so Escape closes the dialog. These are accessibility/UX changes, not cryptographic or integrity fixes.
Changed components
src/main/java/com/sparrowwallet/sparrow/control/DownloadVerifierDialog.javaInspect captured patch +23 / −0
### src/main/java/com/sparrowwallet/sparrow/control/DownloadVerifierDialog.java
@@ -9,6 +9,7 @@
import com.sparrowwallet.sparrow.AppServices;
import com.sparrowwallet.sparrow.glyphfont.GlyphUtils;
import com.sparrowwallet.sparrow.net.VersionCheckService;
+import javafx.beans.binding.Bindings;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleBooleanProperty;
@@ -17,6 +18,7 @@
import javafx.concurrent.Task;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
+import javafx.scene.AccessibleRole;
import javafx.scene.control.*;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
@@ -96,6 +98,7 @@ public DownloadVerifierDialog(File initialFile) {
dialogPane.getStylesheets().add(AppServices.class.getResource("general.css").toExternalForm());
dialogPane.getStylesheets().add(AppServices.class.getResource("dialog.css").toExternalForm());
AppServices.setStageIcon(dialogPane.getScene().getWindow());
+ setTitle("Verify Download");
dialogPane.setHeader(new Header());
setupDrag(dialogPane);
@@ -132,6 +135,8 @@ public DownloadVerifierDialog(File initialFile) {
Field releaseVerifiedField = setupResultField(releaseVerified, "Verified");
releaseLink = new Hyperlink("");
+ //The link to the release file has no text until a download is verified, and an empty link tells a screen reader user nothing
+ releaseLink.focusTraversableProperty().bind(releaseLink.textProperty().isNotEmpty());
releaseVerifiedField.getInputs().add(releaseLink);
releaseLink.setOnAction(event -> {
if(release.get() != null && release.get().exists()) {
@@ -156,6 +161,9 @@ public DownloadVerifierDialog(File initialFile) {
ButtonType clearButtonType = new javafx.scene.control.ButtonType("Clear", ButtonBar.ButtonData.CANCEL_CLOSE);
ButtonType closeButtonType = new javafx.scene.control.ButtonType("Close", ButtonBar.ButtonData.OK_DONE);
dialogPane.getButtonTypes().addAll(clearButtonType, closeButtonType);
+ //Escape closes the dialog rather than quietly clearing the chosen files, which the Clear button still does
+ ((Button)dialogPane.lookupButton(clearButtonType)).setCancelButton(false);
+ ((Button)dialogPane.lookupButton(closeButtonType)).setCancelButton(true);
setOnCloseRequest(event -> {
if(ButtonBar.ButtonData.CANCEL_CLOSE.equals(getResult())) {
@@ -332,6 +340,7 @@ private void verify() {
releaseVerified.setText("Ready to install ");
releaseVerified.setGraphic(GlyphUtils.getSuccessGlyph());
releaseLink.setText(release.get().getName());
+ focusResults();
} else {
verifyManifest(verification, signedManifest.content());
}
@@ -346,6 +355,7 @@ private void verify() {
signedBy.setGraphic(GlyphUtils.getFailureGlyph());
signedBy.setTooltip(null);
clearReleaseFields();
+ focusResults();
});
pgpVerifyService.start();
@@ -434,6 +444,7 @@ private void verifyManifest(long verification, byte[] manifestContent) {
releaseVerified.setGraphic(GlyphUtils.getFailureGlyph());
releaseLink.setText("");
}
+ focusResults();
});
hashService.setOnFailed(event -> {
if(verification != verificationCount) {
@@ -446,6 +457,7 @@ private void verifyManifest(long verification, byte[] manifestContent) {
releaseVerified.setText("Cannot verify " + releaseFile.getName());
releaseVerified.setGraphic(GlyphUtils.getFailureGlyph());
releaseLink.setText("");
+ focusResults();
});
hashService.start();
} else {
@@ -455,6 +467,7 @@ private void verifyManifest(long verification, byte[] manifestContent) {
releaseVerified.setText("Not verified");
releaseVerified.setGraphic(GlyphUtils.getFailureGlyph());
releaseLink.setText("");
+ focusResults();
}
}
@@ -471,9 +484,18 @@ private Field setupResultField(Label label, String title) {
field.setText(title + ":");
field.getInputs().add(label);
label.setGraphicTextGap(8);
+ //Read as a read-only text field named by its title, and a Tab stop once it has a result, so the outcome can be heard
+ label.setAccessibleRole(AccessibleRole.TEXT_FIELD);
+ label.accessibleTextProperty().bind(Bindings.concat(title, ": ", label.textProperty()));
+ label.focusTraversableProperty().bind(label.textProperty().isNotEmpty());
return field;
}
+ //Results appear beside the chosen files without anything else changing, so focus moves to them once verification ends
+ private void focusResults() {
+ javafx.application.Platform.runLater(signedBy::requestFocus);
+ }
+
public static Map<File, String> getManifest(File manifest) throws IOException, InvalidManifestException {
if(manifest.length() > MAX_VALID_MANIFEST_SIZE) {
throw new InvalidManifestException("Manifest file is larger than " + (MAX_VALID_MANIFEST_SIZE / 1024) + "KB");
@@ -726,6 +748,7 @@ public FileField(ObjectProperty<File> fileProperty, String title, List<String> e
textField.setPromptText("e.g. " + example + formatExtensionsList(extensions) + (optional ? " (optional)" : ""));
textField.setOnMouseClicked(event -> browseForFile(title, extensions));
Button browseButton = new Button("Browse...");
+ browseButton.setAccessibleText("Browse for " + title);
browseButton.setOnAction(event -> browseForFile(title, extensions));
getChildren().addAll(textField, browseButton);
HBox.setHgrow(textField, Priority.ALWAYS);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.