expose help icon text to screen readers instead of an empty glyph
What changed, and why it matters
This commit improves accessibility for users who rely on screen readers. It makes the small question-mark help icons in the Sparrow Wallet interface readable aloud, and fixes a typo in one help message ('Segwit the type' → 'Segwit is the type'). There is no security vulnerability here.
No security action required. This is an accessibility/usability improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change binds the HelpLabel’s accessibleTextProperty to its helpTextProperty so assistive technologies receive the help text instead of an empty glyph label. It also overrides queryAccessibleAttribute(AccessibleAttribute.CHILDREN) to return an empty list, preventing the icon glyph from being exposed as a child node to accessibility APIs. The FXML change is a grammar correction only.
Changed components
src/main/java/com/sparrowwallet/sparrow/control/HelpLabel.javasrc/main/resources/com/sparrowwallet/sparrow/wallet/settings.fxmlInspect captured patch +13 / −1
### src/main/java/com/sparrowwallet/sparrow/control/HelpLabel.java
@@ -2,10 +2,12 @@
import com.sparrowwallet.sparrow.glyphfont.FontAwesome5;
import javafx.application.Platform;
+import javafx.collections.FXCollections;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
+import javafx.scene.AccessibleAttribute;
import javafx.scene.Node;
import javafx.scene.control.Label;
import javafx.scene.control.Tooltip;
@@ -23,10 +25,20 @@ public HelpLabel() {
tooltip.setShowDuration(Duration.seconds(15));
tooltip.setShowDelay(Duration.millis(500));
getStyleClass().add("help-label");
+ accessibleTextProperty().bind(helpTextProperty());
Platform.runLater(() -> setTooltip(tooltip));
}
+ @Override
+ public Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters) {
+ if(attribute == AccessibleAttribute.CHILDREN) {
+ return FXCollections.emptyObservableList();
+ }
+
+ return super.queryAccessibleAttribute(attribute, parameters);
+ }
+
private static Glyph getHelpGlyph() {
Glyph glyph = new Glyph("Font Awesome 5 Free Solid", FontAwesome5.Glyph.QUESTION_CIRCLE);
glyph.getStyleClass().add("help-icon");
### src/main/resources/com/sparrowwallet/sparrow/wallet/settings.fxml
@@ -57,7 +57,7 @@
</FXCollections>
</items>
</ComboBox>
- <HelpLabel helpText="Native Segwit the type chosen for most new wallets.\nTaproot is a newer type useful for specific needs.\nNested Segwit and Legacy are useful for recovering older wallets.\nFor existing wallets, be sure to choose the type that matches the wallet you are restoring." />
+ <HelpLabel helpText="Native Segwit is the type chosen for most new wallets.\nTaproot is a newer type useful for specific needs.\nNested Segwit and Legacy are useful for recovering older wallets.\nFor existing wallets, be sure to choose the type that matches the wallet you are restoring." />
</Field>
</Fieldset>
</Form>Why this scored 20/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.