Skip to content

Replace hardcoded "Repository Views" stat in maintainers DashboardTab with real data or removal #185

Description

@Jagadeeshftw

📌 Description

DashboardTab (src/features/maintainers/components/dashboard/DashboardTab.tsx) renders a "Repository Views" stat hardcoded to 0 with a -100% change, and silently keeps showing skeletons when the stats API errors.

💡 Why it matters: A fake -100% stat and a stuck skeleton mislead maintainers about their repo health.

🧩 Requirements and context

  • Wire "Repository Views" to real data, or remove the card until the metric exists.
  • Replace the silent-skeleton-on-error behavior with an error state plus retry.
  • Add an empty/CTA state when no project is selected.

Non-functional requirements

  • Must be secure, tested, and documented.
  • Should be efficient and easy to review.

🛠️ Suggested execution

1. Fork the repo and create a branch

git checkout -b fix/dashboardtab-stats

2. Implement changes

  • Write/modify the relevant source: src/features/maintainers/components/dashboard/DashboardTab.tsx
  • Write comprehensive tests: src/features/maintainers/components/dashboard/DashboardTab.test.tsx
  • Add documentation: inline TSDoc
  • Include TSDoc doc comments
  • Validate security assumptions: validate stat values

3. Test and commit

  • Run tests:
npm run test
  • Cover edge cases: stats error, no project selected
  • Include test output and security notes in the PR description.

Example commit message

fix(maintainers): real repository-views stat + error state

✅ Acceptance criteria

  • No hardcoded 0 / -100% stat
  • Error state with retry replaces stuck skeleton
  • Empty/no-project state present
  • Tests cover error + empty

🔒 Security notes

Validate numeric stats before display.

📋 Guidelines

  • Minimum 95% test coverage
  • Clear documentation
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

Labels

GrantFox OSSGrantFox open-source programMaybe RewardedGrantFox: potentially rewarded contributionOfficial CampaignGrantFox official campaign issuebugSomething isn't workingenhancementNew feature or requestfrontendFrontend / UI work

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions