fix(frontend): Pool fee-discount CTA, outage banner, CL8Y decimals (#476) #1013

Merged
PlasticDigits merged 1 commit from fix/476-pool-fee-discount-ux into main 2026-07-12 07:44:36 +00:00
PlasticDigits commented 2026-07-12 07:32:23 +00:00 (Migrated from gitlab.com)

Summary

  • Pool page parity with Swap for fee-discount UX: unregistered /tiers CTA, registry-outage warning, and eligibility copy (hold configured CL8Y CW20 and register).
  • Shared useFeeDiscountRegistryStatus hook + FeeDiscountRegistryWarning / FeeDiscountUnregisteredCta components so Swap and Pool do not diverge.
  • Fix CL8Y tokenRegistry decimals from 6 → 18 so /tiers Hold amounts match min_cl8y_balance wei.
  • Document invariant I12 and cross-link docs/frontend.md, skills/AGENTS_FEE_DISCOUNT_TIERS.md, QA_TEMPLATE.md.

Closes #476

Test plan

  • cd frontend-dapp && npm run test:run -- src/pages/PoolPage.feeDiscountRegistryBanner.test.tsx src/pages/SwapPage.feeDiscountRegistryBanner.test.tsx src/utils/__tests__/tokenRegistry.test.ts src/utils/__tests__/feeDiscountUiCopy.test.ts
  • cd frontend-dapp && npm run test:run -- src/pages/SwapPage.test.tsx -t "fee-discount|Hold CL8Y"
  • make verify-issue-365 (frontend warning util + contract P5; indexer may need writable indexer/target)
  • Manual LocalTerra/mainnet: unregistered wallet on /pool → base fee + CTA → /tiers; register tier 1 → Pool fee badge strikethrough discounted; deregister → base fee returns
  • Registry outage mock: registered + fee_discount_registry_ok: false → Pool amber banner; provide/withdraw still enabled
  • /tiers tier 1 Hold label shows 1 CL8Y (not 10^12-scaled)

Verification checklist (reviewers)

  • Connected unregistered wallet on Pool sees CTA to /tiers and “· not registered”, not only bare 1.80%
  • Copy states hold eligible CL8Y CW20 + register (no passive hold-only implication)
  • Registered + discount_bps > 0 → Pool FeeDisplay strikethrough + effective %
  • Registered + registry unreachable → pool-fee-discount-registry-warning; actions stay enabled
  • CL8Y decimals are 18 in tokenRegistry; no contract / fail-closed fee changes
  • Existing Swap CTA / banner tests still green

Follow-ups

  • Companion ops/docs token-identity work remains in #477 (out of scope here).
  • Optional E2E: extend fee-tier-tx.spec.ts to assert Pool fee badge after register (not required for this MR; unit coverage added).
## Summary - Pool page parity with Swap for fee-discount UX: unregistered `/tiers` CTA, registry-outage warning, and eligibility copy (hold configured CL8Y CW20 **and** register). - Shared `useFeeDiscountRegistryStatus` hook + `FeeDiscountRegistryWarning` / `FeeDiscountUnregisteredCta` components so Swap and Pool do not diverge. - Fix CL8Y `tokenRegistry` decimals from 6 → **18** so `/tiers` Hold amounts match `min_cl8y_balance` wei. - Document invariant **I12** and cross-link `docs/frontend.md`, `skills/AGENTS_FEE_DISCOUNT_TIERS.md`, `QA_TEMPLATE.md`. Closes #476 ## Test plan - [ ] `cd frontend-dapp && npm run test:run -- src/pages/PoolPage.feeDiscountRegistryBanner.test.tsx src/pages/SwapPage.feeDiscountRegistryBanner.test.tsx src/utils/__tests__/tokenRegistry.test.ts src/utils/__tests__/feeDiscountUiCopy.test.ts` - [ ] `cd frontend-dapp && npm run test:run -- src/pages/SwapPage.test.tsx -t "fee-discount|Hold CL8Y"` - [ ] `make verify-issue-365` (frontend warning util + contract P5; indexer may need writable `indexer/target`) - [ ] Manual LocalTerra/mainnet: unregistered wallet on `/pool` → base fee + CTA → `/tiers`; register tier 1 → Pool fee badge strikethrough discounted; deregister → base fee returns - [ ] Registry outage mock: registered + `fee_discount_registry_ok: false` → Pool amber banner; provide/withdraw still enabled - [ ] `/tiers` tier 1 Hold label shows `1` CL8Y (not 10^12-scaled) ## Verification checklist (reviewers) - [ ] Connected **unregistered** wallet on Pool sees CTA to `/tiers` and “· not registered”, not only bare `1.80%` - [ ] Copy states hold **eligible CL8Y CW20** + **register** (no passive hold-only implication) - [ ] Registered + `discount_bps > 0` → Pool `FeeDisplay` strikethrough + effective % - [ ] Registered + registry unreachable → `pool-fee-discount-registry-warning`; actions stay enabled - [ ] CL8Y decimals are 18 in `tokenRegistry`; no contract / fail-closed fee changes - [ ] Existing Swap CTA / banner tests still green ## Follow-ups - Companion ops/docs token-identity work remains in #477 (out of scope here). - Optional E2E: extend `fee-tier-tx.spec.ts` to assert Pool fee badge after register (not required for this MR; unit coverage added).
PlasticDigits commented 2026-07-12 07:44:37 +00:00 (Migrated from gitlab.com)

mentioned in commit 6f8987d028

mentioned in commit 6f8987d02834adb7973925b4053c2c310dfba601
PlasticDigits (Migrated from gitlab.com) merged commit 6f8987d028 into main 2026-07-12 07:44:37 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-dex-terraclassic!1013
No description provided.