Skip to content

Fix language chart empty-state crash#128

Open
saurabhhhcodes wants to merge 1 commit into
JhaSourav07:mainfrom
saurabhhhcodes:codex/language-chart-empty-state-125
Open

Fix language chart empty-state crash#128
saurabhhhcodes wants to merge 1 commit into
JhaSourav07:mainfrom
saurabhhhcodes:codex/language-chart-empty-state-125

Conversation

@saurabhhhcodes
Copy link
Copy Markdown

@saurabhhhcodes saurabhhhcodes commented May 17, 2026

Description

Fixes #125.

This PR prevents the dashboard from crashing when LanguageChart receives an empty language array, which can happen for users with no public repo language data or sparse GitHub profiles. It adds a stable empty-state card that keeps the existing Top Languages layout and adds regression coverage for both empty and populated data.

Pillar

  • 🎨 Pillar 1 — New Theme Design
  • 📐 Pillar 2 — Geometric SVG Improvement
  • 🕐 Pillar 3 — Timezone Logic Optimization
  • 🛠️ Other (Bug fix, refactoring, docs)

Visual Preview

No screenshot attached; this is a dashboard crash fix. Empty language data now renders the existing card with No language data found instead of throwing on languages[0].

Checklist before requesting a review:

  • I have read the CONTRIBUTING.md file.
  • I have tested these changes locally (localhost:3000/api/streak?user=YOUR_USERNAME).
  • I have run npm run format and npm run lint locally and resolved all errors (CI will fail otherwise).
  • My commits follow the Conventional Commits format (e.g., feat(themes): ..., fix(calculate): ...).
  • I have updated README.md if I added a new theme or URL parameter. N/A: no README change needed.
  • I have started the repo. N/A for this component-level crash fix; static checks were run locally.
  • I have made sure that i have only one commit to merge in this PR.
  • The SVG output matches the CommitPulse "premium quality" aesthetic standard (no raw elements, smooth animations, correct fonts). N/A: no SVG output changed.
  • (Recommended) I joined the CommitPulse Discord community for contributor discussions, mentorship, and faster PR support.

Testing

  • npm run typecheck
  • npm run lint -- components/dashboard/LanguageChart.tsx components/dashboard/LanguageChart.test.tsx
  • npm run format:check -- components/dashboard/LanguageChart.tsx components/dashboard/LanguageChart.test.tsx
  • git diff --check

Local Environment Notes

  • Focused Vitest could not start in this Codex macOS sandbox because Rolldown’s native optional binding failed code-signature validation (ERR_DLOPEN_FAILED).
  • next build is blocked locally by the same macOS native SWC code-signature issue plus no global npm fallback path.

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 17, 2026

Someone is attempting to deploy a commit to the jhasourav07's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the needs-details This PR is missing required description details. label May 17, 2026
@github-actions
Copy link
Copy Markdown

👋 Hey @saurabhhhcodes, it looks like you didn't use our PR template!

The section ## Description is missing from your PR description.

Please update your PR description to include all required sections so we can review this properly:

  • ## Description — What does this PR do? Which issue does it fix?
  • ## Pillar — Which contribution pillar does this fall under?
  • ## Checklist — Have you ticked off the quality checklist?

You can find the full template in CONTRIBUTING.md. Just edit your PR description and the needs-details label will be removed automatically. 🙌

@github-actions
Copy link
Copy Markdown

👋 Hey @saurabhhhcodes, welcome to CommitPulse! 🎉

Thanks for opening your first pull request — this is a big deal and we appreciate the effort!

While you wait for a review, please double-check:

  • ✅ You've read the CONTRIBUTING.md checklist
  • npm run lint, npm run format, and npm run test all pass locally
  • ✅ Your PR has a visual preview if it touches any SVG output
  • 💬 You've joined our Discord for faster PR feedback

A maintainer will review your PR shortly. Hang tight! 🚀

@saurabhhhcodes
Copy link
Copy Markdown
Author

Small GSSoC label note: if this fix is accepted, could you please add gssoc:approved, level:beginner, quality:clean, and type:bug? The PR fixes the assigned crash issue #125 and includes a regression test plus passing type/lint/format checks.

@github-actions github-actions Bot removed the needs-details This PR is missing required description details. label May 17, 2026
@saurabhhhcodes
Copy link
Copy Markdown
Author

Quick CI note: I checked the failing status after updating the PR template. The only visible failure is Vercel reporting Authorization required to deploy, which needs project/team authorization from the maintainer side. The code-side local checks I could run are still green:

  • npm run typecheck
  • npm run lint -- components/dashboard/LanguageChart.tsx components/dashboard/LanguageChart.test.tsx
  • npm run format:check -- components/dashboard/LanguageChart.tsx components/dashboard/LanguageChart.test.tsx
  • git diff --check

Please re-run/authorize the Vercel preview when convenient.

@JhaSourav07
Copy link
Copy Markdown
Owner

@saurabhhhcodes

npm run test is failing

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Dashboard crashes (500 Error) when rendering users with no language data or invalid usernames

3 participants