diff --git a/apps/amm/qml/components/liquidity/NewPositionForm.qml b/apps/amm/qml/components/liquidity/NewPositionForm.qml index a33f3e0..4c29614 100644 --- a/apps/amm/qml/components/liquidity/NewPositionForm.qml +++ b/apps/amm/qml/components/liquidity/NewPositionForm.qml @@ -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 diff --git a/apps/amm/tests/qml/tst_NewPositionForm.qml b/apps/amm/tests/qml/tst_NewPositionForm.qml index 660aeeb..6dbc6c8 100644 --- a/apps/amm/tests/qml/tst_NewPositionForm.qml +++ b/apps/amm/tests/qml/tst_NewPositionForm.qml @@ -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 = ""