tell screen readers when the selected tab changes so only the open tab reads as selected
What changed, and why it matters
This commit fixes an accessibility bug for screen-reader users. In the Sparrow Wallet app, switching tabs did not properly tell assistive technology (such as macOS VoiceOver) which tab was currently active, so a screen reader would incorrectly announce every previously selected tab as still selected. The change adds a small custom skin that notifies the accessibility system whenever the selected tab changes, and applies it to all tab panes in the app. There is no security relevance in this change.
No security action needed. Treat as a normal accessibility/usability fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
A new JavaFX skin class SelectedTabSkin extends TabPaneSkin and registers a change listener on the TabPane selection model. When the selected tab changes, it iterates the skin’s children, finds the tab-header-area, and calls notifyAccessibleAttributeChanged(AccessibleAttribute.SELECTED) on every .tab node. This forces JavaFX to update the accessible SELECTED attribute for each tab header, correcting VoiceOver’s stale state. The skin is then wired in app.css via -fx-skin on .tab-pane so all tab panes use it.
Changed components
src/main/java/com/sparrowwallet/sparrow/control/SelectedTabSkin.javasrc/main/resources/com/sparrowwallet/sparrow/app.cssInspect captured patch +27 / −0
### src/main/java/com/sparrowwallet/sparrow/control/SelectedTabSkin.java
@@ -0,0 +1,23 @@
+package com.sparrowwallet.sparrow.control;
+
+import javafx.scene.AccessibleAttribute;
+import javafx.scene.Node;
+import javafx.scene.control.TabPane;
+import javafx.scene.control.skin.TabPaneSkin;
+
+/**
+ * Tab pane skin that tells screen readers when the selected tab changes. JavaFX only notifies the tab pane, so VoiceOver keeps reading
+ * every tab it has seen selected as selected. Applied to every tab pane with -fx-skin in app.css.
+ */
+public class SelectedTabSkin extends TabPaneSkin {
+ public SelectedTabSkin(TabPane tabPane) {
+ super(tabPane);
+ registerChangeListener(tabPane.getSelectionModel().selectedItemProperty(), _ -> {
+ for(Node child : getChildren()) {
+ if(child.getStyleClass().contains("tab-header-area")) {
+ child.lookupAll(".tab").forEach(header -> header.notifyAccessibleAttributeChanged(AccessibleAttribute.SELECTED));
+ }
+ }
+ });
+ }
+}
### src/main/resources/com/sparrowwallet/sparrow/app.css
@@ -1,3 +1,7 @@
+.tab-pane {
+ -fx-skin: "com.sparrowwallet.sparrow.control.SelectedTabSkin";
+}
+
.background-box {
-fx-stroke: #a0a1a7;
-fx-stroke-width: 1px;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.