give dialogs titles and keep focus on the new tab or button after creating a transaction or keystore
What changed, and why it matters
This commit is a user-experience polish change for the Sparrow Wallet desktop app. It adds visible titles to many popup windows and shifts keyboard focus to the newly opened tab or button after creating a transaction or importing a keystore. There is no direct security fix here, but better focus handling can reduce accidental user mistakes (for example, pressing Enter/Space on the wrong control) and titled dialogs help screen readers and users identify windows correctly.
Treat as a routine UX/accessibility improvement. No security patching urgency, but verify that focus changes do not skip any intended confirmation step in the keystore import flow during normal QA.
Security signals we found
Focus management improvement reduces accidental input on stale controls
Dialog titling improves window identification and assistive-technology behavior
No changes to cryptography, networking, authentication, or storage
Evidence from the diff
The diff adds setTitle(…) calls to 24 JavaFX Dialog subclasses and two requestFocus() calls. In AppController, after a new transaction tab is opened, Platform.runLater(tabs::requestFocus) moves focus from the status bar to the new tab. In MnemonicKeystoreImportPane, MnemonicShareKeystoreImportPane and CodexKeystoreImportPane, importButton.requestFocus() moves focus to the import button once the derivation entry replaces the create button. These are accessibility/usability improvements; no cryptographic, network, or privilege logic is changed.
Changed components
AppController transaction tab creationWelcomeDialogCodexKeystoreImportPaneDescriptorQRDisplayDialogDeviceDisplayAddressDialogDeviceGetAddressDialogDeviceKeystoreDiscoverDialogDeviceSignDialogDeviceSignMessageDialogDeviceUnsealDialogKeystoreExportDialogMasterKeyDisplayDialogMnemonicKeystoreImportPaneMnemonicShareKeystoreImportPanePrivateKeySweepDialogQRDisplayDialogQRScanDialogSeedDisplayDialogSeedEntryDialogWalletExportDialogWalletImportDialogWalletSummaryDialogKeystoreImportDialogPayNymAddressesDialogPayNymDialogAdvancedDialogInspect captured patch +31 / −0
### src/main/java/com/sparrowwallet/sparrow/AppController.java
@@ -2168,6 +2168,8 @@ private void addTransactionTab(String name, File file, Transaction transaction,
tabs.getTabs().add(tab);
tabs.getSelectionModel().select(tab);
+ //The view the transaction was opened from is hidden, so focus goes to the new tab rather than falling to the status bar
+ Platform.runLater(tabs::requestFocus);
} catch(IOException e) {
throw new RuntimeException(e);
}
### src/main/java/com/sparrowwallet/sparrow/WelcomeDialog.java
@@ -12,6 +12,7 @@ public class WelcomeDialog extends Dialog<Mode> {
public WelcomeDialog() {
final DialogPane dialogPane = getDialogPane();
AppServices.setStageIcon(dialogPane.getScene().getWindow());
+ setTitle("Welcome to Sparrow");
AppServices.onEscapePressed(dialogPane.getScene(), this::close);
try {
### src/main/java/com/sparrowwallet/sparrow/control/CodexKeystoreImportPane.java
@@ -199,6 +199,8 @@ private Node getSecretShareEntry() {
showHideLink.setText("Show Derivation...");
showHideLink.setVisible(false);
setContent(getDerivationEntry(getDefaultDerivation()));
+ //The create button goes with the replaced content, so focus moves on to the import button that replaces it
+ importButton.requestFocus();
});
rightBox.getChildren().add(calculateButton);
### src/main/java/com/sparrowwallet/sparrow/control/DescriptorQRDisplayDialog.java
@@ -11,6 +11,7 @@
public class DescriptorQRDisplayDialog extends QRDisplayDialog {
public DescriptorQRDisplayDialog(String walletName, String outputDescriptor, UR ur, BBQR bbqr, QREncoding encoding) {
super(ur, bbqr, false, false, encoding);
+ setTitle("Wallet Descriptor");
DialogPane dialogPane = getDialogPane();
final ButtonType pdfButtonType = new javafx.scene.control.ButtonType("Save PDF...", ButtonBar.ButtonData.HELP_2);
### src/main/java/com/sparrowwallet/sparrow/control/DeviceDisplayAddressDialog.java
@@ -15,6 +15,7 @@ public class DeviceDisplayAddressDialog extends DeviceDialog<String> {
public DeviceDisplayAddressDialog(Wallet wallet, OutputDescriptor outputDescriptor) {
super(outputDescriptor.getExtendedPublicKeys().stream().map(extKey -> outputDescriptor.getKeyDerivation(extKey).getMasterFingerprint()).collect(Collectors.toList()));
+ setTitle("Display Address");
this.wallet = wallet;
this.outputDescriptor = outputDescriptor;
### src/main/java/com/sparrowwallet/sparrow/control/DeviceGetAddressDialog.java
@@ -11,6 +11,7 @@
public class DeviceGetAddressDialog extends DeviceDialog<Address> {
public DeviceGetAddressDialog(List<String> operationFingerprints) {
super(operationFingerprints);
+ setTitle("Get Address");
EventManager.get().register(this);
setOnCloseRequest(event -> {
EventManager.get().unregister(this);
### src/main/java/com/sparrowwallet/sparrow/control/DeviceKeystoreDiscoverDialog.java
@@ -18,6 +18,7 @@ public class DeviceKeystoreDiscoverDialog extends DeviceDialog<Map<StandardAccou
public DeviceKeystoreDiscoverDialog(List<String> operationFingerprints, Wallet masterWallet, List<StandardAccount> availableAccounts) {
super(operationFingerprints);
+ setTitle("Discover Accounts");
this.masterWallet = masterWallet;
this.availableAccounts = availableAccounts;
EventManager.get().register(this);
### src/main/java/com/sparrowwallet/sparrow/control/DeviceSignDialog.java
@@ -19,6 +19,7 @@ public class DeviceSignDialog extends DeviceDialog<PSBT> {
public DeviceSignDialog(Wallet wallet, List<String> operationFingerprints, PSBT psbt) {
super(operationFingerprints);
+ setTitle("Sign Transaction");
this.wallet = wallet;
this.psbt = psbt;
EventManager.get().register(this);
### src/main/java/com/sparrowwallet/sparrow/control/DeviceSignMessageDialog.java
@@ -16,6 +16,7 @@ public class DeviceSignMessageDialog extends DeviceDialog<String> {
public DeviceSignMessageDialog(List<String> operationFingerprints, Wallet wallet, String message, KeyDerivation keyDerivation) {
super(operationFingerprints);
+ setTitle("Sign Message");
this.wallet = wallet;
this.message = message;
this.keyDerivation = keyDerivation;
### src/main/java/com/sparrowwallet/sparrow/control/DeviceUnsealDialog.java
@@ -12,6 +12,7 @@
public class DeviceUnsealDialog extends DeviceDialog<DeviceUnsealDialog.DevicePrivateKey> {
public DeviceUnsealDialog(List<String> operationFingerprints) {
super(operationFingerprints);
+ setTitle("Unseal Private Key");
EventManager.get().register(this);
setOnCloseRequest(event -> {
EventManager.get().unregister(this);
### src/main/java/com/sparrowwallet/sparrow/control/KeystoreExportDialog.java
@@ -22,6 +22,7 @@ public KeystoreExportDialog(Keystore keystore) {
final DialogPane dialogPane = getDialogPane();
AppServices.setStageIcon(dialogPane.getScene().getWindow());
+ setTitle("Export Keystore");
StackPane stackPane = new StackPane();
dialogPane.setContent(stackPane);
### src/main/java/com/sparrowwallet/sparrow/control/MasterKeyDisplayDialog.java
@@ -12,6 +12,7 @@ public MasterKeyDisplayDialog(Keystore decryptedKeystore) {
final DialogPane dialogPane = getDialogPane();
dialogPane.getStylesheets().add(AppServices.class.getResource("general.css").toExternalForm());
AppServices.setStageIcon(dialogPane.getScene().getWindow());
+ setTitle("Master Private Key");
StackPane stackPane = new StackPane();
dialogPane.setContent(stackPane);
### src/main/java/com/sparrowwallet/sparrow/control/MnemonicKeystoreImportPane.java
@@ -254,6 +254,8 @@ private void prepareImport() {
showHideLink.setText("Show Derivation...");
showHideLink.setVisible(false);
setContent(getDerivationEntry(getDefaultDerivation()));
+ //The create button goes with the replaced content, so focus moves on to the import button that replaces it
+ importButton.requestFocus();
}
}
### src/main/java/com/sparrowwallet/sparrow/control/MnemonicShareKeystoreImportPane.java
@@ -238,6 +238,8 @@ private void prepareImport() {
showHideLink.setText("Show Derivation...");
showHideLink.setVisible(false);
setContent(getDerivationEntry(getDefaultDerivation()));
+ //The create button goes with the replaced content, so focus moves on to the import button that replaces it
+ importButton.requestFocus();
}
}
### src/main/java/com/sparrowwallet/sparrow/control/PrivateKeySweepDialog.java
@@ -77,6 +77,7 @@ public PrivateKeySweepDialog(Wallet wallet) {
dialogPane.getStylesheets().add(AppServices.class.getResource("general.css").toExternalForm());
dialogPane.getStylesheets().add(AppServices.class.getResource("dialog.css").toExternalForm());
AppServices.setStageIcon(dialogPane.getScene().getWindow());
+ setTitle("Sweep Private Key");
dialogPane.setHeaderText("Sweep Private Key");
dialogPane.setGraphic(new WalletModelImage(WalletModel.SEED));
### src/main/java/com/sparrowwallet/sparrow/control/QRDisplayDialog.java
@@ -117,6 +117,7 @@ public QRDisplayDialog(UR ur, BBQR bbqr, String raw, boolean addLegacyEncodingOp
final DialogPane dialogPane = new QRDisplayDialogPane();
setDialogPane(dialogPane);
AppServices.setStageIcon(dialogPane.getScene().getWindow());
+ setTitle("QR Code");
StackPane stackPane = new StackPane();
qrImageView = new ImageView();
@@ -190,6 +191,7 @@ public QRDisplayDialog(String data, boolean addScanButton) {
final DialogPane dialogPane = new QRDisplayDialogPane();
setDialogPane(dialogPane);
AppServices.setStageIcon(dialogPane.getScene().getWindow());
+ setTitle("QR Code");
StackPane stackPane = new StackPane();
qrImageView = new ImageView();
### src/main/java/com/sparrowwallet/sparrow/control/QRScanDialog.java
@@ -103,6 +103,7 @@ public QRScanDialog() {
final DialogPane dialogPane = new QRScanDialogPane();
setDialogPane(dialogPane);
AppServices.setStageIcon(dialogPane.getScene().getWindow());
+ setTitle("Scan QR Code");
WebcamView webcamView = new WebcamView(webcamService, Config.get().isMirrorCapture());
### src/main/java/com/sparrowwallet/sparrow/control/SeedDisplayDialog.java
@@ -17,6 +17,7 @@ public SeedDisplayDialog(Keystore decryptedKeystore) {
final DialogPane dialogPane = getDialogPane();
dialogPane.getStylesheets().add(AppServices.class.getResource("general.css").toExternalForm());
AppServices.setStageIcon(dialogPane.getScene().getWindow());
+ setTitle("Seed Words");
int lines = Math.ceilDiv(decryptedKeystore.getSeed().getMnemonicCode().size(), 3);
int height = lines * 40;
### src/main/java/com/sparrowwallet/sparrow/control/SeedEntryDialog.java
@@ -17,6 +17,7 @@ public SeedEntryDialog(String name, int numWords) {
setDialogPane(dialogPane);
dialogPane.getStylesheets().add(AppServices.class.getResource("general.css").toExternalForm());
AppServices.setStageIcon(dialogPane.getScene().getWindow());
+ setTitle(name);
int lines = numWords / 3;
int height = lines * 40;
### src/main/java/com/sparrowwallet/sparrow/control/WalletExportDialog.java
@@ -28,6 +28,7 @@ public WalletExportDialog(WalletForm selectedWalletForm, List<WalletForm> allWal
final DialogPane dialogPane = getDialogPane();
AppServices.setStageIcon(dialogPane.getScene().getWindow());
+ setTitle("Export Wallet");
StackPane stackPane = new StackPane();
dialogPane.setContent(stackPane);
### src/main/java/com/sparrowwallet/sparrow/control/WalletImportDialog.java
@@ -35,6 +35,7 @@ public WalletImportDialog(List<WalletForm> selectedWalletForms) {
final DialogPane dialogPane = getDialogPane();
dialogPane.getStylesheets().add(AppServices.class.getResource("general.css").toExternalForm());
AppServices.setStageIcon(dialogPane.getScene().getWindow());
+ setTitle("Import Wallet");
StackPane stackPane = new StackPane();
dialogPane.setContent(stackPane);
### src/main/java/com/sparrowwallet/sparrow/control/WalletSummaryDialog.java
@@ -43,6 +43,7 @@ public WalletSummaryDialog(List<List<WalletForm>> summaryWalletFormsList) {
dialogPane.getStylesheets().add(AppServices.class.getResource("wallet/transactions.css").toExternalForm());
AppServices.setStageIcon(dialogPane.getScene().getWindow());
+ setTitle("Wallet Summary");
dialogPane.setHeaderText("Wallet Summary for " + (allOpenWallets ? "All Open Wallets" : masterWallets.get(0).getName()));
dialogPane.setGraphic(new DialogImage(DialogImage.Type.SPARROW));
### src/main/java/com/sparrowwallet/sparrow/keystoreimport/KeystoreImportDialog.java
@@ -33,6 +33,7 @@ public KeystoreImportDialog(Wallet wallet, KeystoreSource initialSource, KeyDeri
final DialogPane dialogPane = getDialogPane();
AppServices.setStageIcon(dialogPane.getScene().getWindow());
+ setTitle("Import Keystore");
scriptType = wallet.getScriptType();
existingLabel = currentLabel;
### src/main/java/com/sparrowwallet/sparrow/paynym/PayNymAddressesDialog.java
@@ -15,6 +15,7 @@ public class PayNymAddressesDialog extends Dialog<Boolean> {
public PayNymAddressesDialog(WalletForm walletForm) {
final DialogPane dialogPane = getDialogPane();
AppServices.setStageIcon(dialogPane.getScene().getWindow());
+ setTitle("PayNym Addresses");
AppServices.onEscapePressed(dialogPane.getScene(), this::close);
try {
### src/main/java/com/sparrowwallet/sparrow/paynym/PayNymDialog.java
@@ -15,6 +15,7 @@ public PayNymDialog(String walletId) {
public PayNymDialog(String walletId, Operation operation) {
final DialogPane dialogPane = getDialogPane();
AppServices.setStageIcon(dialogPane.getScene().getWindow());
+ setTitle("PayNym");
AppServices.onEscapePressed(dialogPane.getScene(), this::close);
try {
### src/main/java/com/sparrowwallet/sparrow/wallet/AdvancedDialog.java
@@ -16,6 +16,7 @@ public class AdvancedDialog extends Dialog<Boolean> {
public AdvancedDialog(WalletForm walletForm) {
final DialogPane dialogPane = getDialogPane();
AppServices.setStageIcon(dialogPane.getScene().getWindow());
+ setTitle("Advanced Settings");
Wallet wallet = walletForm.getWallet();
try {Why this scored 17/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.