Skip to content

feat: add unified formatting standard#604

Merged
rickstaa merged 7 commits into
mainfrom
feat/add-unified-formatting-standard
Apr 30, 2026
Merged

feat: add unified formatting standard#604
rickstaa merged 7 commits into
mainfrom
feat/add-unified-formatting-standard

Conversation

@ECWireless

Copy link
Copy Markdown
Collaborator

See #545 for all details. Original PR created by @Roaring30s .

Roaring30s and others added 2 commits March 26, 2026 18:54
* feat: add numberFormatter and web3 utils

* feat: add formatting

* fix: fix bug

* fix: remove extra formatPercent

* fix: fix UI bugs

* fix: add abbreviation

* fix: remove linting errors

* fix: remove conflict

* fix: add linter checks

---------

Co-authored-by: ECWireless <40322776+ECWireless@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 27, 2026 01:06
@vercel

vercel Bot commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
explorer-arbitrum-one Ready Ready Preview, Comment Apr 30, 2026 10:17am

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces centralized number/address formatting utilities and migrates many Explorer UI surfaces (voting, treasury, orchestrators, transactions, charts, and account views) away from ad-hoc formatting/divisors to shared formatters and constants.

Changes:

  • Added utils/numberFormatters.ts (LPT/ETH/USD/percent/round/number) with accompanying tests.
  • Added utils/web3.ts (address helpers, wei conversions, percent precision constants) and migrated call sites from @lib/utils.
  • Replaced scattered manual formatting across multiple pages/components (percent divisors, LPT/ETH display, address/hash shortening).

Reviewed changes

Copilot reviewed 50 out of 51 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
utils/web3.ts New web3/address + wei conversion helpers and percent precision constants
utils/web3.test.ts Unit tests for new utils/web3 helpers
utils/voting.ts Removes local formatPercent; switches fromWei import to @utils/web3
utils/numberFormatters.ts New centralized formatting utilities for LPT/ETH/USD/percent/etc.
utils/numberFormatters.test.ts Unit tests for new number formatting utilities
tsconfig.json Adds @utils/* path alias
pages/voting/create-poll.tsx Switches fromWei import to @utils/web3
pages/voting/[poll].tsx Uses shared formatters/constants instead of local/manual formatting
pages/treasury/create-proposal.tsx Uses formatLPT + fromWei/toWei from @utils/web3
pages/treasury/[proposal].tsx Uses shared formatters/constants; moves web3 helpers to @utils/web3
pages/migrate/orchestrator.tsx Switches address/hash formatting to @utils/web3
pages/migrate/delegator/index.tsx Switches address/hash formatting to @utils/web3
pages/migrate/broadcaster.tsx Switches address/hash formatting to @utils/web3
pages/index.tsx Replaces hardcoded inflation divisor with PERCENTAGE_PRECISION_BILLION
pages/api/score/[address].tsx Moves checkAddressEquality to @utils/web3
pages/api/l1-delegator/[address].tsx Moves EMPTY_ADDRESS to @utils/web3
pages/_app.tsx Removes global numbro.setDefaults initialization
lib/utils.tsx Removes web3/formatting helpers now housed in @utils/web3
lib/utils.test.ts Removes tests for moved helpers; imports EMPTY_ADDRESS from @utils/web3
lib/api/treasury.ts Switches fromWei import to @utils/web3
lib/api/ens.ts Switches formatAddress import to @utils/web3
layouts/main.tsx Switches EMPTY_ADDRESS/formatAddress imports to @utils/web3
layouts/account.tsx Switches checkAddressEquality import to @utils/web3
hooks/useSwr.tsx Switches formatAddress import to @utils/web3
components/TxStartedDialog/index.tsx Switches formatAddress/fromWei imports to @utils/web3
components/TxConfirmedDialog/index.tsx Switches formatAddress/fromWei imports to @utils/web3
components/Treasury/TreasuryVotingWidget/index.tsx Replaces various percent/LPT formatting with shared formatters
components/Treasury/TreasuryVoteTable/index.tsx Standardizes weight formatting with shared formatters
components/Treasury/TreasuryVoteTable/Views/VoteItem.tsx Switches formatTransactionHash import to @utils/web3
components/Treasury/TreasuryVoteTable/TreasuryVotePopover.tsx Uses formatNumber for vote counts
components/TransactionsList/index.tsx Replaces numbro/manual formatting with shared formatters/constants
components/TransactionBadge/index.tsx Switches formatTransactionHash import to @utils/web3
components/StakeTransactions/index.tsx Uses formatLPT and formatAddress from new utils
components/Search/index.tsx Switches formatAddress import to @utils/web3
components/RoundStatus/index.tsx Replaces numbro formatting with shared formatters
components/Profile/index.tsx Switches formatAddress import to @utils/web3
components/PollVotingWidget/index.tsx Uses shared percent + voting power formatting
components/PerformanceList/index.tsx Replaces numbro formatting with formatNumber/formatPercent + web3 address formatting
components/OrchestratorList/index.tsx Replaces numbro/manual percent formatting and divisors with shared formatters/constants
components/OrchestratingView/index.tsx Replaces numbro/manual formatting with shared formatters/constants
components/HistoryView/index.tsx Replaces numbro/manual formatting with shared formatters/constants
components/ExplorerChart/index.tsx Moves most subtitle/axis formatting to shared formatters
components/DelegatingWidget/index.tsx Uses formatLPT and fromWei from new utils
components/DelegatingWidget/ProjectionBox.tsx Uses shared formatters for ROI, principle, fees/rewards
components/DelegatingWidget/InputBox.tsx Switches fromWei import to @utils/web3
components/DelegatingWidget/Input.tsx Replaces hardcoded divisors with percent precision constants
components/DelegatingWidget/Header.tsx Switches formatAddress import to @utils/web3
components/DelegatingView/index.tsx Replaces numbro/manual formatting with shared formatters
components/Claim/index.tsx Switches formatAddress import to @utils/web3
components/AccountCell/index.tsx Switches formatAddress import to @utils/web3
components/Account/index.tsx Switches formatAddress import to @utils/web3

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread components/Treasury/TreasuryVoteTable/index.tsx Outdated
Comment thread pages/voting/[poll].tsx
Comment thread components/OrchestratorList/index.tsx
Comment thread components/OrchestratorList/index.tsx Outdated
Comment thread components/OrchestratingView/index.tsx
Comment thread components/OrchestratingView/index.tsx Outdated
Comment thread components/OrchestratingView/index.tsx Outdated
Comment thread components/Treasury/TreasuryVoteTable/index.tsx Outdated
Comment thread components/OrchestratingView/index.tsx Outdated
Comment thread pages/voting/[poll].tsx Outdated
Comment thread components/OrchestratorList/index.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…atting-standard

# Conflicts:
#	components/OrchestratingView/index.tsx
#	components/Profile/index.tsx

@rickstaa rickstaa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ECWireless, @Roaring30s this is a very high quality and valuable pull request. Thanks a lot 💚!

@rickstaa rickstaa merged commit 2f48754 into main Apr 30, 2026
7 checks passed
@rickstaa rickstaa deleted the feat/add-unified-formatting-standard branch April 30, 2026 10:33
@github-project-automation github-project-automation Bot moved this from In Review to Done in Explorer - Data Exposure Apr 30, 2026
@Username89765sn

Copy link
Copy Markdown

Dear developers,

You did good work to add extra digits, but unfortunatly missed two numbers for this improvemend. Can you also add the extra digits there? See image. Thank you very much. This is they only solution to see what the daily profit is.

Untitled 4

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

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants