read whole rows in the wallet summary table, sharing the row summary with the search wallet results
What changed, and why it matters
This commit improves screen-reader accessibility for two tables in the Sparrow Wallet desktop app. When a visually impaired user navigates through rows, the app now reads aloud a summary of the whole row instead of only the first cell. There is no security issue here.
No security action needed. Treat as a normal accessibility improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change refactors existing accessibility logic from SearchWalletDialog into a shared helper method CoinTreeTable.getRowSummary(), then reuses it in WalletSummaryDialog. The helper concatenates the visible text of all cells in a TreeTableRow and returns it as the AccessibleAttribute.TEXT value for assistive technologies such as VoiceOver. It is purely a UI/UX accessibility enhancement.
Changed components
CoinTreeTable.javaSearchWalletDialog.javaWalletSummaryDialog.javaInspect captured patch +26 / −21
### src/main/java/com/sparrowwallet/sparrow/control/CoinTreeTable.java
@@ -45,6 +45,7 @@
import java.util.List;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
public class CoinTreeTable extends TreeTableView<Entry> {
private TableType tableType;
@@ -98,6 +99,19 @@ static Object withRowActionsHelp(Object help) {
return help == null || help.toString().isEmpty() ? rowActionsHelp : help + ". " + rowActionsHelp;
}
+ //Moving up and down a table reads the first cell of each row, so a first cell holding only a name or type also reads the rest of its row.
+ //On macOS its own text is left out, as VoiceOver also reads the text inside the cell; other screen readers read only the name.
+ static String getRowSummary(TreeTableCell<?, ?> cell) {
+ if(cell.getText() == null || cell.isEditing() || cell.getTableRow() == null) {
+ return null;
+ }
+
+ boolean ownTextReadSeparately = OsType.getCurrent() == OsType.MACOS;
+ String summary = cell.getTableRow().getChildrenUnmodifiable().stream().filter(node -> node instanceof TreeTableCell<?, ?> && !(ownTextReadSeparately && node == cell))
+ .map(node -> ((TreeTableCell<?, ?>)node).getText()).filter(text -> text != null && !text.isEmpty()).collect(Collectors.joining(", "));
+ return summary.isEmpty() ? null : summary;
+ }
+
private boolean showRowMenu(int index) {
//Some tables have no row menus (wallet summary, Whirlpool child wallet addresses), and there the keys leave the table as it is
if(getVisibleRows().stream().noneMatch(row -> getMenuCell(row) != null)) {
### src/main/java/com/sparrowwallet/sparrow/control/SearchWalletDialog.java
@@ -3,7 +3,6 @@
import com.csvreader.CsvWriter;
import com.sparrowwallet.drongo.BitcoinUnit;
import com.sparrowwallet.drongo.KeyPurpose;
-import com.sparrowwallet.drongo.OsType;
import com.sparrowwallet.drongo.Utils;
import com.sparrowwallet.drongo.address.Address;
import com.sparrowwallet.drongo.address.InvalidAddressException;
@@ -20,8 +19,6 @@
import javafx.event.ActionEvent;
import javafx.scene.AccessibleAttribute;
import javafx.scene.control.*;
-import javafx.scene.image.Image;
-import javafx.scene.image.ImageView;
import javafx.scene.layout.VBox;
import javafx.stage.FileChooser;
import javafx.stage.Stage;
@@ -37,7 +34,6 @@
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.*;
-import java.util.stream.Collectors;
public class SearchWalletDialog extends Dialog<Entry> {
private static final Logger log = LoggerFactory.getLogger(SearchWalletDialog.class);
@@ -395,11 +391,8 @@ public Function getWalletFunction() {
}
}
- //Moving up and down the results reads the first cell of each row, which held only the wallet, account or entry type, so it also reads the
- //rest of the row. On macOS its own text is left out, as VoiceOver reads the text inside the cell as well; other screen readers read only the name.
+ //The first column reads the whole row as the results are moved through
private static class RowSummaryCell extends TreeTableCell<Entry, String> {
- private static final boolean OWN_TEXT_READ_SEPARATELY = OsType.getCurrent() == OsType.MACOS;
-
@Override
protected void updateItem(String item, boolean empty) {
super.updateItem(item, empty);
@@ -408,16 +401,8 @@ protected void updateItem(String item, boolean empty) {
@Override
public Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters) {
- if(attribute == AccessibleAttribute.TEXT && getText() != null && getTableRow() != null) {
- String summary = getTableRow().getChildrenUnmodifiable().stream()
- .filter(node -> node instanceof TreeTableCell<?, ?> && !(OWN_TEXT_READ_SEPARATELY && node == this))
- .map(node -> ((TreeTableCell<?, ?>)node).getText()).filter(text -> text != null && !text.isEmpty()).collect(Collectors.joining(", "));
- if(!summary.isEmpty()) {
- return summary;
- }
- }
-
- return super.queryAccessibleAttribute(attribute, parameters);
+ String summary = attribute == AccessibleAttribute.TEXT ? CoinTreeTable.getRowSummary(this) : null;
+ return summary != null ? summary : super.queryAccessibleAttribute(attribute, parameters);
}
}
### src/main/java/com/sparrowwallet/sparrow/control/WalletSummaryDialog.java
@@ -12,10 +12,9 @@
import com.sparrowwallet.sparrow.wallet.WalletTransactionsEntry;
import javafx.beans.property.ReadOnlyObjectWrapper;
import javafx.geometry.Side;
+import javafx.scene.AccessibleAttribute;
import javafx.scene.chart.NumberAxis;
import javafx.scene.control.*;
-import javafx.scene.image.Image;
-import javafx.scene.image.ImageView;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Priority;
import javafx.scene.layout.VBox;
@@ -56,7 +55,14 @@ public WalletSummaryDialog(List<List<WalletForm>> summaryWalletFormsList) {
nameColumn.setCellValueFactory((TreeTableColumn.CellDataFeatures<Entry, String> param) -> {
return new ReadOnlyObjectWrapper<>(param.getValue().getValue().getLabel());
});
- nameColumn.setCellFactory(p -> new LabelCell());
+ //The wallet column reads the whole row as the table is moved through
+ nameColumn.setCellFactory(p -> new LabelCell() {
+ @Override
+ public Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters) {
+ String summary = attribute == AccessibleAttribute.TEXT ? CoinTreeTable.getRowSummary(this) : null;
+ return summary != null ? summary : super.queryAccessibleAttribute(attribute, parameters);
+ }
+ });
table.getColumns().add(nameColumn);
TreeTableColumn<Entry, Number> balanceColumn = new TreeTableColumn<>("Balance");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.