Skip to content

feat: add refresh button to each dashboard widget#327

Open
Tannuu18 wants to merge 2 commits 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 2 commits 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.

@Priyanshu-byte-coder
Copy link
Copy Markdown
Owner

Hi @Tannuu18 — this PR has a merge conflict with main. Please rebase your branch:

git fetch upstream
git rebase upstream/main
# resolve conflicts, then:
git push --force-with-lease

Once rebased, we'll review and merge.

@Tannuu18 Tannuu18 force-pushed the feat/issue-179-Add-Refresh-button-to-each-dashboard-widget branch from 51063e6 to 6f2cb69 Compare May 19, 2026 13:07
@Tannuu18
Copy link
Copy Markdown
Contributor Author

heyy @Priyanshu-byte-coder The E2E smoke test is failing because the WebServer is unable to resolve the database domain (ENOTFOUND placeholder.supabase.co), causing the component rendering to time out. The Lint, Build, and Type checks all pass successfully!

@Priyanshu-byte-coder
Copy link
Copy Markdown
Owner

PR now has merge conflicts — several of the files it touches (TopRepos.tsx, StreakTracker.tsx, PRMetrics.tsx) were updated by other merged PRs. Rebase and resolve conflicts, then I'll do a full review of the refresh button implementation.

@Tannuu18 Tannuu18 marked this pull request as draft May 19, 2026 15:44
@Tannuu18 Tannuu18 force-pushed the feat/issue-179-Add-Refresh-button-to-each-dashboard-widget branch from eca0e82 to cef36cd Compare May 19, 2026 16:05
@Tannuu18 Tannuu18 marked this pull request as ready for review May 19, 2026 16:08
@Tannuu18
Copy link
Copy Markdown
Contributor Author

Please this time do the timely merge for this one. As everytime it's getting difficult to merge all the changes with others, as it's like working on two features.

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