hide inactive wallet and transaction views so only the visible view is focusable
What changed, and why it matters
This commit changes the Sparrow Wallet desktop app so that wallet and transaction panes that are behind the currently visible pane are hidden from the user interface. The stated goal is to keep those background views out of keyboard focus traversal and the accessibility tree. In other words, it prevents a user (or assistive technology) from accidentally interacting with parts of the wallet screen that are not currently shown. The change is defensive and improves UI safety, but it does not by itself fix a demonstrated exploit.
Treat this as a low-risk UI-hardening change. Reviewers should verify that hiding background panes does not break legitimate accessibility workflows, that `showFrontView()` is called after every view-order change, and that the corrected LOCK condition behaves correctly when switching between locked and unlocked wallet states. No urgent security patch is indicated by the diff alone.
Security signals we found
UI focus-traversal hardening
Accessibility tree reduction for hidden wallet views
Defense-in-depth against interaction with obscured wallet controls
Correctness fix in LOCK-function visibility logic
Evidence from the diff
The patch adds setVisible(false) to inactive transaction-detail panes and introduces a showFrontView() helper in WalletController that iterates walletPane.getChildren(), determines the node with the lowest viewOrder, and sets only that node to visible=true while hiding the rest. The inline comment explicitly says the intent is to keep hidden views out of keyboard focus traversal and the accessibility tree. A small logic correction is also made: the condition for skipping the LOCK function now checks the existing pane’s user data (walletFunction.getUserData() != Function.LOCK) rather than the target function, which is a related correctness fix.
Changed components
src/main/java/com/sparrowwallet/sparrow/transaction/TransactionController.javasrc/main/java/com/sparrowwallet/sparrow/wallet/WalletController.javaInspect captured patch +21 / −1
### src/main/java/com/sparrowwallet/sparrow/transaction/TransactionController.java
@@ -262,8 +262,10 @@ protected void updateItem(TransactionForm form, boolean empty) {
if(transactionForm == childForm) {
detailPane = txdetail;
txdetail.setViewOrder(0);
+ txdetail.setVisible(true);
} else {
txdetail.setViewOrder(1);
+ txdetail.setVisible(false);
}
}
### src/main/java/com/sparrowwallet/sparrow/wallet/WalletController.java
@@ -86,7 +86,7 @@ public void initializeView() {
if(walletFunction.getUserData().equals(function)) {
existing = true;
walletFunction.setViewOrder(0);
- } else if(function != Function.LOCK) {
+ } else if(walletFunction.getUserData() != Function.LOCK) {
walletFunction.setViewOrder(1);
}
}
@@ -116,6 +116,8 @@ public void initializeView() {
} catch (IOException e) {
throw new IllegalStateException("Can't find pane", e);
}
+
+ showFrontView();
});
for(Toggle toggle : walletMenu.getToggles()) {
@@ -256,6 +258,7 @@ public void walletLock(WalletLockEvent event) {
getWalletForm().setLocked(true);
lockPane.setViewOrder(-1);
+ showFrontView();
lockCount++;
}
}
@@ -266,7 +269,22 @@ public void walletUnlock(WalletUnlockEvent event) {
getWalletForm().setLocked(false);
if(lockPane != null) {
lockPane.setViewOrder(2);
+ showFrontView();
}
}
}
+
+ //Views behind the front one are hidden so they stay out of keyboard focus traversal and the accessibility tree
+ private void showFrontView() {
+ Node front = null;
+ for(Node view : walletPane.getChildren()) {
+ if(front == null || view.getViewOrder() <= front.getViewOrder()) {
+ front = view;
+ }
+ }
+
+ for(Node view : walletPane.getChildren()) {
+ view.setVisible(view == front);
+ }
+ }
}Why this scored 38/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.