Skip to content

feat: add refresh button to each dashboard widget#327

Open
Tannuu18 wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
Tannuu18:feat/issue-179-Add-Refresh-button-to-each-dashboard-widget
Open

feat: add refresh button to each dashboard widget#327
Tannuu18 wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
Tannuu18:feat/issue-179-Add-Refresh-button-to-each-dashboard-widget

Conversation

@Tannuu18
Copy link
Copy Markdown
Contributor

Summary

Adds per-widget refresh controls to dashboard cards so users can reload individual widgets without refreshing the full page.

Closes #179

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor / code cleanup

Changes Made

  • Added a refresh icon button in the header (top-right) for:
    StreakTracker
    ContributionGraph
    PRMetrics
    TopRepos
  • Wired each refresh button to re-run only that widget’s data fetch.
  • Added loading-state behavior for each button:
  • disabled while fetching
  • spinner animation during fetch
  • aria-label on each refresh button
  • Kept existing theme styling for icon state and hover state using muted-foreground and card-foreground token colors.
  • Improved ContributionGraph refresh UX so failed refresh does not wipe previously loaded chart data.

How to Test

  • Start the app and open the dashboard.
  • In each target widget (StreakTracker, ContributionGraph, PRMetrics, TopRepos), click the refresh icon.
  • Verify the button disables immediately and icon spins while fetching.
  • Verify data refreshes only for that widget (other widgets should remain unchanged).
  • Confirm button is in the header row, aligned at top-right near the title.
  • Confirm accessibility label exists on each button (Refresh Commit Streaks, Refresh Commit Activity, Refresh PR Analytics, Refresh Top Repositories).
  • Trigger a failing refresh scenario for ContributionGraph (for example, temporary API/network failure) and verify prior chart data remains visible with an error message.
  • Run npm run lint and npm run type-check.

Screenshots (if UI change)

image image image image

Checklist

  • Linked issue in summary
  • npm run lint passes locally
  • No TypeScript errors (npm run type-check)
  • Self-reviewed the diff
  • Added/updated tests if applicable

@vercel
Copy link
Copy Markdown

vercel Bot commented May 18, 2026

@Tannuu18 is attempting to deploy a commit to the PRIYANSHU DOSHI's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown
Owner

@Priyanshu-byte-coder Priyanshu-byte-coder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good refactor. Extracting fetch into useCallback is the right pattern — lets the button reuse it without duplicating logic. aria-busy, aria-label, disabled-during-load all correct. CSS vars throughout. Covers all 4 widgets (ContributionGraph, PRMetrics, StreakTracker, TopRepos). Approved.

@Priyanshu-byte-coder Priyanshu-byte-coder added gssoc:approved GSSoC: PR approved for scoring level:intermediate GSSoC: Intermediate difficulty (35 pts) gssoc26 GSSoC 2026 contribution type:feature GSSoC type bonus: new feature labels May 19, 2026
@Priyanshu-byte-coder
Copy link
Copy Markdown
Owner

PR is approved but has a conflict with the just-merged #288 (both modify ContributionGraph.tsx). Please rebase on latest main and resolve the conflict — should be straightforward to combine both changes. Then it'll merge automatically.

@Priyanshu-byte-coder
Copy link
Copy Markdown
Owner

The refactor to useCallback + async/await and the refresh button look clean — aria-busy, aria-label, disabled state all handled well. However this conflicts with recently merged PRs that touched ContributionGraph.tsx. Please rebase:

git fetch upstream && git rebase upstream/main

Push once rebased — will merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved GSSoC: PR approved for scoring gssoc26 GSSoC 2026 contribution level:intermediate GSSoC: Intermediate difficulty (35 pts) type:feature GSSoC type bonus: new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[GOOD FIRST ISSUE] Add 'Refresh' button to each dashboard widget

2 participants