Integrated analytics dashboard into tracker workflow#591
Integrated analytics dashboard into tracker workflow#591Krishnavamsi-codes 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. |
📝 WalkthroughWalkthroughDashboard is now imported into Tracker and rendered above the data table; Dashboard was rewritten to derive open/closed/merged counts from the passed ChangesDashboard integration & refactor
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 @Krishnavamsi-codes 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/pages/Tracker/Tracker.tsx`:
- Around line 341-346: The Dashboard currently receives unfiltered arrays via
the data prop ([...issues, ...prs]) so its charts don’t reflect user-applied
filters; update the call site to pass the filtered dataset (currentFilteredData)
to Dashboard instead of [...issues, ...prs] so the bar chart labeled "Top
Repositories (Current View)" matches the table, or if you prefer global
analytics, change Dashboard’s labels to "Total Analytics" to avoid the
misleading "Current View" wording; modify the Dashboard usage (props:
totalIssues, totalPrs, data, theme) accordingly and ensure any downstream logic
in the Dashboard component that expects the combined shape still works with
currentFilteredData.
- Around line 341-346: Dashboard analytics are inconsistent with Tracker's table
because Dashboard is receiving data={[...issues, ...prs]} and
totalIssues/totalPrs (from response.data.total_count) while the table uses
currentFilteredData (searchTitle/selectedRepo/startDate/endDate/state +
pagination); fix this by passing the same filtered+paginated dataset to
Dashboard (e.g., replace data prop with currentFilteredData or a merged
paginatedFilteredItems variable) and ensure the pie and bar computations inside
Dashboard use that same prop (or compute totals in Tracker and pass synced
totals/labels) so both charts and table share the exact same scope;
alternatively, update useGitHubData to apply those filters server-side and
return consistent items and totals so Dashboard can rely on that single source.
🪄 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: 9fa4747a-b9de-4e25-b2a3-70b4bb7916c2
📒 Files selected for processing (1)
src/pages/Tracker/Tracker.tsx
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/components/Dashboard.tsx (1)
17-25: ⚡ Quick winExtract
GitHubItemto a shared types file to avoid duplication.This interface is duplicated in
Tracker.tsx(lines 41-49). Having two copies risks them drifting apart.♻️ Suggested approach
Create a shared types file:
// src/types/github.ts export interface GitHubItem { id: number; title: string; state: string; created_at: string; pull_request?: { merged_at: string | null }; repository_url: string; html_url: string; }Then import in both components:
-interface GitHubItem { - id: number; - ... -} +import { GitHubItem } from '../types/github';🤖 Prompt for 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. In `@src/components/Dashboard.tsx` around lines 17 - 25, Extract the duplicated GitHubItem interface into a single exported type and import it where needed: create a shared module that exports interface GitHubItem (matching the shape currently declared in Dashboard.tsx and Tracker.tsx), remove the local GitHubItem declarations in both Dashboard.tsx and Tracker.tsx, and update those files to import { GitHubItem } from the new shared types module so both components use the same definition.
🤖 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.
Nitpick comments:
In `@src/components/Dashboard.tsx`:
- Around line 17-25: Extract the duplicated GitHubItem interface into a single
exported type and import it where needed: create a shared module that exports
interface GitHubItem (matching the shape currently declared in Dashboard.tsx and
Tracker.tsx), remove the local GitHubItem declarations in both Dashboard.tsx and
Tracker.tsx, and update those files to import { GitHubItem } from the new shared
types module so both components use the same definition.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 8e540627-fa4c-4e1f-bd37-ec4dbeb082ff
📒 Files selected for processing (3)
backend/server.jssrc/components/Dashboard.tsxsrc/pages/Tracker/Tracker.tsx
✅ Files skipped from review due to trivial changes (1)
- backend/server.js
|
Hi @mehul-m-prajapati , I’ve addressed the dashboard analytics consistency issue and updated the PR accordingly. Changes include:
All checks are now passing. Would appreciate a review when possible, thanks! |
Related Issue
Description
Integrated the existing orphaned
Dashboard.tsxanalytics component into the Tracker workflow.The dashboard is now rendered directly inside the Tracker page using the existing fetched GitHub issues/PRs state.
✅ Features Integrated
✅ Preserved Existing Functionality
The integration was locally verified across dark mode and standard responsive layouts.
Additionally, while exploring the codebase deeply, I identified several possible future analytics enhancements such as:
To keep this PR focused and easy to review, those improvements will be proposed separately in future issues/PRs instead of expanding the scope of this integration PR.
How Has This Been Tested?
Screenshots (if applicable)
(Attach the integrated dashboard screenshot here)
Type of Change
Summary by CodeRabbit