take row buttons out of the tab order and open row actions from the keyboard with shift-f10 or control-return
What changed, and why it matters
This commit is an accessibility/usability improvement for a Bitcoin wallet's tables. It removes small per-row buttons from the keyboard Tab order and lets users open a row's action menu using Shift-F10 or Control+Return instead. There is no security vulnerability being fixed here; it is about making the app easier to navigate with a keyboard or screen reader.
No security action required. Treat as a normal accessibility/usability improvement during routine review or testing.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies CoinTreeTable, DateCell, EntryCell, and a CSS file. It adds keyboard event handlers (Shift-F10, Context Menu key, Control-Return on macOS) to open a row’s context menu, exposes that help text to screen readers via AccessibleAttribute.HELP, and sets -fx-focus-traversable: false on .cell-actions .button so row buttons are skipped during Tab navigation. No cryptographic, input-validation, or privilege changes are present.
Changed components
CoinTreeTable UI controlDateCell table cellEntryCell table cellgeneral.css stylingInspect captured patch +110 / −0
### src/main/java/com/sparrowwallet/sparrow/control/CoinTreeTable.java
@@ -1,6 +1,7 @@
package com.sparrowwallet.sparrow.control;
import com.sparrowwallet.drongo.BitcoinUnit;
+import com.sparrowwallet.drongo.OsType;
import com.sparrowwallet.drongo.policy.PolicyType;
import com.sparrowwallet.drongo.wallet.SortDirection;
import com.sparrowwallet.drongo.wallet.TableType;
@@ -27,15 +28,21 @@
import javafx.collections.FXCollections;
import javafx.collections.ListChangeListener;
import javafx.geometry.Pos;
+import javafx.geometry.Side;
import javafx.scene.AccessibleAttribute;
import javafx.scene.AccessibleRole;
import javafx.scene.Node;
import javafx.scene.control.*;
+import javafx.scene.input.ContextMenuEvent;
+import javafx.scene.input.KeyCode;
+import javafx.scene.input.KeyEvent;
import javafx.scene.layout.StackPane;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
+import java.util.ArrayList;
import java.util.Date;
+import java.util.List;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
@@ -65,6 +72,83 @@ public Object queryAccessibleAttribute(AccessibleAttribute attribute, Object...
return super.queryAccessibleAttribute(attribute, parameters);
}
});
+
+ //Row actions are in the context menu of each row's entry cell, which a keyboard menu request to the table opens for the focused row.
+ //Windows and Linux send Shift-F10 and the Menu key as that request; macOS sends nothing, so those keys and Control-Return are handled here.
+ boolean macOS = OsType.getCurrent() == OsType.MACOS;
+ if(macOS) {
+ addEventHandler(KeyEvent.KEY_PRESSED, event -> {
+ boolean menuKey = event.getCode() == KeyCode.CONTEXT_MENU || (event.getCode() == KeyCode.F10 && event.isShiftDown())
+ || (event.getCode() == KeyCode.ENTER && event.isControlDown() && !event.isShiftDown() && !event.isAltDown() && !event.isMetaDown());
+ if(menuKey && event.getTarget() == this && showRowMenu(getFocusModel().getFocusedIndex())) {
+ event.consume();
+ }
+ });
+ }
+ addEventHandler(ContextMenuEvent.CONTEXT_MENU_REQUESTED, event -> {
+ if(event.isKeyboardTrigger() && event.getTarget() == this && showRowMenu(getFocusModel().getFocusedIndex())) {
+ event.consume();
+ }
+ });
+ }
+
+ //Screen readers read the help of a row's focused cell, so the key that opens the row's actions follows the cell's own help
+ static Object withRowActionsHelp(Object help) {
+ String rowActionsHelp = OsType.getCurrent() == OsType.MACOS ? "Press Shift-F10 or Control-Return for row actions" : "Press Shift-F10 for row actions";
+ return help == null || help.toString().isEmpty() ? rowActionsHelp : help + ". " + rowActionsHelp;
+ }
+
+ 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)) {
+ return false;
+ }
+
+ //Tabbing into a table focuses no row, so the menu is for the first row, which is then focused to show which row the menu is for
+ int rowIndex = Math.max(index, 0);
+ TreeTableRow<?> row = getVisibleRow(rowIndex);
+ if(row == null) {
+ //The focused row may have been scrolled out of view with the mouse or trackpad, and only rows on screen have cells
+ scrollTo(rowIndex);
+ layout();
+ row = getVisibleRow(rowIndex);
+ }
+
+ EntryCell menuCell = row == null ? null : getMenuCell(row);
+ if(menuCell == null) {
+ return false;
+ }
+
+ if(index < 0) {
+ getFocusModel().focus(rowIndex);
+ }
+ menuCell.getContextMenu().show(menuCell, Side.BOTTOM, 0, 0);
+ return true;
+ }
+
+ private List<TreeTableRow<?>> getVisibleRows() {
+ List<TreeTableRow<?>> rows = new ArrayList<>();
+ for(Node node : lookupAll(".tree-table-row-cell")) {
+ if(node instanceof TreeTableRow<?> row && row.isVisible() && !row.isEmpty()) {
+ rows.add(row);
+ }
+ }
+
+ return rows;
+ }
+
+ private TreeTableRow<?> getVisibleRow(int index) {
+ return getVisibleRows().stream().filter(row -> row.getIndex() == index).findFirst().orElse(null);
+ }
+
+ private static EntryCell getMenuCell(TreeTableRow<?> row) {
+ for(Node child : row.getChildrenUnmodifiable()) {
+ if(child instanceof EntryCell entryCell && entryCell.getContextMenu() != null) {
+ return entryCell;
+ }
+ }
+
+ return null;
}
public TableType getTableType() {
### src/main/java/com/sparrowwallet/sparrow/control/DateCell.java
@@ -3,6 +3,7 @@
import com.sparrowwallet.sparrow.wallet.Entry;
import com.sparrowwallet.sparrow.wallet.UtxoEntry;
import javafx.geometry.Pos;
+import javafx.scene.AccessibleAttribute;
import javafx.scene.control.*;
import javafx.scene.input.Clipboard;
import javafx.scene.input.ClipboardContent;
@@ -57,6 +58,16 @@ protected void updateItem(Entry entry, boolean empty) {
}
}
+ //In the UTXOs table the date is the first cell of each row, the one screen readers focus
+ @Override
+ public Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters) {
+ if(attribute == AccessibleAttribute.HELP && getContextMenu() != null && getTreeTableView() instanceof CoinTreeTable) {
+ return CoinTreeTable.withRowActionsHelp(super.queryAccessibleAttribute(attribute, parameters));
+ }
+
+ return super.queryAccessibleAttribute(attribute, parameters);
+ }
+
private static class DateContextMenu extends HashIndexEntryContextMenu {
public DateContextMenu(TreeTableView<Entry> treeTableView, UtxoEntry utxoEntry, String date) {
super(treeTableView, utxoEntry);
### src/main/java/com/sparrowwallet/sparrow/control/EntryCell.java
@@ -19,6 +19,7 @@
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.geometry.Pos;
+import javafx.scene.AccessibleAttribute;
import javafx.scene.control.*;
import javafx.scene.input.Clipboard;
import javafx.scene.input.ClipboardContent;
@@ -204,6 +205,15 @@ protected void updateItem(Entry entry, boolean empty) {
}
}
+ @Override
+ public Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters) {
+ if(attribute == AccessibleAttribute.HELP && getContextMenu() != null && getTreeTableView() instanceof CoinTreeTable) {
+ return CoinTreeTable.withRowActionsHelp(super.queryAccessibleAttribute(attribute, parameters));
+ }
+
+ return super.queryAccessibleAttribute(attribute, parameters);
+ }
+
@Override
public IntegerProperty getConfirmationsProperty() {
if(confirmationsProperty == null) {
### src/main/resources/com/sparrowwallet/sparrow/general.css
@@ -9,6 +9,11 @@
-fx-focus-traversable: false;
}
+/* Row actions are also in each row's context menu, opened from the keyboard in CoinTreeTable, so the buttons are not Tab stops in every row */
+.cell-actions .button {
+ -fx-focus-traversable: false;
+}
+
.form .wideLabelFieldSet.fieldset:horizontal .label-container {
-fx-pref-width: 170px;
-fx-pref-height: 25px;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.