hide empty server alias and paynym list rows from screen readers
What changed, and why it matters
This commit makes a small user-interface accessibility improvement. In two places where Sparrow Wallet shows lists (a PayNym contact list and a server-alias list), empty rows that exist only to fill blank space below real entries are now hidden from screen readers. There is no indication this change fixes a security vulnerability; it is a usability/accessibility fix for assistive technology users.
No security action required. Treat as a normal accessibility/usability fix.
Security signals we found
No security-relevant code paths modified
Change is purely accessibility/assistive-technology related
No input validation, parsing, serialization, or privilege changes
No references to vulnerabilities, CVEs, or security reports in commit message
Evidence from the diff
The patch overrides queryAccessibleAttribute in empty ListCell/TableRow instances so that, when a screen reader queries AccessibleAttribute.ROLE, they report AccessibleRole.NODE instead of their default role, and return an empty child list. This prevents screen-reader software from announcing or navigating to purely decorative empty rows. No cryptographic, network, or data-handling code is touched.
Changed components
src/main/java/com/sparrowwallet/sparrow/control/PayNymCell.javasrc/main/java/com/sparrowwallet/sparrow/settings/ServerAliasDialog.javaInspect captured patch +34 / −2
### src/main/java/com/sparrowwallet/sparrow/control/PayNymCell.java
@@ -6,8 +6,11 @@
import com.sparrowwallet.sparrow.glyphfont.FontAwesome5;
import com.sparrowwallet.sparrow.paynym.PayNym;
import com.sparrowwallet.sparrow.paynym.PayNymController;
+import javafx.collections.FXCollections;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
+import javafx.scene.AccessibleAttribute;
+import javafx.scene.AccessibleRole;
import javafx.scene.control.*;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.HBox;
@@ -102,6 +105,20 @@ public static Glyph getLinkGlyph() {
return failGlyph;
}
+ @Override
+ public Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters) {
+ //Empty cells fill the space below the last PayNym and have nothing to read
+ if(isEmpty()) {
+ if(attribute == AccessibleAttribute.ROLE) {
+ return AccessibleRole.NODE;
+ } else if(attribute == AccessibleAttribute.CHILDREN) {
+ return FXCollections.emptyObservableList();
+ }
+ }
+
+ return super.queryAccessibleAttribute(attribute, parameters);
+ }
+
private class PayNymCellContextMenu extends ContextMenu {
public PayNymCellContextMenu(PayNym payNym) {
MenuItem rename = new MenuItem("Rename Contact...");
### src/main/java/com/sparrowwallet/sparrow/settings/ServerAliasDialog.java
@@ -11,11 +11,11 @@
import javafx.beans.property.StringProperty;
import javafx.collections.FXCollections;
import javafx.event.Event;
+import javafx.scene.AccessibleAttribute;
+import javafx.scene.AccessibleRole;
import javafx.scene.Node;
import javafx.scene.control.*;
import javafx.scene.control.cell.TextFieldTableCell;
-import javafx.scene.image.Image;
-import javafx.scene.image.ImageView;
import javafx.scene.layout.StackPane;
import javafx.util.converter.DefaultStringConverter;
import org.controlsfx.glyphfont.Glyph;
@@ -43,6 +43,21 @@ public ServerAliasDialog(ServerType serverType) {
serverTable = new TableView<>();
serverTable.setPlaceholder(new Label("No servers added yet"));
+ serverTable.setRowFactory(_ -> new TableRow<>() {
+ @Override
+ public Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters) {
+ //Empty rows fill the space below the last server and have nothing to read
+ if(isEmpty()) {
+ if(attribute == AccessibleAttribute.ROLE) {
+ return AccessibleRole.NODE;
+ } else if(attribute == AccessibleAttribute.CHILDREN) {
+ return FXCollections.emptyObservableList();
+ }
+ }
+
+ return super.queryAccessibleAttribute(attribute, parameters);
+ }
+ });
TableColumn<ServerEntry, String> urlColumn = new TableColumn<>("URL");
urlColumn.setMinWidth(300);Why this scored 18/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.