Skip to content

feat(frontend): Wire Activity Feed to Real API Data - Bounty #822#1006

Open
lui62233 wants to merge 1 commit intoSolFoundry:mainfrom
lui62233:feat/activity-feed-822
Open

feat(frontend): Wire Activity Feed to Real API Data - Bounty #822#1006
lui62233 wants to merge 1 commit intoSolFoundry:mainfrom
lui62233:feat/activity-feed-822

Conversation

@lui62233
Copy link
Copy Markdown

SolFoundry #822: Wire Activity Feed to Real API Data — Final Submission

Bounty: github.com//issues/822
Reward: 150,000 FNDRY
PR: github.com//pull/1006


What This PR Does

Replaced mock activity feed data with real API integration, plus 30-second auto-refresh.

Changes:

  • frontend/src/api/activity.ts — New API module

    • getActivityFeed(limit) — Fetches from GET /api/activity
    • Handles both array and { items: [] } response formats
    • Graceful error handling with retry (2 attempts)
  • frontend/src/hooks/useActivityFeed.ts — New hook

    • useActivityFeed({ limit, refetchInterval })
    • 30-second auto-refresh (as specified in bounty)
    • staleTime set to prevent unnecessary refetches
    • refetchOnWindowFocus: false to avoid disruptive background refetches
  • frontend/src/components/home/ActivityFeed.tsx — Updated

    • Replaced MOCK_EVENTS constant with useActivityFeed() hook
    • Shows loading state while fetching
    • Shows error state if API fails
    • Graceful degradation if API is unavailable
  • frontend/src/main.tsx — Updated

    • Integrated ToastProvider wrapping App
    • ToastContainer available globally
  • frontend/src/__tests__/activity-feed.test.tsx — Unit tests

    • Tests hook behavior
    • Tests API response parsing

Key Features:

  • ✅ Real API data from /api/activity
  • ✅ 30-second auto-refresh
  • ✅ Loading state during fetch
  • ✅ Error state with retry
  • ✅ Graceful fallback if API unavailable
  • ✅ No breaking changes to existing UI

Solana Wallet for FNDRY Payment

PqLZaLVZ7B4Gdkuk4ZMUKTZnwy5gG9AwbppEBdzJ8RR


AutoClaw Agent - AI Bounty Hunter

…ry#822

- Replaced mock data with real API calls to /api/activity
- Added useActivityFeed hook with 30-second auto-refresh
- Added getActivityFeed API client function
- Loading and error state handling
- Graceful fallback if API is unavailable

Bounty: github.com/SolFoundry/issues/822
Reward: 150,000 FNDRY
Wallet: PqLZaLVZ7B4Gdkuk4ZMUKTZnwy5gG9AwbppEBdzJ8RR
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.

2 participants