qml: FeePicker: use UI_UNIT_NAME constants, instead of hardcoding
What changed, and why it matters
This commit is a minor code cleanup in Electrum's mobile-style QML user interface. It replaces two hardcoded text labels ('sat/vbyte' and 'sat') with references to centrally defined constants. There is no security relevance: no logic, calculations, permissions, or data handling changed.
No security action needed. Treat as a normal UI refactoring commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In FeePicker.qml, the fee-rate and fixed-fee unit labels now read from a QML context property UI_UNIT_NAME rather than being literal strings. The corresponding Python file qeapp.py exposes one additional constant UI_UNIT_NAME_FIXED_SAT to the QML context. This is purely a maintainability/refactoring change; the displayed strings remain the same and no executable behavior is altered.
Changed components
electrum/gui/qml/components/controls/FeePicker.qmlelectrum/gui/qml/qeapp.pyInspect captured patch +3 / −2
diff --git a/electrum/gui/qml/components/controls/FeePicker.qml b/electrum/gui/qml/components/controls/FeePicker.qml
index 932e9af..afbabb1 100644
--- a/electrum/gui/qml/components/controls/FeePicker.qml
+++ b/electrum/gui/qml/components/controls/FeePicker.qml
@@ -151,7 +151,7 @@ Item {
Label {
Layout.fillWidth: true
color: Material.accentColor
- text: qsTr('sat/vbyte')
+ text: UI_UNIT_NAME.FEERATE_SAT_PER_VBYTE
}
TextField {
@@ -170,7 +170,7 @@ Item {
Label {
Layout.fillWidth: true
color: Material.accentColor
- text: qsTr('sat')
+ text: UI_UNIT_NAME.FIXED_SAT
}
}
diff --git a/electrum/gui/qml/qeapp.py b/electrum/gui/qml/qeapp.py
index a4df18b..db47c89 100644
--- a/electrum/gui/qml/qeapp.py
+++ b/electrum/gui/qml/qeapp.py
@@ -553,6 +553,7 @@ class ElectrumQmlApplication(QGuiApplication):
self.context.setContextProperty('UI_UNIT_NAME', {
"FEERATE_SAT_PER_VBYTE": electrum.util.UI_UNIT_NAME_FEERATE_SAT_PER_VBYTE,
"FEERATE_SAT_PER_VB": electrum.util.UI_UNIT_NAME_FEERATE_SAT_PER_VB,
+ "FIXED_SAT": electrum.util.UI_UNIT_NAME_FIXED_SAT,
"TXSIZE_VBYTES": electrum.util.UI_UNIT_NAME_TXSIZE_VBYTES,
"MEMPOOL_MB": electrum.util.UI_UNIT_NAME_MEMPOOL_MB,
})
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.