Skip to content

Integrated analytics dashboard into tracker workflow#591

Open
Krishnavamsi-codes wants to merge 2 commits into
GitMetricsLab:mainfrom
Krishnavamsi-codes:dashboard-integration
Open

Integrated analytics dashboard into tracker workflow#591
Krishnavamsi-codes wants to merge 2 commits into
GitMetricsLab:mainfrom
Krishnavamsi-codes:dashboard-integration

Conversation

@Krishnavamsi-codes
Copy link
Copy Markdown

@Krishnavamsi-codes Krishnavamsi-codes commented May 28, 2026

Related Issue


Description

Integrated the existing orphaned Dashboard.tsx analytics 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

  • Contribution Mix donut chart
  • Top Repositories activity bar chart
  • Responsive analytics layout
  • Theme-aware dashboard rendering
  • Proper empty-state handling

✅ Preserved Existing Functionality

  • filters
  • pagination
  • loading states
  • telemetry tables
  • current Tracker workflow
  • responsive layouts

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:

  • contribution heatmaps
  • developer activity timelines
  • repository intelligence insights
  • compare analytics
  • advanced visualization modules

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?

  • Verified dashboard rendering after successful GitHub data fetch
  • Tested with multiple repositories/issues datasets
  • Tested dark/light theme behavior
  • Tested responsive layout behavior
  • Verified existing filters and pagination continue working correctly
  • Verified charts do not render during empty/loading states

Screenshots (if applicable)

(Attach the integrated dashboard screenshot here)


Type of Change

  • Bug fix
  • New feature
  • Code style update
  • Breaking change
  • Documentation update
image_2026-05-28_135951966

Summary by CodeRabbit

  • New Features
    • Dashboard summary added to the Tracker page, displayed above the table.
    • Charts now derive metrics from the currently visible data (issues/PRs) and show a “merged” slice only when merged items exist.
    • Empty-state and chart headings updated to reflect filtered datasets.

Review Change Stack

@netlify
Copy link
Copy Markdown

netlify Bot commented May 28, 2026

Deploy Preview for github-spy ready!

Name Link
🔨 Latest commit d02e091
🔍 Latest deploy log https://app.netlify.com/projects/github-spy/deploys/6a1823f3ea3efa0008f6f6e8
😎 Deploy Preview https://deploy-preview-591--github-spy.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 28, 2026

📝 Walkthrough

Walkthrough

Dashboard is now imported into Tracker and rendered above the data table; Dashboard was rewritten to derive open/closed/merged counts from the passed data array. A whitespace-only brace formatting change was made in backend CORS handling.

Changes

Dashboard integration & refactor

Layer / File(s) Summary
Dashboard: compute chart data from data
src/components/Dashboard.tsx
Dashboard now derives openCount, mergedCount, and closedCount from the data: GitHubItem[] prop, builds pie slices conditionally, filters zero-valued slices (activePieData), updates empty-state gating to data.length > 0, and uses per-entry colors for Pie Cells.
Tracker: import and render Dashboard
src/pages/Tracker/Tracker.tsx
Imports Dashboard and renders it above the table in the non-loading JSX branch, passing currentFilteredData as data and theme as theme; adds fragment wrapper around dashboard and table.
Backend: CORS callback formatting
backend/server.js
Whitespace-only brace spacing change in the CORS origin-check else branch; no logic change.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

type:feature

Poem

🐰 Hi—I'm a rabbit with a dev hat on,
I hopped through code until the Dashboard dawn,
Above the table the charts now sing,
Counts derived from data—what joy they bring! 🎨📊

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning All changes are scoped to dashboard integration: Tracker.tsx imports and renders Dashboard, Dashboard.tsx props refactored for integration, and backend CORS formatting fixed (minor style-only adjustment unrelated to scope). The backend/server.js change (CORS brace formatting) appears unrelated to dashboard integration. Consider removing this formatting change or justifying it as a separate fix.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: integrating the Dashboard component into the Tracker workflow, which is the primary objective reflected in the raw summary and PR objectives.
Description check ✅ Passed The description comprehensively covers all required template sections: related issue (#581), detailed description of the integration, features, preserved functionality, testing approach, screenshots, and type of change.
Linked Issues check ✅ Passed The code changes fully address issue #581 requirements: Dashboard is integrated into Tracker.tsx [#581], responsive/theme-aware styling preserved [#581], empty-state handling maintained [#581], and existing Tracker functionality preserved [#581].
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4ae0ef6 and 71ebe21.

📒 Files selected for processing (1)
  • src/pages/Tracker/Tracker.tsx

Comment thread src/pages/Tracker/Tracker.tsx
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/components/Dashboard.tsx (1)

17-25: ⚡ Quick win

Extract GitHubItem to 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

📥 Commits

Reviewing files that changed from the base of the PR and between 71ebe21 and d02e091.

📒 Files selected for processing (3)
  • backend/server.js
  • src/components/Dashboard.tsx
  • src/pages/Tracker/Tracker.tsx
✅ Files skipped from review due to trivial changes (1)
  • backend/server.js

@Krishnavamsi-codes
Copy link
Copy Markdown
Author

Hi @mehul-m-prajapati , I’ve addressed the dashboard analytics consistency issue and updated the PR accordingly.

Changes include:

  • aligned dashboard analytics with filtered results scope
  • replaced misleading Issues vs PRs pie chart with state distribution
  • updated chart labels for clarity
  • verified build and checks locally

All checks are now passing. Would appreciate a review when possible, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 Bug Report: Dashboard.tsx analytics component exists but is never rendered in Tracker workflow

1 participant