Skip to content

feat: add real-time polling for group detail page#117

Open
nifanpinc wants to merge 1 commit intosorosave-protocol:mainfrom
nifanpinc:feat/realtime-group-updates
Open

feat: add real-time polling for group detail page#117
nifanpinc wants to merge 1 commit intosorosave-protocol:mainfrom
nifanpinc:feat/realtime-group-updates

Conversation

@nifanpinc
Copy link

Summary

Implements real-time polling for the group detail page, fulfilling all acceptance criteria from #35.

Changes

New: src/hooks/useGroupPolling.ts

  • Custom React hook that polls the contract every 10 seconds
  • Auto-starts polling when group status is Active or Forming
  • Auto-stops when group is Completed or Failed
  • Graceful error handling: keeps cached data on network failures
  • Exposes refresh() for manual data refresh

Modified: src/app/groups/[id]/page.tsx

  • Replaced static mock data with live contract data via useGroupPolling
  • Added loading skeleton state during initial fetch
  • Added error state with retry button
  • Added inline warning banner when using cached data during errors
  • Added manual Refresh Now button in actions panel

Modified: src/components/RoundProgress.tsx

  • Added animated green Live indicator when polling is active
  • Added lastUpdated timestamp display
  • Progress bar turns green when all contributions are received
  • Added payout ready message when round is complete
  • Smooth 500ms transition animations on progress bar changes

Acceptance Criteria

  • Poll contract for round status changes every 10 seconds
  • Update member contribution status without page reload
  • Show live progress bar of current round contributions
  • Stop polling when round is complete

Closes #35

- Add useGroupPolling hook with 10s interval polling
- Poll contract for round status and contribution changes
- Auto-stop polling when group status is completed/failed
- Add live indicator and last-updated timestamp to RoundProgress
- Show loading skeleton and error states with retry
- Add manual refresh button in actions panel
- Progress bar turns green when all contributions received
- Graceful error handling: keep cached data on network errors

Closes sorosave-protocol#35
@nifanpinc
Copy link
Author

Code Review Summary

Status: ??Approved

Excellent custom hook design (useGroupPolling). Ready to merge!

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.

Implement group detail real-time updates

1 participant