feat: add member homepage with dummy data#4
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
More reviews will be available in 34 minutes and 21 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR introduces a treasury balance snapshot feature for the member dashboard. It adds TypeScript type definitions for treasury accounts and balances, server-side snapshot generation logic, two new reusable UI components for copying addresses and displaying sync status, and integrates snapshot-driven data into the member home page with formatted asset breakdowns. A separate minor styling update to the wallet authentication UI completes the changes. ChangesTreasury Balance Snapshot Feature
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/auth/wallet-connect.tsx`:
- Line 285: The span element with className "ml-2 truncate text-scroll-300" in
the WalletConnect component should be made block-level so Tailwind's truncate
works reliably; either add "inline-block" (or "block") to that className or
replace the <span> with a <div> that preserves the same classes and styling,
ensuring the element supports text-overflow: ellipsis for reliable truncation.
In `@src/components/treasury/copy-address-button.tsx`:
- Around line 25-28: The copyAddress function currently calls
navigator.clipboard.writeText without handling failures or missing clipboard
API; wrap the clipboard call in a try/catch, verify navigator.clipboard exists
before calling it, and on error update state/feedback (e.g., call
setDidCopy(false) or trigger an error notification) so the user receives
feedback when copying fails; reference the copyAddress function and the
navigator.clipboard API and ensure any fallback or error path avoids unhandled
promise rejections.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: a3503c70-9319-41ae-81ed-fd202ba8fcf0
📒 Files selected for processing (6)
src/app/page.tsxsrc/components/auth/wallet-connect.tsxsrc/components/treasury/copy-address-button.tsxsrc/components/treasury/sync-status-badge.tsxsrc/lib/treasury/balances.tssrc/lib/treasury/types.ts
There was a problem hiding this comment.
Pull request overview
Wires the member-facing home page to a server-side treasury balance "snapshot" (currently placeholder data) and refactors the layout to render totals, account details, and an asset breakdown driven by the new types. Also adds two small client widgets (copy-address button, sync status badge) and tightens the authenticated wallet pill styling.
Changes:
- New
src/lib/treasury/{types,balances}.tsdefiningTreasuryBalanceSnapshotand a server-onlygetTreasuryBalanceSnapshot()returning a hardcoded Gnosis Safe account with USDC/xDAI/wxDAI/wETH at zero balance. MemberHomeinsrc/app/page.tsxrewritten to consume the snapshot, with localformatCurrency/formatNumber/formatTimestamp/formatAddresshelpers and new sections for accounts, asset breakdown, revenue priority, and Q1 export readiness.- New
CopyAddressButtonandSyncStatusBadgeclient components, plus a small visual refresh of the authenticatedWalletConnectpill.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/lib/treasury/types.ts | Introduces snapshot/account/asset types and a pending_live_sync status. |
| src/lib/treasury/balances.ts | Server-only placeholder returning a single Gnosis Safe account with zeroed tracked assets; reads MAIN_SAFE_ADDRESS via viem. |
| src/app/page.tsx | Fetches the snapshot for authenticated users and rebuilds MemberHome around it with new formatting helpers and layout sections. |
| src/components/treasury/copy-address-button.tsx | Client button that copies an address and swaps icon for ~1.6s. |
| src/components/treasury/sync-status-badge.tsx | Client badge with a 5s spin animation indicating pending Safe sync. |
| src/components/auth/wallet-connect.tsx | Minor restyle of the authenticated address pill and sign-out button; truncates the roles label. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request introduces a new treasury balance snapshot feature for the member home page, along with several UI and code improvements related to displaying and managing treasury data. The changes include new backend logic for fetching treasury data, new UI components for copying addresses and displaying sync status, and a significant refactor of the member home layout to show real (placeholder) treasury balances and asset breakdowns.
Treasury Data Integration and Backend:
balances.ts) to provide a treasury balance snapshot, including tracked assets, account details, and sync status. This uses types defined in a newtypes.tsfile. [1] [2]Member Home Page Refactor:
MemberHomecomponent to display dynamic treasury data: total balance, asset/account counts, asset breakdown table, and account details, using the new snapshot. [1] [2]UI Components and Enhancements:
CopyAddressButtoncomponent that allows users to copy the treasury address with feedback.SyncStatusBadgecomponent to indicate pending live synchronization of treasury data.Utility Functions:
Code and Asset Cleanup:
References: [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]
Summary by CodeRabbit
New Features
Style