Add conditional rendering for empty data state#748
Conversation
✅ Deploy Preview for github-spy ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughTracker table body now shows distinct empty-state rows for zero total results and for empty filtered pages, and otherwise renders the existing rows. ChangesTracker empty-state rendering
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 @aayam0304 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: 1
🤖 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/pages/Tracker/Tracker.tsx`:
- Around line 354-358: The empty-state branch in Tracker.tsx currently uses
currentFilteredData in the table body, so it can incorrectly show the global “No
issues found for this user” / “No pull requests available” message on later
pages when TablePagination still has results. Update the Tracker component’s
conditional rendering to reserve that message for totalCount === 0, and when
only currentFilteredData is empty show a filter/page-specific empty state or
reset page when filters change. Use the existing tab, totalCount,
currentFilteredData, and page handling in Tracker to place the fix.
🪄 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: 7a494b03-9b9a-4fb9-bf87-9556e4836a5c
📒 Files selected for processing (1)
src/pages/Tracker/Tracker.tsx
Updated the conditional rendering logic for displaying messages when there are no issues or pull requests. Enhanced user feedback for empty states.
Improve empty state messages in Tracker component
###Related issue 👍
📜 Description
Hello @mehul-m-prajapati
When searching for a user’s issues or pull requests, if there are no results, the page only shows:
0–0 of 0
This creates a confusing user experience and doesn’t clearly indicate that no issues or PRs exist.
Steps to Reproduce:
Open the Tracker page.
Enter a GitHub username that has no issues/PRs.
Click Fetch Data.
Actual Behavior:
The table displays 0–0 of 0 with no clear explanation.
###solution:
Updated the GitHub Tracker empty state handling. Previously, when a search yielded no results or a user had no issues/PRs, the data table component would display an empty view showing only "0–0 of 0", leading to a confusing user experience.
I implemented conditional rendering inside the
TableBodycomponent inTracker.tsx. Now, if the fetched data array is empty, it elegantly spans a friendly message across the columns telling the user exactly what happened, dynamically adjusting based on whether they are viewing the Issues or Pull Requests tab.How Has This Been Tested?
"No issues found for this user"."No pull requests available".Screenshots
Type of Change
Please count Under GSSoC '26
Thankyou ,
Aayam
Summary by CodeRabbit