feat(frontend): add Compact and Full number display settings #1377

Merged
PlasticDigits merged 2 commits from fix/issue-1259-number-display into main 2026-10-04 02:44:08 +00:00
Owner

What

Add persisted Compact / Full number display chips to retail Swap Settings. Compact remains the first-visit default; Full groups exact human amounts with en-US separators across balances, Charts/Pool volume, Protocol headlines, tape, Tiers, and Portfolio. Mounted and memoized displays update without refetching queries or resetting drafts.

Keep prices independent of the preference and signing amounts always full grouped. Confirmation digits come from the actual raw transaction values, including excess-precision truncation. Inputs remain plain decimals; quote, execute, slippage, Expert, hybrid, freeze/blacklist, and gem-filtering behavior remain unchanged. Limit receive estimates now return plain decimals for numeric calculations, with formatting at the display boundary. Required-gas messages stay full grouped.

Document Q1259-1–Q1259-10 invariants, an agent playbook, and an acceptance/abuse checklist. Add a verifier and real Settings browser smoke with mocked LCD reads. Update reverse-input expectations for plain drafts and correct a stale ALPHA human-pane inversion assertion reproduced on pristine main.

Why

Fixes #1259. The issue's sole comment confirms Compact as default and Full as opt-in. Previously every retail amount formatter abbreviated values without a Settings preference.

Implementation and review instructions: invariants, AC/abuse checklist and evidence, third-party agent playbook.

Testing

  • Tested swap flow: unit/component regressions verify stable drafts, raw offer/min received, URL behavior, and Settings persistence; browser smoke uses real Settings with mocked reads.
  • Tested liquidity add/remove: existing frontend coverage, raw floor calculations, and exact grouped signing helpers; no chain broadcast required for this display change.
  • Wallet tested: SKIP physical wallet signing and live production walkthrough; no live broadcast/deployment is claimed.
  • No console errors: SKIP independent production-console audit; deterministic tests and build completed.
  • Screenshots attached to Playwright results: four light/dark 375px/1280px Settings captures; inspected mobile rendering. Regenerate using the browser command below; screenshots are ignored build artifacts, not PR uploads.

Validation on c4ec8a75:

  • Full frontend suite and final retest: 347 files / 2,990 tests passed, five workers.
  • Issue verifier: 20 files / 316 targeted tests, chrome nesting, and invariant/source-boundary checks passed.
  • Browser: 5 tests passed, both themes/widths, reload, hostile storage/query, plain input, and 44px targets.
  • Existing verify-issue-522, 553, 557, 564, 565: all passed, including host Cargo and Postgres integration coverage. Used isolated dex_indexer_test_1259 after the existing shared test DB reported a migration checksum mismatch; shared data/checksums were not changed.
  • Production build passed with synthetic VITE_WC_PROJECT_ID=00000000000000000000000000000000; this validates bundling, not WalletConnect connectivity. Lint passed with zero errors and five existing warnings.
  • Commit hooks passed: Rust formatting/clippy, TypeScript, staged ESLint/Prettier, and gitleaks. Human development identity; hooks enabled.

Checklist

  • No hardcoded credentials or production keys/addresses introduced.
  • Lint passes.
  • Tests pass and corrections retested.
  • AC1: default compact strings preserved.
  • AC2: Full grouped formatting shared across requested chrome surfaces; memoized consumers subscribed.
  • AC3: price surfaces remain noncompact in both modes.
  • AC4: controlled amount inputs and raw payloads remain plain and unchanged.
  • AC5: signing summaries always show exact full grouped amounts.
  • AC6: legal mode persists; hostile/missing storage defaults Compact; no URL/Share persistence.
  • AC7: unresolved/invalid decimals and guarded hostile volumes fail closed; 24-character volume cap unchanged.
  • AC8: existing Settings card, no nested chrome; chrome guard passes.
  • AC9: execution protections and discovery filtering unchanged; regression suites pass.
  • AC10: docs, source crosslinks, agent instructions, unit/component/browser coverage complete.

Agent review: run make verify-issue-1259; run the full suite with bash scripts/with-node.sh --cwd frontend-dapp -- npm run test:run -- --maxWorkers=5; run make lint-frontend; then run VERIFY_ISSUE_1259_BROWSER=1 make verify-issue-1259. Follow the linked AC1–AC10 / A1–A8 checklist. Agents may skip unavailable items, record the reason and unverified scope, and mark the overall result PASS with SKIPs when runnable checks pass. A reproducible failed check remains FAIL until fixed and retested. Optional live QA creates no hold.

