Add DeveloperSummary component to display GitHub profile insights#666
Add DeveloperSummary component to display GitHub profile insights#666Pari658 wants to merge 2 commits into
Conversation
✅ Deploy Preview for github-spy ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Wondering what really moved? Review this PR in Change Stack to inspect semantic changes, definitions, and references. 📝 WalkthroughWalkthroughAdds a new ChangesDeveloper Summary Feature
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🎉 Thank you @Pari658 for your contribution. Please make sure your PR follows https://github.com/GitMetricsLab/github_tracker/blob/main/CONTRIBUTING.md#-pull-request-guidelines
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/DeveloperSummary.tsx`:
- Around line 27-34: The fetch in the useEffect (triggered by username) calls
res.json() unconditionally and passes that result to setProfile, causing error
payloads (e.g. {"message":"Not Found"}) to be treated as a valid profile; update
the fetch chain to check res.ok before setting state: after fetch, inspect
res.ok and if false extract the error message (e.g. await res.json() or
res.text()) and handle it (throw or set an error state) so setProfile only
receives a successful user object; modify the useEffect/fetch block that
references username and setProfile to guard non-OK responses and avoid rendering
error objects as profile data.
- Around line 27-34: The effect in DeveloperSummary (the useEffect that reads
username and calls fetch and setProfile) runs on every keystroke, causes
unauthenticated rate-limit issues, can suffer raced responses, and never clears
stale profile; update it to debounce/defer requests and abort in-flight fetches:
create an AbortController inside the effect and call controller.abort in the
cleanup, start the fetch only after a short debounce timeout (clear the timeout
in cleanup), clear profile immediately when username becomes empty or when
starting a new request, and accept an optional token prop from Tracker to
include an Authorization header for authenticated requests; reference the
useEffect, username, setProfile, and fetch call when making these changes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 21fdd4b1-15b8-4c60-9c93-cc9f723754f0
📒 Files selected for processing (2)
src/components/DeveloperSummary.tsxsrc/pages/Tracker/Tracker.tsx
|
@GitMetricsLab i have opened up the pr please merge it |
Related Issue
Description
Added a Developer Summary section to the Tracker page that displays GitHub profile insights based on the entered username.
Changes Made
Created a new
DeveloperSummarycomponent.Fetched GitHub user profile information using the GitHub API.
Displayed key profile details including:
Integrated the Developer Summary card into the Tracker page.
Added responsive styling using Material UI components.
How Has This Been Tested?
npm run dev.Screenshots
Type of Change
Summary by CodeRabbit