add view menu item to toggle address chunk display formatting
What changed, and why it matters
This commit adds a new user preference in the Sparrow Wallet View menu that lets users turn Bitcoin address chunking (visual grouping of address characters) on or off. It also moves the existing 'Hide Empty Used Addresses' option into a new 'Bitcoin Addresses' submenu. There is no security-relevant change here—only a cosmetic UI feature and menu reorganization.
No security action required. This is a routine UI/UX feature commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch introduces a new boolean config field chunkAddresses (default true) with getter/setter in Config.java, a CheckMenuItem in app.fxml under a new ‘Bitcoin Addresses’ menu, an event handler chunkAddresses() in AppController.java that toggles a ‘chunk-addresses’ CSS class on rootStack, and CSS selector updates in general.css/darktheme.css so address-chunk styling is only applied when the class is present. The hideEmptyUsedAddresses menu item is relocated into the same new submenu. No cryptographic, network, or data-handling code is modified.
Changed components
AppController.javaConfig.javaapp.fxmldarktheme.cssgeneral.cssInspect captured patch +53 / −14
diff --git a/src/main/java/com/sparrowwallet/sparrow/AppController.java b/src/main/java/com/sparrowwallet/sparrow/AppController.java
index 9a52fc3..00ab0af 100644
--- a/src/main/java/com/sparrowwallet/sparrow/AppController.java
+++ b/src/main/java/com/sparrowwallet/sparrow/AppController.java
@@ -138,6 +138,13 @@ public class AppController implements Initializable {
@FXML
private ToggleGroup unitFormat;
+ @FXML
+ private CheckMenuItem chunkAddresses;
+
+ @FXML
+ private CheckMenuItem hideEmptyUsedAddresses;
+ private static final BooleanProperty hideEmptyUsedAddressesProperty = new SimpleBooleanProperty();
+
@FXML
private ToggleGroup theme;
@@ -145,10 +152,6 @@ public class AppController implements Initializable {
private CheckMenuItem openWalletsInNewWindows;
private static final BooleanProperty openWalletsInNewWindowsProperty = new SimpleBooleanProperty();
- @FXML
- private CheckMenuItem hideEmptyUsedAddresses;
- private static final BooleanProperty hideEmptyUsedAddressesProperty = new SimpleBooleanProperty();
-
@FXML
private CheckMenuItem hideAmounts;
@@ -373,6 +376,13 @@ public class AppController implements Initializable {
Optional<Toggle> selectedFormatToggle = unitFormat.getToggles().stream().filter(toggle -> selectedFormat.equals(toggle.getUserData())).findFirst();
selectedFormatToggle.ifPresent(toggle -> unitFormat.selectToggle(toggle));
+ chunkAddresses.setSelected(Config.get().isChunkAddresses());
+ if(Config.get().isChunkAddresses()) {
+ rootStack.getStyleClass().add("chunk-addresses");
+ }
+ hideEmptyUsedAddressesProperty.set(Config.get().isHideEmptyUsedAddresses());
+ hideEmptyUsedAddresses.selectedProperty().bindBidirectional(hideEmptyUsedAddressesProperty);
+
Theme configTheme = Config.get().getTheme();
if(configTheme == null) {
configTheme = Theme.LIGHT;
@@ -385,8 +395,6 @@ public class AppController implements Initializable {
openWalletsInNewWindowsProperty.set(Config.get().isOpenWalletsInNewWindows());
openWalletsInNewWindows.selectedProperty().bindBidirectional(openWalletsInNewWindowsProperty);
- hideEmptyUsedAddressesProperty.set(Config.get().isHideEmptyUsedAddresses());
- hideEmptyUsedAddresses.selectedProperty().bindBidirectional(hideEmptyUsedAddressesProperty);
hideAmounts.setSelected(Config.get().isHideAmounts());
useHdCameraResolutionProperty.set(Config.get().getWebcamResolution() == null || Config.get().getWebcamResolution().isWidescreenAspect());
useHdCameraResolution.selectedProperty().bindBidirectional(useHdCameraResolutionProperty);
@@ -946,6 +954,16 @@ public class AppController implements Initializable {
EventManager.get().post(new OpenWalletsNewWindowsStatusEvent(item.isSelected()));
}
+ public void chunkAddresses(ActionEvent event) {
+ CheckMenuItem item = (CheckMenuItem)event.getSource();
+ Config.get().setChunkAddresses(item.isSelected());
+ if(item.isSelected() && !rootStack.getStyleClass().contains("chunk-addresses")) {
+ rootStack.getStyleClass().add("chunk-addresses");
+ } else {
+ rootStack.getStyleClass().remove("chunk-addresses");
+ }
+ }
+
public void hideEmptyUsedAddresses(ActionEvent event) {
CheckMenuItem item = (CheckMenuItem)event.getSource();
Config.get().setHideEmptyUsedAddresses(item.isSelected());
diff --git a/src/main/java/com/sparrowwallet/sparrow/io/Config.java b/src/main/java/com/sparrowwallet/sparrow/io/Config.java
index 06dda95..2f9e2ad 100644
--- a/src/main/java/com/sparrowwallet/sparrow/io/Config.java
+++ b/src/main/java/com/sparrowwallet/sparrow/io/Config.java
@@ -47,6 +47,7 @@ public class Config {
private boolean checkNewVersions = true;
private Theme theme;
private boolean openWalletsInNewWindows = false;
+ private boolean chunkAddresses = true;
private boolean hideEmptyUsedAddresses = false;
private boolean hideAmounts = false;
private boolean showTransactionHex = true;
@@ -297,6 +298,15 @@ public class Config {
flush();
}
+ public boolean isChunkAddresses() {
+ return chunkAddresses;
+ }
+
+ public void setChunkAddresses(boolean chunkAddresses) {
+ this.chunkAddresses = chunkAddresses;
+ flush();
+ }
+
public boolean isHideEmptyUsedAddresses() {
return hideEmptyUsedAddresses;
}
diff --git a/src/main/resources/com/sparrowwallet/sparrow/app.fxml b/src/main/resources/com/sparrowwallet/sparrow/app.fxml
index ba58bf4..890a573 100644
--- a/src/main/resources/com/sparrowwallet/sparrow/app.fxml
+++ b/src/main/resources/com/sparrowwallet/sparrow/app.fxml
@@ -99,6 +99,12 @@
</RadioMenuItem>
</items>
</Menu>
+ <Menu mnemonicParsing="false" text="Bitcoin Addresses">
+ <items>
+ <CheckMenuItem fx:id="chunkAddresses" mnemonicParsing="false" text="Chunk Addresses" onAction="#chunkAddresses"/>
+ <CheckMenuItem fx:id="hideEmptyUsedAddresses" mnemonicParsing="false" text="Hide Empty Used Addresses" onAction="#hideEmptyUsedAddresses"/>
+ </items>
+ </Menu>
<Menu mnemonicParsing="false" text="Theme">
<items>
<RadioMenuItem mnemonicParsing="false" text="Light" toggleGroup="$theme" onAction="#setTheme">
@@ -119,7 +125,6 @@
</Menu>
<SeparatorMenuItem />
<CheckMenuItem fx:id="openWalletsInNewWindows" mnemonicParsing="false" text="Open Wallets In New Windows" onAction="#openWalletsInNewWindows"/>
- <CheckMenuItem fx:id="hideEmptyUsedAddresses" mnemonicParsing="false" text="Hide Empty Used Addresses" onAction="#hideEmptyUsedAddresses"/>
<CheckMenuItem fx:id="hideAmounts" mnemonicParsing="false" text="Hide Amounts" accelerator="Shortcut+Shift+H" onAction="#hideAmounts"/>
<CheckMenuItem fx:id="showLoadingLog" mnemonicParsing="false" text="Show Wallet Loading Log" onAction="#showLoadingLog" />
<CheckMenuItem fx:id="showTxHex" mnemonicParsing="false" text="Show Transaction Hex" onAction="#showTxHex"/>
diff --git a/src/main/resources/com/sparrowwallet/sparrow/darktheme.css b/src/main/resources/com/sparrowwallet/sparrow/darktheme.css
index 111c40d..afa9d3c 100644
--- a/src/main/resources/com/sparrowwallet/sparrow/darktheme.css
+++ b/src/main/resources/com/sparrowwallet/sparrow/darktheme.css
@@ -382,14 +382,18 @@ HorizontalHeaderColumn > TableColumnHeader.column-header.table-column{
-fx-fill: lightgray;
}
-.root .tree-table-view .address-chunk, .root .text-field .address-chunk, .root .tooltip .address-chunk {
+.root .tree-table-view .address-chunk,
+.root .text-field .address-chunk,
+.root .tooltip .address-chunk {
-fx-fill: white;
}
-.root .text-field .address-chunk.alternate, .root .label .address-chunk.alternate, .root .tree-table-view:focused .address-chunk.alternate {
+.root #rootStack.chunk-addresses .text-field .address-chunk.alternate,
+.root #rootStack.chunk-addresses .label .address-chunk.alternate,
+.root #rootStack.chunk-addresses .tree-table-view:focused .address-chunk.alternate {
-fx-fill: derive(-fx-text-inner-color, -35%);
}
-.root .tree-table-view .tree-table-row-cell:selected .address-chunk.alternate {
+.root #rootStack.chunk-addresses .tree-table-view .tree-table-row-cell:selected .address-chunk.alternate {
-fx-fill: derive(-fx-selection-bar-text, -35%);
}
diff --git a/src/main/resources/com/sparrowwallet/sparrow/general.css b/src/main/resources/com/sparrowwallet/sparrow/general.css
index 09dbe4e..edcbd07 100644
--- a/src/main/resources/com/sparrowwallet/sparrow/general.css
+++ b/src/main/resources/com/sparrowwallet/sparrow/general.css
@@ -350,18 +350,20 @@ CellView > .text-input.text-field {
-fx-fill: white;
}
-.text-field .address-chunk.alternate, .label .address-chunk.alternate, .tree-table-view:focused .address-chunk.alternate {
+#rootStack.chunk-addresses .text-field .address-chunk.alternate,
+#rootStack.chunk-addresses .label .address-chunk.alternate,
+#rootStack.chunk-addresses .tree-table-view:focused .address-chunk.alternate {
-fx-fill: derive(-fx-text-inner-color, 70%);
}
-.tooltip .address-chunk.alternate {
+#rootStack.chunk-addresses .tooltip .address-chunk.alternate {
-fx-fill: derive(gray, 60%);
}
-.tree-table-view:focused .tree-table-row-cell:selected .address-chunk.alternate {
+#rootStack.chunk-addresses .tree-table-view:focused .tree-table-row-cell:selected .address-chunk.alternate {
-fx-fill: derive(-fx-selection-bar-text, -15%);
}
-.tree-table-view .tree-table-row-cell:selected .address-chunk.alternate {
+#rootStack.chunk-addresses .tree-table-view .tree-table-row-cell:selected .address-chunk.alternate {
-fx-fill: derive(-fx-selection-bar-text, 60%);
}
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.