fix(liquidity): show fixed active pool fee

This commit is contained in:
Ricardo Guilherme Schmidt
2026-07-18 19:56:46 -03:00
parent 798c26e93f
commit da40ec647e
2 changed files with 53 additions and 1 deletions
@@ -92,6 +92,8 @@ AmmActionCard {
readonly property string poolStatus: root.effectivePoolStatus()
readonly property bool activePool: root.poolStatus === "active_pool"
readonly property bool missingPool: root.poolStatus === "missing_pool"
readonly property bool feeSelectionRequired: !root.contextLoading && root.missingPool
readonly property bool fixedPoolFeeVisible: !root.contextLoading && root.activePool
readonly property int poolFeeBps: root.knownPoolFeeBps()
readonly property bool compact: root.width < 420
readonly property bool hasPair: root.selectedTokenAId.length > 0
@@ -381,9 +383,12 @@ AmmActionCard {
}
ColumnLayout {
id: feeTierSelector
objectName: "feeTierSelector"
Layout.fillWidth: true
spacing: 8
visible: !root.contextLoading
visible: root.feeSelectionRequired
Text {
text: qsTr("Fee tier")
@@ -461,6 +466,30 @@ AmmActionCard {
}
}
RowLayout {
Layout.fillWidth: true
spacing: 10
visible: root.fixedPoolFeeVisible
Text {
Layout.fillWidth: true
text: qsTr("Fee tier")
color: root.theme.colors.textSecondary
font.pixelSize: 12
}
Text {
id: fixedPoolFee
objectName: "fixedPoolFee"
text: root.feeLabel(root.poolFeeBps > 0
? root.poolFeeBps : root.selectedFeeBps)
color: root.theme.colors.textPrimary
font.pixelSize: 12
font.weight: Font.Medium
}
}
RowLayout {
Layout.fillWidth: true
spacing: 10
@@ -198,6 +198,29 @@ TestCase {
verify(amountBInput.invalid)
}
function test_activePoolShowsFixedFeeInsteadOfSelector() {
var form = createForm()
form.flowState = flowState({
"schema": "new-position.v2",
"status": "ok",
"tokenAId": tokenHigh,
"tokenBId": tokenLow,
"poolStatus": "active_pool",
"poolFeeBps": 5
})
form.visible = true
wait(0)
compare(form.poolStatus, "active_pool")
var selector = findChild(form, "feeTierSelector")
var fixedFee = findChild(form, "fixedPoolFee")
verify(selector)
verify(fixedFee)
compare(form.feeSelectionRequired, false)
compare(form.fixedPoolFeeVisible, true)
compare(fixedFee.text, "0.05%")
}
function test_contextRefreshSelectsSingleHoldingsBeforeQuote() {
var form = createForm()
form.selectedHoldingAId = ""