add a view > go to menu with shortcut+1 to 6 to select the wallet function and focus its menu button
What changed, and why it matters
This commit adds a new 'View > Go To' menu and keyboard shortcuts (Ctrl/Cmd+1 through 6) that let users quickly jump between wallet sections like Transactions, Send, Receive, Addresses, UTXOs, and Settings. It is a pure user-interface convenience feature with no security implications.
No security action required; this is a routine UI/UX enhancement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change introduces a FunctionShortcutEvent event class, wires a new ‘Go To’ submenu in app.fxml with accelerators Shortcut+1 to Shortcut+6, and adds handlers in AppController and WalletController to select the corresponding wallet function toggle button and move focus to it. The menu items are disabled when no wallet is active, mirroring existing wallet-dependent menu items. No cryptographic, network, or data-handling code is modified.
Changed components
AppController.javaWalletController.javaFunctionShortcutEvent.javaapp.fxmlInspect captured patch +51 / −0
### src/main/java/com/sparrowwallet/sparrow/AppController.java
@@ -30,6 +30,7 @@
import com.sparrowwallet.sparrow.transaction.TransactionData;
import com.sparrowwallet.sparrow.transaction.TransactionView;
import com.sparrowwallet.sparrow.wallet.Entry;
+import com.sparrowwallet.sparrow.wallet.Function;
import com.sparrowwallet.sparrow.wallet.WalletController;
import com.sparrowwallet.sparrow.wallet.WalletForm;
import de.jangassen.MenuToolkit;
@@ -194,6 +195,9 @@ public class AppController implements Initializable {
@FXML
private MenuItem refreshWallet;
+ @FXML
+ private Menu goToMenu;
+
@FXML
private MenuItem sendToMany;
@@ -442,6 +446,7 @@ void initializeView() {
searchWallet.disableProperty().bind(exportWallet.disableProperty());
refreshWallet.disableProperty().bind(Bindings.or(exportWallet.disableProperty(), Bindings.or(serverToggle.disableProperty(), AppServices.onlineProperty().not())));
sendToMany.disableProperty().bind(exportWallet.disableProperty());
+ goToMenu.getItems().forEach(item -> item.disableProperty().bind(exportWallet.disableProperty()));
sweepPrivateKey.disableProperty().bind(Bindings.or(serverToggle.disableProperty(), AppServices.onlineProperty().not()));
showPayNym.setDisable(true);
@@ -1709,6 +1714,14 @@ public void showAllWalletsSummary(ActionEvent event) {
}
}
+ //Go To and its shortcuts select a wallet function without tabbing back through the current one
+ public void goToFunction(ActionEvent event) {
+ WalletForm selectedWalletForm = getSelectedWalletForm();
+ if(selectedWalletForm != null && event.getSource() instanceof MenuItem item) {
+ EventManager.get().post(new FunctionShortcutEvent(Function.valueOf((String)item.getUserData()), selectedWalletForm.getWallet()));
+ }
+ }
+
public void showWalletSummary(ActionEvent event) {
Tab selectedTab = tabs.getSelectionModel().getSelectedItem();
if(selectedTab != null) {
### src/main/java/com/sparrowwallet/sparrow/event/FunctionShortcutEvent.java
@@ -0,0 +1,18 @@
+package com.sparrowwallet.sparrow.event;
+
+import com.sparrowwallet.drongo.wallet.Wallet;
+import com.sparrowwallet.sparrow.wallet.Function;
+
+/**
+ * Selects a wallet function from View > Go To or its shortcut, and moves focus to the function's button in the wallet's menu
+ */
+public class FunctionShortcutEvent extends FunctionActionEvent {
+ public FunctionShortcutEvent(Function function, Wallet wallet) {
+ super(function, wallet);
+ }
+
+ @Override
+ public boolean selectFunction() {
+ return false;
+ }
+}
### src/main/java/com/sparrowwallet/sparrow/wallet/WalletController.java
@@ -248,6 +248,18 @@ public void functionAction(FunctionActionEvent event) {
}
}
+ @Subscribe
+ public void functionShortcut(FunctionShortcutEvent event) {
+ if(event.getWallet().equals(walletForm.getWallet()) && walletMenuBox.isVisible()) {
+ for(Toggle toggle : walletMenu.getToggles()) {
+ if(toggle.getUserData().equals(event.getFunction()) && toggle instanceof ToggleButton toggleButton && toggleButton.isVisible() && !toggleButton.isDisabled()) {
+ toggleButton.setSelected(true);
+ toggleButton.requestFocus();
+ }
+ }
+ }
+ }
+
@Subscribe
public void walletLock(WalletLockEvent event) {
if(event.getWallet().equals(walletForm.getMasterWallet())) {
### src/main/resources/com/sparrowwallet/sparrow/app.fxml
@@ -144,6 +144,14 @@
<MenuItem fx:id="showWalletSummary" mnemonicParsing="false" text="Show Wallet Summary" onAction="#showWalletSummary"/>
<MenuItem fx:id="showAllWalletsSummary" mnemonicParsing="false" text="Show All Wallets Summary" onAction="#showAllWalletsSummary"/>
<SeparatorMenuItem />
+ <Menu fx:id="goToMenu" mnemonicParsing="false" text="Go To">
+ <MenuItem mnemonicParsing="false" text="Transactions" accelerator="Shortcut+1" userData="TRANSACTIONS" onAction="#goToFunction"/>
+ <MenuItem mnemonicParsing="false" text="Send" accelerator="Shortcut+2" userData="SEND" onAction="#goToFunction"/>
+ <MenuItem mnemonicParsing="false" text="Receive" accelerator="Shortcut+3" userData="RECEIVE" onAction="#goToFunction"/>
+ <MenuItem mnemonicParsing="false" text="Addresses" accelerator="Shortcut+4" userData="ADDRESSES" onAction="#goToFunction"/>
+ <MenuItem mnemonicParsing="false" text="UTXOs" accelerator="Shortcut+5" userData="UTXOS" onAction="#goToFunction"/>
+ <MenuItem mnemonicParsing="false" text="Settings" accelerator="Shortcut+6" userData="SETTINGS" onAction="#goToFunction"/>
+ </Menu>
<MenuItem fx:id="refreshWallet" mnemonicParsing="false" text="Refresh Wallet" accelerator="Shortcut+R" onAction="#refreshWallet"/>
</items>
</Menu>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.