From 74171f9f1c3bf09fd415e09f154dd9621da71c2d Mon Sep 17 00:00:00 2001 From: KillariDev <13102010+KillariDev@users.noreply.github.com> Date: Tue, 19 May 2026 07:54:51 +0000 Subject: [PATCH] Rename REP deposit UI to collateral terminology - Update labels, prompts, and liquidation messages to say REP collateral - Move approval guidance into the deposit control and add wallet balance context - Refresh security vault and pool tests for the new wording --- ui/ts/components/LiquidationModal.tsx | 2 +- .../SecurityPoolWorkflowSection.tsx | 16 +++--- ui/ts/components/SecurityVaultSection.tsx | 4 +- ui/ts/components/VaultMetricGrid.tsx | 2 +- ui/ts/hooks/useSecurityVaultOperations.ts | 4 +- ui/ts/lib/liquidation.ts | 4 +- .../securityPoolWorkflowSection.test.tsx | 50 ++++++++++++++++++- ui/ts/tests/securityPoolsSection.test.ts | 2 +- ui/ts/tests/securityVault.test.ts | 4 +- ui/ts/tests/securityVaultSection.test.tsx | 1 + 10 files changed, 70 insertions(+), 19 deletions(-) diff --git a/ui/ts/components/LiquidationModal.tsx b/ui/ts/components/LiquidationModal.tsx index fc8328d3..36be2160 100644 --- a/ui/ts/components/LiquidationModal.tsx +++ b/ui/ts/components/LiquidationModal.tsx @@ -332,7 +332,7 @@ export function LiquidationModal({
- + diff --git a/ui/ts/components/SecurityPoolWorkflowSection.tsx b/ui/ts/components/SecurityPoolWorkflowSection.tsx index 9b8860ac..5d0d192b 100644 --- a/ui/ts/components/SecurityPoolWorkflowSection.tsx +++ b/ui/ts/components/SecurityPoolWorkflowSection.tsx @@ -269,7 +269,7 @@ export function SecurityPoolWorkflowSection({ const hasValidOraclePrice = hasValidSecurityVaultOraclePrice(selectedVaultDetails?.managerAddress, currentPoolOracleManagerDetails) const depositAmount = (() => { try { - return parseRepAmountInput(securityVault.securityVaultForm.depositAmount ?? '', 'REP deposit amount') + return parseRepAmountInput(securityVault.securityVaultForm.depositAmount ?? '', 'REP collateral amount') } catch { return undefined } @@ -347,7 +347,7 @@ export function SecurityPoolWorkflowSection({ const vaultReadinessActions = getSecurityPoolVaultReadinessActions([ { actionLabel: 'Deposit REP', - description: 'Add REP to the selected vault, including approval from inside the operation.', + description: 'Add REP to the selected vault.', key: 'deposit-rep', onAction: () => setVaultActionModal('deposit-rep'), readiness: depositGuardMessage === undefined ? 'ready' : 'warning', @@ -569,7 +569,7 @@ export function SecurityPoolWorkflowSection({ - + @@ -888,7 +888,7 @@ export function SecurityPoolWorkflowSection({
- setVaultActionModal(undefined)} title='Deposit REP' description='Review the selected vault, complete REP approval if needed, then deposit REP.'> + setVaultActionModal(undefined)} title='Deposit REP' description='Review the selected vault, then deposit REP.'> {selectedVaultDetails === undefined ?

Refresh the selected vault before depositing REP.

: null} {selectedVaultDetails === undefined ? null : ( <> @@ -904,7 +904,7 @@ export function SecurityPoolWorkflowSection({ variant='embedded' /> +
+ + + +
0n ? { detail: `Need ${formatCurrencyBalance(repBalanceGap)} more REP.` } : {}) }, { key: 'minimum', label: 'First deposit meets the vault minimum', resolved: !isDepositBelowMinimum, ...(isDepositBelowMinimum ? { detail: `First deposits must be at least ${formatCurrencyBalance(MIN_SECURITY_VAULT_REP_DEPOSIT)} REP.` } : {}) }, ]} diff --git a/ui/ts/components/SecurityVaultSection.tsx b/ui/ts/components/SecurityVaultSection.tsx index 27ebc444..ddf7a03e 100644 --- a/ui/ts/components/SecurityVaultSection.tsx +++ b/ui/ts/components/SecurityVaultSection.tsx @@ -106,7 +106,7 @@ export function SecurityVaultSection({ const selectedVaultIsOwnedByAccount = isSelectedVaultOwnedByAccountHelper(selectedVaultAddress, accountState.address) const depositAmount = (() => { try { - return parseRepAmountInput(normalizedSecurityVaultForm.depositAmount, 'REP deposit amount') + return parseRepAmountInput(normalizedSecurityVaultForm.depositAmount, 'REP collateral amount') } catch { return undefined } @@ -287,7 +287,7 @@ export function SecurityVaultSection({