Use formatRequests for the numbers on the agent detail page
Description
src/app/agents/[agent]/page.tsx renders the lifetime total (<strong>{total}</strong> requests) and each per-service total ({s.total} requests) as bare integers, so large counts print as unreadable digit runs while every other surface routes numbers through formatRequests for locale thousands grouping. This issue applies the shared formatter consistently on this page.
Requirements and context
- Repository scope: Agentpay-Org/Agentpay-frontend only.
- Wrap the lifetime total and each per-service
total with formatRequests.
- Keep the monospace agent id, the optional-total soft-failure, the "No services consumed yet" branch, and the error
role="alert" unchanged.
- Do not alter the fetch behaviour (the loading-state work is tracked separately).
Suggested execution
- Fork the repo and create a branch
git checkout -b enhancement/agents-detail-format-requests
- Implement changes
- Test and commit
Test and commit
- Run
npm run lint, npm run typecheck, npm test, and npm run build.
- Cover edge cases: zero total, a large total, and an absent optional total.
- Include the
npm test output.
Example commit message
feat(agents): format request counts on the agent detail page
Guidelines
- Minimum 95 percent test coverage for the changed page.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
Community & contribution rewards
- 💬 Join the AgentPay community on Discord for questions, reviews, and faster merges: https://discord.gg/eXvRKkgcv
- ⭐ This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project — if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward.
Use formatRequests for the numbers on the agent detail page
Description
src/app/agents/[agent]/page.tsxrenders the lifetime total (<strong>{total}</strong> requests) and each per-service total ({s.total} requests) as bare integers, so large counts print as unreadable digit runs while every other surface routes numbers throughformatRequestsfor locale thousands grouping. This issue applies the shared formatter consistently on this page.Requirements and context
totalwithformatRequests.role="alert"unchanged.Suggested execution
git checkout -b enhancement/agents-detail-format-requestssrc/app/agents/[agent]/page.tsx.src/app/agents/[agent]/page.test.tsx— mock apiClient +next/navigation, assert a large total renders grouped.README.md.format.ts.Test and commit
npm run lint,npm run typecheck,npm test, andnpm run build.npm testoutput.Example commit message
feat(agents): format request counts on the agent detail pageGuidelines
Community & contribution rewards