feat: add manual Sync Data refresh button to dashboard header (#2406) - #3497
Open
aaniya22 wants to merge 1 commit into
Open
feat: add manual Sync Data refresh button to dashboard header (#2406)#3497aaniya22 wants to merge 1 commit into
aaniya22 wants to merge 1 commit into
Conversation
…shu-byte-coder#2406) Signed-off-by: aaniya22 <aaniyaatomar@gmail.com>
GSSoC Label Checklist 🏷️@Priyanshu-byte-coder — please apply the appropriate labels before merging: Difficulty (pick one):
Quality (optional):
Validation (required to score):
|
Contributor
Author
|
The 2 failing tests (in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a manual "Sync Data" refresh button to the dashboard header's top-right control area. Clicking it clears the client-side metrics cache and re-fetches fresh data via
router.refresh(), without a full browser page reload or loss of component state.Closes #2406
Type of Change
What Changed
src/components/SyncDataButton.tsx— aRefreshCwicon button (lucide-react) that dispatches the existingdevtrack:syncwindow event (already used elsewhere to invalidate the client-side metrics cache) and callsrouter.refresh()to re-fetch server dataanimate-spinto the icon while syncing is in progress, with a toast confirmation on success/failuresrc/components/DashboardHeader.tsx, alongside the existingKeyboardShortcutscontrolHow to Test
disabledstate) doesn't trigger duplicate requestsExpected result: Fresh dashboard data loads in place, with clear visual feedback during the sync.
Checklist
console.log, debug code, or commented-out blocksnpm run buildpasses locallynpm run type-check)Accessibility (UI changes only)
aria-label="Sync dashboard data")Additional Context
Reused the existing
devtrack:syncevent and client cache invalidation pattern already present inDashboardHeader.tsxrather than introducing a new caching mechanism.