## What Add persisted **Compact / Full** number display chips to retail Swap Settings. Compact remains the first-visit default; Full groups exact human amounts with en-US separators across balances, Charts/Pool volume, Protocol headlines, tape, Tiers, and Portfolio. Mounted and memoized displays update without refetching queries or resetting drafts. Keep prices independent of the preference and signing amounts always full grouped. Confirmation digits come from the actual raw transaction values, including excess-precision truncation. Inputs remain plain decimals; quote, execute, slippage, Expert, hybrid, freeze/blacklist, and gem-filtering behavior remain unchanged. Limit receive estimates now return plain decimals for numeric calculations, with formatting at the display boundary. Required-gas messages stay full grouped. Document Q1259-1–Q1259-10 invariants, an agent playbook, and an acceptance/abuse checklist. Add a verifier and real Settings browser smoke with mocked LCD reads. Update reverse-input expectations for plain drafts and correct a stale ALPHA human-pane inversion assertion reproduced on pristine main. ## Why Fixes #1259. The issue's sole comment confirms Compact as default and Full as opt-in. Previously every retail amount formatter abbreviated values without a Settings preference. Implementation and review instructions: [invariants](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/branch/fix/issue-1259-number-display/docs/frontend.md#number-display-preference), [AC/abuse checklist and evidence](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/branch/fix/issue-1259-number-display/docs/qa/issue-1259/README.md), [third-party agent playbook](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/branch/fix/issue-1259-number-display/skills/AGENTS_FRONTEND_NUMBER_DISPLAY.md). ## Testing - [x] Tested swap flow: unit/component regressions verify stable drafts, raw offer/min received, URL behavior, and Settings persistence; browser smoke uses real Settings with mocked reads. - [x] Tested liquidity add/remove: existing frontend coverage, raw floor calculations, and exact grouped signing helpers; no chain broadcast required for this display change. - [ ] Wallet tested: **SKIP** physical wallet signing and live production walkthrough; no live broadcast/deployment is claimed. - [ ] No console errors: **SKIP** independent production-console audit; deterministic tests and build completed. - [x] Screenshots attached to Playwright results: four light/dark 375px/1280px Settings captures; inspected mobile rendering. Regenerate using the browser command below; screenshots are ignored build artifacts, not PR uploads. Validation on `c4ec8a75`: - Full frontend suite and final retest: **347 files / 2,990 tests passed**, five workers. - Issue verifier: **20 files / 316 targeted tests**, chrome nesting, and invariant/source-boundary checks passed. - Browser: **5 tests passed**, both themes/widths, reload, hostile storage/query, plain input, and 44px targets. - Existing `verify-issue-522`, `553`, `557`, `564`, `565`: all passed, including host Cargo and Postgres integration coverage. Used isolated `dex_indexer_test_1259` after the existing shared test DB reported a migration checksum mismatch; shared data/checksums were not changed. - Production build passed with synthetic `VITE_WC_PROJECT_ID=00000000000000000000000000000000`; this validates bundling, not WalletConnect connectivity. Lint passed with zero errors and five existing warnings. - Commit hooks passed: Rust formatting/clippy, TypeScript, staged ESLint/Prettier, and gitleaks. Human development identity; hooks enabled. ## Checklist - [x] No hardcoded credentials or production keys/addresses introduced. - [x] Lint passes. - [x] Tests pass and corrections retested. - [x] AC1: default compact strings preserved. - [x] AC2: Full grouped formatting shared across requested chrome surfaces; memoized consumers subscribed. - [x] AC3: price surfaces remain noncompact in both modes. - [x] AC4: controlled amount inputs and raw payloads remain plain and unchanged. - [x] AC5: signing summaries always show exact full grouped amounts. - [x] AC6: legal mode persists; hostile/missing storage defaults Compact; no URL/Share persistence. - [x] AC7: unresolved/invalid decimals and guarded hostile volumes fail closed; 24-character volume cap unchanged. - [x] AC8: existing Settings card, no nested chrome; chrome guard passes. - [x] AC9: execution protections and discovery filtering unchanged; regression suites pass. - [x] AC10: docs, source crosslinks, agent instructions, unit/component/browser coverage complete. Agent review: run `make verify-issue-1259`; run the full suite with `bash scripts/with-node.sh --cwd frontend-dapp -- npm run test:run -- --maxWorkers=5`; run `make lint-frontend`; then run `VERIFY_ISSUE_1259_BROWSER=1 make verify-issue-1259`. Follow the linked AC1–AC10 / A1–A8 checklist. Agents may skip unavailable items, record the reason and unverified scope, and mark the overall result **PASS with SKIPs** when runnable checks pass. A reproducible failed check remains FAIL until fixed and retested. Optional live QA creates no hold.
feat(frontend): add Compact and Full number display settings
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline was canceled
c4ec8a75e2
Persist the retail display preference and update amount chrome without changing input drafts or raw transaction values. Keep price formatting independent and signing amounts exact and grouped. Document invariants and add formatter, component, browser, and agent verification coverage.
Merge branch 'main' into fix/issue-1259-number-display
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
a1f3550c52
PlasticDigits deleted branch fix/issue-1259-number-display 2026-10-04 02:44:08 +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!1377
No description provided.