Skip to content

Improve large balance amount display#41

Open
crossagent-production-app[bot] wants to merge 2 commits into
crossagentfrom
worktree/task_2ce70c44022b4334
Open

Improve large balance amount display#41
crossagent-production-app[bot] wants to merge 2 commits into
crossagentfrom
worktree/task_2ce70c44022b4334

Conversation

@crossagent-production-app
Copy link
Copy Markdown
Contributor

@crossagent-production-app crossagent-production-app Bot commented May 25, 2026

Fixes #40

Summary

  • Added a shared frontend balance formatter that keeps existing decimal scaling but renders large fund amounts with Million/Billion/Trillion suffixes and bounded precision.
  • Applied the formatter to account, contract, token, transaction, transfer, and holder balance/value surfaces.

Verification

  • npm test -- --runTestsByPath src/__tests__/utils/text.test.ts --runInBand
  • E2E_BASE_URL=http://localhost:3210 ./node_modules/.bin/playwright test tmp/task_2ce70c44022b4334/account-balance-format.e2e.spec.ts --reporter=line
  • ./node_modules/.bin/playwright test tmp/task_2ce70c44022b4334/pr-evidence-render.e2e.spec.ts --reporter=line

Delivery Evidence Summary

Change:

Large balance/value fields now render in compact human-readable units, for example 12.0648 Million, 2.5597 Million, and 9.5051 Million on the reported account card, while small and ordinary values keep readable decimal precision.

Objective Evidence:

  • Unit formatter coverage passed: npm test -- --runTestsByPath src/__tests__/utils/text.test.ts --runInBand (29 tests passed).
  • Product browser validation passed: E2E_BASE_URL=http://localhost:3210 ./node_modules/.bin/playwright test tmp/task_2ce70c44022b4334/account-balance-format.e2e.spec.ts --reporter=line (1 Playwright test passed).
  • PR evidence rendering check passed: ./node_modules/.bin/playwright test tmp/task_2ce70c44022b4334/pr-evidence-render.e2e.spec.ts --reporter=line (1 Playwright test passed).

Visual Evidence:

Source Screenshot Match: matched the reported /sub/account/49VYuGkjdmZprGpb4jU313RdSffxSVHixojzmafdFYGpVYXb page and same balance card/table section with anchors Account, Total Balance, Transferrable, Locked, Vested, Reserved, and the Extrinsics tab. Live API data now returns a non-zero Vested value, so that field differs from the first source screenshot but the matched product surface is the same.

account balance compact formatting

Reviewer:

@repo Intake Reviewer

Risks / Not Covered:

  • npm run prettier -- --check ... invokes the repository's app-wide Prettier script and still fails on existing formatting drift across many untouched files; this PR did not reformat the whole frontend.
  • Visual proof used the local Next.js frontend against the live Heima API because the reported production/test explorer can be auth-gated or flaky in headless sessions.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
subscan-essentials Ready Ready Preview, Comment May 25, 2026 7:26pm
subscan-essentials-ui-react Ready Ready Preview, Comment May 25, 2026 7:26pm

Request Review

@crossagent-production-app
Copy link
Copy Markdown
Contributor Author

crossagent-production-app Bot commented May 25, 2026

Delivery Evidence Summary

Change:

  • Updated compact native balances on the reported account page to include the chain token symbol, e.g. Million HEI instead of only Million.
  • Kept the shared large-number formatter and appended native token labels at the account balance display layer.

Objective Evidence:

  • npm test -- --runTestsByPath src/__tests__/utils/text.test.ts --runInBand exit code 0: Formatter unit coverage passed after the token-symbol display update.
  • E2E_BASE_URL=http://localhost:3210 ./node_modules/.bin/playwright test tmp/task_2ce70c44022b4334/account-balance-format.e2e.spec.ts --reporter=line exit code 0: Browser E2E passed with exact Million HEI assertions on the reported account balance surface.
  • git diff --check && git status --short && git diff --stat exit code 0: Diff check passed; only committed PR changes remain in the delivery branch after cleanup.

Visual Evidence:

  • account balance compact formatting with HEI symbol
  • Source Screenshot Match: same product surface as the issue screenshot, matching /sub/account/49VYuGkjdmZprGpb4jU313RdSffxSVHixojzmafdFYGpVYXb account page balance card/table anchors: Account, Total Balance, Transferrable, Locked, Vested, Reserved, and Extrinsics.
  • The visible balance values now include the token symbol, including 12.0648 Million HEI, 2.5597 Million HEI, 9.5051 Million HEI, 18.7299 Million HEI, and 0 HEI.

Reviewer:

Risks / Not Covered:

  • The repository app-wide Prettier script still has existing formatting drift outside this PR scope; this PR did not reformat the whole frontend.
  • Visual proof used the local Next.js frontend against the live Heima API because the reported production/test explorer can be auth-gated or flaky in headless sessions.

Generated at: 2026-05-25T19:41:22Z

@YoshiyukiSakura
Copy link
Copy Markdown
Contributor

image this is not good enough,we want “Million HEI” not only "Million"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants