Skip to content

prod sync#1626

Merged
Hugo0 merged 4 commits intopeanut-wallet-devfrom
peanut-wallet
Jan 20, 2026
Merged

prod sync#1626
Hugo0 merged 4 commits intopeanut-wallet-devfrom
peanut-wallet

Conversation

@Hugo0
Copy link
Contributor

@Hugo0 Hugo0 commented Jan 20, 2026

No description provided.

Hugo0 and others added 4 commits January 20, 2026 02:21
**External Nodes Visualization:**
- Add external nodes for wallets, banks, and merchants
- Distinct shapes: diamond (wallet), square (bank), hexagon (merchant)
- Animated particles flowing user → external
- Color-coded by type with dashed links
- Click behavior: wallet→Arbiscan, merchant→Google, bank→nothing
- Tooltips show full account numbers with type detection
- Error handling with retry capability

**Bank Account Type Detection:**
- New inferBankAccountType() utility in bridge.utils
- Detects: SPEI (CLABE), ACH, SEPA (IBAN), PIX, CBU/CVU
- Supports CPF/CNPJ, email, phone PIX keys
- Comprehensive Latin American payment methods

**Graph Preferences Persistence:**
- New useGraphPreferences hook with localStorage
- Auto-saves all settings with 1sec debounce
- Migrates old preferences (agePositioning → center)
- Restores on page load

**Force Simulation Improvements:**
- Unified center force with sizeBias parameter
- External links force for shared wallet/bank clustering
- Simplified charge force (removed complex distance scaling)
- Better collision detection with softer constraints
- Per-link-type strength (invite/P2P/external)
- Fixed pointer areas for better hover detection

**UI Improvements:**
- Added error states for external nodes fetch
- Better loading indicators
- Cleaner force config sliders with multiplier display
- Improved recalculate button behavior

**Architecture:**
- Cleaner data filtering (visibilityConfig removes from simulation)
- Fixed infinite loop issues with preferences
- Better force reconfiguration on data changes
- Removed hideInactive (replaced by visibilityConfig)

**Security:**
- Error handling prevents infinite loading
- No sensitive data in localStorage
- Admin-only data exposure
…ovements

- Add kycRegions field to GraphNode interface (was missing, causing type mismatch)
- Unified center force with sizeBias parameter (replaces old centerGravity + sizeBasedCenter)
- Simplified charge force (removed complex distance scaling)
- Better collision detection with softer constraints
- Per-link-type strength for invite/P2P/external edges
- Format code with prettier
- Add limit field to ExternalNodesConfig type
- Pass limit to getExternalNodes API call
- Default: 5000 (can be adjusted by user if needed)
- Allows control over performance vs data completeness
…ternal-nodes

feat(invite-graph): External nodes, preferences, and force improvements
@vercel
Copy link

vercel bot commented Jan 20, 2026

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

Project Deployment Review Updated (UTC)
peanut-wallet Ready Ready Preview, Comment Jan 20, 2026 10:55am

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 20, 2026

Caution

Review failed

The pull request is closed.

Walkthrough

This PR expands the invite graph visualization system with support for peer-to-peer edges, external payment nodes, configurable force simulation parameters, activity-based filtering, and preference persistence via localStorage. The changes span the graph component, API service layer, supporting utilities, and the UI layer consuming the expanded component API.

Changes

Cohort / File(s) Summary
Graph Component Core
src/components/Global/InvitesGraph/index.tsx
Added new public types: P2PEdge, ActivityFilter, ForceConfig, VisibilityConfig, ExternalNodesConfig; expanded GraphNode with createdAt, lastActiveAt, kycRegions; added p2pEdges and totalP2PEdges to GraphData; extended BaseProps renderOverlays signature to include new config objects and external node handlers; implemented activity filtering, graph pruning, external node rendering, and force recalculation logic.
API & Data Models
src/services/points.ts
Extended InvitesGraphResponse with node fields (createdAt, lastActiveAt, kycRegions), P2P edge array, and totalP2PEdges stat; introduced ExternalNodeType, ExternalNode, and ExternalNodesResponse types; added getExternalNodes() method to pointsApi; updated fetchInvitesGraph() signature with optional error handler.
Admin UI Layer
src/app/(mobile-ui)/dev/invite-graph/page.tsx
Refactored overlay UI from minimal controls to comprehensive panel-based layout with Display & Forces, External Nodes, Center Force, and Activity configuration sections; updated renderOverlays prop to consume expanded configuration object with multiple state handlers, force sliders, and external node filtering controls.
Preference Persistence
src/hooks/useGraphPreferences.ts
Introduced new hook for persisting graph UI preferences (GraphPreferences interface) to localStorage, supporting config state restoration on mount with safeguards against re-render loops.
Bank Account Classification
src/utils/bridge.utils.ts
Added inferBankAccountType() utility function implementing heuristic-based classification of account identifiers into bank/payment types (SEPA IBAN, CBU/CVU, SPEI CLABE, PIX, ACH, etc.).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • #1625: Modifies the same invite-graph component, InvitesGraph exports, renderOverlays signature, external node types and API methods, preferences persistence, and bank account utilities.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch peanut-wallet

Comment @coderabbitai help to get the list of available commands and usage tips.

@Hugo0 Hugo0 merged commit e022a2e into peanut-wallet-dev Jan 20, 2026
7 of 8 checks passed
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.

1 participant