Skip to content

[GOOD FIRST ISSUE] Add loading spinner to Refresh button during data fetch #953

@Priyanshu-byte-coder

Description

@Priyanshu-byte-coder

What Needs to Be Done

When the user clicks "Refresh" on any dashboard card (e.g. CodingActivityInsightsCard, Activity feed), the button shows no loading state. Add a spinner icon to the button while the fetch is in progress, and disable the button to prevent double-clicks.

Why This Matters

Without a loading indicator, users don't know if their click registered. They may click multiple times causing unnecessary API requests.

Files to Look At

  • src/components/CodingActivityInsightsCard.tsx — Refresh button at line ~248
  • src/components/ — Other cards with Refresh buttons follow the same pattern

Acceptance Criteria

  • Refresh button shows a spinning icon while loading === true
  • Button is disabled during loading
  • Returns to normal state after fetch completes (success or error)
  • Uses existing Tailwind animate-spin class — no new dependency needed

Tech Context

The loading state already exists in each card component. Just pass it to the button:

<button disabled={loading}>
  {loading ? <Spinner className="animate-spin" /> : "Refresh"}
</button>

Use any existing icon from the project's icon library (Lucide is already installed).

Mentorship

Comment on this issue and you'll receive a welcome comment with onboarding steps. The maintainer will guide you through your first PR.

Metadata

Metadata

Assignees

Labels

good first issueGood for newcomersgssoc:assignedGSSoC: Issue assigned to a contributorlevel:beginnerGSSoC: Beginner difficulty (20 pts)needs-triageNeeds maintainer triagetype:featureGSSoC type bonus: new feature

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions