expose single-choice toggle groups to screen readers as radio buttons instead of checkboxes
What changed, and why it matters
This commit is an accessibility improvement: it tells screen-reader software to announce certain on/off button groups as 'radio buttons' rather than 'checkboxes.' There is no change to security-sensitive logic, cryptography, networking, or data handling.
No security action required. Treat as a normal accessibility/usability fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch sets AccessibleRole.RADIO_BUTTON on ToggleButton controls that belong to single-selection ToggleGroups, either in Java code via setAccessibleRole() or in FXML via accessibleRole=’RADIO_BUTTON’. This affects how assistive technologies present UI state to users. No functional behavior of the application is changed.
Changed components
MempoolSizeFeeRatesChart.javaMessageSignDialog.javakeystoreimport.fxmlserver.fxmlsettings.fxmlheaders.fxmlinput.fxmlsend.fxmlwallet.fxmlInspect captured patch +30 / −27
### src/main/java/com/sparrowwallet/sparrow/control/MempoolSizeFeeRatesChart.java
@@ -88,6 +88,7 @@ public void handle(MouseEvent event) {
ToggleButton period24 = new ToggleButton("24H");
SegmentedButton periodButtons = new SegmentedButton(period2, period24);
periodButtons.setToggleGroup(periodGroup);
+ periodButtons.getButtons().forEach(button -> button.setAccessibleRole(AccessibleRole.RADIO_BUTTON));
periodGroup.selectedToggleProperty().addListener((observable, oldValue, newValue) -> {
expandedChart.maxPeriodHours = (newValue == period2 ? 2 : 24);
expandedChart.update(AppServices.getMempoolHistogram());
### src/main/java/com/sparrowwallet/sparrow/control/MessageSignDialog.java
@@ -23,6 +23,7 @@
import com.sparrowwallet.sparrow.glyphfont.FontAwesome5Brands;
import com.sparrowwallet.sparrow.io.Storage;
import javafx.application.Platform;
+import javafx.scene.AccessibleRole;
import javafx.scene.Node;
import javafx.scene.control.*;
import javafx.scene.layout.VBox;
@@ -182,6 +183,7 @@ public MessageSignDialog(Wallet wallet, WalletNode walletNode, String title, Str
formatBip322 = new ToggleButton("BIP322 (Simple)");
SegmentedButton formatButtons = new SegmentedButton(formatElectrum, formatTrezor, formatBip322);
formatButtons.setToggleGroup(formatGroup);
+ formatButtons.getButtons().forEach(button -> button.setAccessibleRole(AccessibleRole.RADIO_BUTTON));
formatField.getInputs().add(formatButtons);
fieldset.getChildren().addAll(addressField, messageField, signatureField, formatField);
### src/main/resources/com/sparrowwallet/sparrow/keystoreimport/keystoreimport.fxml
@@ -15,7 +15,7 @@
</padding>
<left>
<VBox styleClass="list-menu">
- <ToggleButton VBox.vgrow="ALWAYS" text="Connected Hardware Wallet" wrapText="true" textAlignment="CENTER" contentDisplay="TOP" styleClass="list-item" maxHeight="Infinity">
+ <ToggleButton accessibleRole="RADIO_BUTTON" VBox.vgrow="ALWAYS" text="Connected Hardware Wallet" wrapText="true" textAlignment="CENTER" contentDisplay="TOP" styleClass="list-item" maxHeight="Infinity">
<toggleGroup>
<ToggleGroup fx:id="importMenu" />
</toggleGroup>
@@ -26,15 +26,15 @@
<KeystoreSource fx:constant="HW_USB"/>
</userData>
</ToggleButton>
- <ToggleButton VBox.vgrow="ALWAYS" text="Airgapped Hardware Wallet" wrapText="true" textAlignment="CENTER" contentDisplay="TOP" styleClass="list-item" maxHeight="Infinity" toggleGroup="$importMenu">
+ <ToggleButton accessibleRole="RADIO_BUTTON" VBox.vgrow="ALWAYS" text="Airgapped Hardware Wallet" wrapText="true" textAlignment="CENTER" contentDisplay="TOP" styleClass="list-item" maxHeight="Infinity" toggleGroup="$importMenu">
<graphic>
<Glyph fontFamily="Font Awesome 5 Free Solid" fontSize="20" icon="SD_CARD" />
</graphic>
<userData>
<KeystoreSource fx:constant="HW_AIRGAPPED"/>
</userData>
</ToggleButton>
- <ToggleButton VBox.vgrow="ALWAYS" text="Software Wallet" wrapText="true" textAlignment="CENTER" contentDisplay="TOP" styleClass="list-item" maxHeight="Infinity" toggleGroup="$importMenu">
+ <ToggleButton accessibleRole="RADIO_BUTTON" VBox.vgrow="ALWAYS" text="Software Wallet" wrapText="true" textAlignment="CENTER" contentDisplay="TOP" styleClass="list-item" maxHeight="Infinity" toggleGroup="$importMenu">
<graphic>
<Glyph fontFamily="Font Awesome 5 Free Solid" fontSize="20" icon="LAPTOP" />
</graphic>
### src/main/resources/com/sparrowwallet/sparrow/settings/server.fxml
@@ -38,23 +38,23 @@
<ToggleGroup fx:id="serverTypeToggleGroup" />
</toggleGroup>
<buttons>
- <ToggleButton fx:id="publicElectrumToggle" text="Public Server" toggleGroup="$serverTypeToggleGroup">
+ <ToggleButton accessibleRole="RADIO_BUTTON" fx:id="publicElectrumToggle" text="Public Server" toggleGroup="$serverTypeToggleGroup">
<graphic>
<Glyph fontFamily="Font Awesome 5 Free Solid" fontSize="12" icon="TOGGLE_ON" styleClass="public-electrum" />
</graphic>
<userData>
<ServerType fx:constant="PUBLIC_ELECTRUM_SERVER"/>
</userData>
</ToggleButton>
- <ToggleButton text="Bitcoin Core" toggleGroup="$serverTypeToggleGroup">
+ <ToggleButton accessibleRole="RADIO_BUTTON" text="Bitcoin Core" toggleGroup="$serverTypeToggleGroup">
<graphic>
<Glyph fontFamily="Font Awesome 5 Free Solid" fontSize="12" icon="TOGGLE_ON" styleClass="bitcoin-core" />
</graphic>
<userData>
<ServerType fx:constant="BITCOIN_CORE"/>
</userData>
</ToggleButton>
- <ToggleButton text="Private Electrum" toggleGroup="$serverTypeToggleGroup">
+ <ToggleButton accessibleRole="RADIO_BUTTON" text="Private Electrum" toggleGroup="$serverTypeToggleGroup">
<graphic>
<Glyph fontFamily="Font Awesome 5 Free Solid" fontSize="12" icon="TOGGLE_ON" styleClass="private-electrum" />
</graphic>
@@ -112,12 +112,12 @@
<ToggleGroup fx:id="coreAuthToggleGroup" />
</toggleGroup>
<buttons>
- <ToggleButton text="Default" toggleGroup="$coreAuthToggleGroup">
+ <ToggleButton accessibleRole="RADIO_BUTTON" text="Default" toggleGroup="$coreAuthToggleGroup">
<userData>
<CoreAuthType fx:constant="COOKIE"/>
</userData>
</ToggleButton>
- <ToggleButton text="User / Pass" toggleGroup="$coreAuthToggleGroup">
+ <ToggleButton accessibleRole="RADIO_BUTTON" text="User / Pass" toggleGroup="$coreAuthToggleGroup">
<userData>
<CoreAuthType fx:constant="USERPASS"/>
</userData>
### src/main/resources/com/sparrowwallet/sparrow/settings/settings.fxml
@@ -12,7 +12,7 @@
<BorderPane stylesheets="@../general.css, @settings.css" styleClass="line-border" xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml" fx:controller="com.sparrowwallet.sparrow.settings.SettingsController">
<left>
<VBox styleClass="list-menu">
- <ToggleButton VBox.vgrow="ALWAYS" text="General" wrapText="true" textAlignment="CENTER" contentDisplay="TOP" styleClass="list-item" maxHeight="Infinity" toggleGroup="$settingsMenu">
+ <ToggleButton accessibleRole="RADIO_BUTTON" VBox.vgrow="ALWAYS" text="General" wrapText="true" textAlignment="CENTER" contentDisplay="TOP" styleClass="list-item" maxHeight="Infinity" toggleGroup="$settingsMenu">
<toggleGroup>
<ToggleGroup fx:id="settingsMenu" />
</toggleGroup>
@@ -23,7 +23,7 @@
<SettingsGroup fx:constant="GENERAL"/>
</userData>
</ToggleButton>
- <ToggleButton VBox.vgrow="ALWAYS" text="Server" wrapText="true" textAlignment="CENTER" contentDisplay="TOP" styleClass="list-item" maxHeight="Infinity" toggleGroup="$settingsMenu">
+ <ToggleButton accessibleRole="RADIO_BUTTON" VBox.vgrow="ALWAYS" text="Server" wrapText="true" textAlignment="CENTER" contentDisplay="TOP" styleClass="list-item" maxHeight="Infinity" toggleGroup="$settingsMenu">
<graphic>
<Glyph fontFamily="Font Awesome 5 Free Solid" fontSize="20" icon="SERVER" />
</graphic>
### src/main/resources/com/sparrowwallet/sparrow/transaction/headers.fxml
@@ -111,9 +111,9 @@
<ToggleGroup fx:id="locktimeToggleGroup" />
</toggleGroup>
<buttons>
- <ToggleButton fx:id="locktimeNoneType" text="Disabled" userData="none" toggleGroup="$locktimeToggleGroup" />
- <ToggleButton fx:id="locktimeBlockType" text="Block" userData="block" toggleGroup="$locktimeToggleGroup" />
- <ToggleButton fx:id="locktimeDateType" text="Date" userData="date" toggleGroup="$locktimeToggleGroup" />
+ <ToggleButton accessibleRole="RADIO_BUTTON" fx:id="locktimeNoneType" text="Disabled" userData="none" toggleGroup="$locktimeToggleGroup" />
+ <ToggleButton accessibleRole="RADIO_BUTTON" fx:id="locktimeBlockType" text="Block" userData="block" toggleGroup="$locktimeToggleGroup" />
+ <ToggleButton accessibleRole="RADIO_BUTTON" fx:id="locktimeDateType" text="Date" userData="date" toggleGroup="$locktimeToggleGroup" />
</buttons>
</SegmentedButton>
</Field>
### src/main/resources/com/sparrowwallet/sparrow/transaction/input.fxml
@@ -101,17 +101,17 @@
<ToggleGroup fx:id="locktimeToggleGroup" />
</toggleGroup>
<buttons>
- <ToggleButton fx:id="locktimeNoneType" text="Disabled" userData="none" toggleGroup="$locktimeToggleGroup">
+ <ToggleButton accessibleRole="RADIO_BUTTON" fx:id="locktimeNoneType" text="Disabled" userData="none" toggleGroup="$locktimeToggleGroup">
<tooltip>
<Tooltip text="Disable time locks"/>
</tooltip>
</ToggleButton>
- <ToggleButton fx:id="locktimeAbsoluteType" text="Absolute" userData="absolute" toggleGroup="$locktimeToggleGroup">
+ <ToggleButton accessibleRole="RADIO_BUTTON" fx:id="locktimeAbsoluteType" text="Absolute" userData="absolute" toggleGroup="$locktimeToggleGroup">
<tooltip>
<Tooltip text="Enable absolute (transaction level) time lock only"/>
</tooltip>
</ToggleButton>
- <ToggleButton fx:id="locktimeRelativeType" text="Relative" userData="relative" toggleGroup="$locktimeToggleGroup">
+ <ToggleButton accessibleRole="RADIO_BUTTON" fx:id="locktimeRelativeType" text="Relative" userData="relative" toggleGroup="$locktimeToggleGroup">
<tooltip>
<Tooltip text="Enable both absolute and relative time locks"/>
</tooltip>
### src/main/resources/com/sparrowwallet/sparrow/wallet/send.fxml
@@ -65,23 +65,23 @@
<ToggleGroup fx:id="feeSelectionToggleGroup" />
</toggleGroup>
<buttons>
- <ToggleButton fx:id="targetBlocksToggle" text="Target Blocks" toggleGroup="$feeSelectionToggleGroup">
+ <ToggleButton accessibleRole="RADIO_BUTTON" fx:id="targetBlocksToggle" text="Target Blocks" toggleGroup="$feeSelectionToggleGroup">
<tooltip>
<Tooltip text="Determine fee via estimated number of blocks"/>
</tooltip>
<userData>
<FeeRatesSelection fx:constant="BLOCK_TARGET"/>
</userData>
</ToggleButton>
- <ToggleButton fx:id="mempoolSizeToggle" text="Mempool Size" toggleGroup="$feeSelectionToggleGroup">
+ <ToggleButton accessibleRole="RADIO_BUTTON" fx:id="mempoolSizeToggle" text="Mempool Size" toggleGroup="$feeSelectionToggleGroup">
<tooltip>
<Tooltip text="Determine fee via current mempool size"/>
</tooltip>
<userData>
<FeeRatesSelection fx:constant="MEMPOOL_SIZE"/>
</userData>
</ToggleButton>
- <ToggleButton fx:id="recentBlocksToggle" text="Recent Blocks" toggleGroup="$feeSelectionToggleGroup">
+ <ToggleButton accessibleRole="RADIO_BUTTON" fx:id="recentBlocksToggle" text="Recent Blocks" toggleGroup="$feeSelectionToggleGroup">
<tooltip>
<Tooltip text="Show recent and upcoming blocks"/>
</tooltip>
@@ -169,15 +169,15 @@
<ToggleGroup fx:id="optimizationToggleGroup" />
</toggleGroup>
<buttons>
- <ToggleButton fx:id="efficiencyToggle" text="Efficiency" toggleGroup="$optimizationToggleGroup">
+ <ToggleButton accessibleRole="RADIO_BUTTON" fx:id="efficiencyToggle" text="Efficiency" toggleGroup="$optimizationToggleGroup">
<tooltip>
<Tooltip text="Smallest transaction size for lowest fees"/>
</tooltip>
<userData>
<OptimizationStrategy fx:constant="EFFICIENCY"/>
</userData>
</ToggleButton>
- <ToggleButton fx:id="privacyToggle" text="Privacy" toggleGroup="$optimizationToggleGroup">
+ <ToggleButton accessibleRole="RADIO_BUTTON" fx:id="privacyToggle" text="Privacy" toggleGroup="$optimizationToggleGroup">
<tooltip>
<Tooltip text="Higher entropy transactions that reduce probabilities in blockchain analysis"/>
</tooltip>
### src/main/resources/com/sparrowwallet/sparrow/wallet/wallet.fxml
@@ -11,7 +11,7 @@
<BorderPane stylesheets="@wallet.css, @../general.css" xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml" fx:controller="com.sparrowwallet.sparrow.wallet.WalletController">
<left>
<VBox fx:id="walletMenuBox" styleClass="list-menu">
- <ToggleButton VBox.vgrow="ALWAYS" text="Transactions" contentDisplay="TOP" styleClass="list-item" maxHeight="Infinity">
+ <ToggleButton accessibleRole="RADIO_BUTTON" VBox.vgrow="ALWAYS" text="Transactions" contentDisplay="TOP" styleClass="list-item" maxHeight="Infinity">
<toggleGroup>
<ToggleGroup fx:id="walletMenu" />
</toggleGroup>
@@ -22,39 +22,39 @@
<Function fx:constant="TRANSACTIONS"/>
</userData>
</ToggleButton>
- <ToggleButton VBox.vgrow="ALWAYS" text="Send" contentDisplay="TOP" styleClass="list-item" maxHeight="Infinity" toggleGroup="$walletMenu">
+ <ToggleButton accessibleRole="RADIO_BUTTON" VBox.vgrow="ALWAYS" text="Send" contentDisplay="TOP" styleClass="list-item" maxHeight="Infinity" toggleGroup="$walletMenu">
<graphic>
<Glyph fontFamily="FontAwesome" icon="SEND" fontSize="20" />
</graphic>
<userData>
<Function fx:constant="SEND"/>
</userData>
</ToggleButton>
- <ToggleButton VBox.vgrow="ALWAYS" text="Receive" contentDisplay="TOP" styleClass="list-item" maxHeight="Infinity" toggleGroup="$walletMenu">
+ <ToggleButton accessibleRole="RADIO_BUTTON" VBox.vgrow="ALWAYS" text="Receive" contentDisplay="TOP" styleClass="list-item" maxHeight="Infinity" toggleGroup="$walletMenu">
<graphic>
<Glyph fontFamily="FontAwesome" icon="ARROW_DOWN" fontSize="20" />
</graphic>
<userData>
<Function fx:constant="RECEIVE"/>
</userData>
</ToggleButton>
- <ToggleButton VBox.vgrow="ALWAYS" text="Addresses" contentDisplay="TOP" styleClass="list-item" maxHeight="Infinity" toggleGroup="$walletMenu">
+ <ToggleButton accessibleRole="RADIO_BUTTON" VBox.vgrow="ALWAYS" text="Addresses" contentDisplay="TOP" styleClass="list-item" maxHeight="Infinity" toggleGroup="$walletMenu">
<graphic>
<Glyph fontFamily="FontAwesome" icon="TH_LIST" fontSize="20" />
</graphic>
<userData>
<Function fx:constant="ADDRESSES"/>
</userData>
</ToggleButton>
- <ToggleButton VBox.vgrow="ALWAYS" text="UTXOs" contentDisplay="TOP" styleClass="list-item" maxHeight="Infinity" toggleGroup="$walletMenu">
+ <ToggleButton accessibleRole="RADIO_BUTTON" VBox.vgrow="ALWAYS" text="UTXOs" contentDisplay="TOP" styleClass="list-item" maxHeight="Infinity" toggleGroup="$walletMenu">
<graphic>
<Glyph fontFamily="Font Awesome 5 Free Solid" icon="COINS" fontSize="20" />
</graphic>
<userData>
<Function fx:constant="UTXOS"/>
</userData>
</ToggleButton>
- <ToggleButton VBox.vgrow="ALWAYS" text="Settings" contentDisplay="TOP" styleClass="list-item" maxHeight="Infinity" toggleGroup="$walletMenu">
+ <ToggleButton accessibleRole="RADIO_BUTTON" VBox.vgrow="ALWAYS" text="Settings" contentDisplay="TOP" styleClass="list-item" maxHeight="Infinity" toggleGroup="$walletMenu">
<graphic>
<Glyph fontFamily="FontAwesome" icon="COG" fontSize="20" />
</graphic>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.