Frontend: LP risk disclosure, swap precision display, and a11y axe coverage #366
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:implement
agent:implement
agent:open_issues
agent:ready
agent:research
agent:security_audit
agent:verify
architecture
backend
blocker:hybrid
blocker:launch
blocker:limit-orders
blocker:v2
block:log_only
block:security
bug
ci
contracts
correctness
deploy
dev
devops
docs
documentation
duplicate
e2e
enhancement
epic
feature
frontend
functional-completion
gas
good first issue
governance
help wanted
high-risk
hooks
hybrid
indexer
infra
infrastructure
integrators
invalid
launch-blocker
limit-orders
localnet
localterra
low priority
missing-implementation
needs-design
ops
performance
priority
high
priority
medium
product
qa
QA
question
ready
ready
research
scripts
security
security-hardening
smartcontracts
tech-debt
testing
ux
UX
v2
verification
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
code/cl8y-dex-terraclassic#366
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent
Gap analysis follow-up from GitLab #361 — bundled retail UX items M6, M10, and H10 (a11y only; enforced coverage gate explicitly rejected).
Current codebase
Impermanent loss (M6)
frontend-dapp/src/pages/PoolPage.tsx— add/remove liquidity UI with fee display, outage banners, proportional deposit math; no IL / LP risk disclosure copy.Swap precision display (M10)
useSubmitAlignedSimQuote+rawAmountMath.ts(#356).SwapPage.tsxstill usesparseFloatfor input gating, queryenabledflags, and price-impact % (lines ~172, 384, 549, 762-766, 844-917, 1443-1591). Amounts above 2⁵³ can mis-display impact and gate validation.Accessibility (H10)
frontend-dapp/e2e/a11y-critical-routes.spec.tscovers trade, charts, and wallet chrome only (#214)./swap,/limits,/pool,/portfolio.Why needed
Retail users need concise LP risk awareness, accurate large-amount UX on swap (display/gating), and consistent a11y CI coverage on primary trading surfaces before broader launch.
Constraints / guardrails
assertNoCriticalA11yViolations); no enforced Vitest coverage thresholds (rejected).e2e-smokewithVITE_PLAYWRIGHT_E2E=true; 5 workers per project config.Relevant files
frontend-dapp/src/pages/PoolPage.tsx,PoolPage.test.tsxfrontend-dapp/src/pages/SwapPage.tsx,SwapPage.test.tsxfrontend-dapp/src/utils/rawAmountMath.ts,utils/decimalAmountInput.tsfrontend-dapp/e2e/a11y-critical-routes.spec.ts,e2e/helpers/a11y.tsfrontend-dapp/e2e/fixtures/dev-wallet.tsdocs/frontend.mdRecommended direction
docs/frontend.mdor a shortdocs/liquidity-pools.mdanchor.parseFloatgating withtryParseBigInt/ decimal string helpers for positive-amount checks; compute price-impact % from raw integer strings (spread ÷ total) without float conversion when sim returns integer strings.a11y-critical-routes.spec.tswith smoke-stable waits for swap, limits, pool, portfolio (reuse outage-tolerant patterns from trade/charts specs).Acceptance criteria
9007199254740991(unit test with string fixtures)./swap,/limits,/pool,/portfolio(critical/serious = 0).Test plan
make test-frontendmake lint-frontendcd frontend-dapp && npm run test:e2e -- e2e/a11y-critical-routes.spec.ts(smoke project)/pool(IL copy),/swapwith large integer paste, axe on four new routesAttack / abuse test plan
Verification criteria
make test-frontendand extended a11y spec green in CI smoke config.PoolPage.test.tsxwithout requiring wallet connect.mentioned in issue #361
mentioned in commit
0bb04f445ementioned in merge request !875
Verified the M10 (swap precision) slice of !875 at the unit layer here; M6 + H10 are browser/e2e and ride the laptop / clean-host pass.
M10 (validation correct for raw amounts > 9007199254740991): decimalAmountInput.ts dropped parseFloat — isPositiveDecimalAmount is "safe above 2^53" and tryParseBigInt uses BigInt. The tests carry explicit above-MAX_SAFE_INTEGER string fixtures ("does not rely on parseFloat for integers above MAX_SAFE_INTEGER"). Ran decimalAmountInput.test.ts + rawAmountMath.test.ts on the branch: 26/26 pass. So the price-impact / amount-validation precision AC is covered.
Deferred to the browser / clean-host pass (not VPS-verifiable here):
M10 good from my side.
mentioned in commit
ede4ce9b6bVerification — #366 (PASS)
Verified on
mainat6205054(merge0bb04f4/ !875). No repo changes from this verify pass.Acceptance criteria
make test-frontend→PoolPage.test.tsx“shows impermanent loss notice when provide panel is open (GitLab #366)”. Browser: Playwright on/poolwith LocalTerra deploy —pool-il-risk-noticevisible above Asset A fields, copy mentions diverge risk, Learn more →#pool-lp-risk-disclosure.9007199254740991make test-frontend(957/957) —decimalAmountInput.test.ts(isPositiveDecimalAmountabove MAX_SAFE_INTEGER),rawAmountMath.test.ts(spreadPercentFromRawSim),SwapPage.test.tsx“large-amount precision (GitLab #366)”. Browser: Simulated Wallet on/, pasted9007199254740992— no Enter Amount gate. Submit path still BigInt-safe (#356); remainingparseFloatonly on custom slippage UI./swap,/limits,/pool,/portfolio(critical/serious = 0)PLAYWRIGHT_SKIP_CHAIN=1 npm run test:e2e:smoke -- e2e/a11y-critical-routes.spec.ts— 8/8 passed (5 workers). Routes:/(Swap),/limits,/pool,/portfolioplus existing trade/charts/wallet chrome.coverageThresholdinvitest.config.ts.make lint-frontend— 0 errors (5 pre-existing hook-deps warnings).Implementation notes (spot-check)
PoolPage.tsx—data-testid="pool-il-risk-notice",role="note", compact copy + docs link (POOL_LP_RISK_DOC).isPositiveDecimalAmount+spreadPercentFromRawSimreplaceparseFloaton amount gating and hop spread % display.a11y-critical-routes.spec.tsextended with outage-tolerant shell waits (waitForSwapShell,waitForRouteShell).Environment
main; provisioned LocalTerra viamake setup-cloud-localterrafor browser checks (frontend-dapp/.env.localpresent).VITE_PLAYWRIGHT_E2E=trueper CI (e2e-smokeproject).Closing as verified.
mentioned in issue #422
mentioned in issue #337
mentioned in issue #531
mentioned in issue #533
mentioned in issue #660