Skip to content

feat: Explicit empty states for charts (no misleading zeros)#1122

Merged
anderdc merged 2 commits into
entrius:testfrom
andriypolanski:feat/explicit-empty-states-for-charts
May 16, 2026
Merged

feat: Explicit empty states for charts (no misleading zeros)#1122
anderdc merged 2 commits into
entrius:testfrom
andriypolanski:feat/explicit-empty-states-for-charts

Conversation

@andriypolanski
Copy link
Copy Markdown
Contributor

@andriypolanski andriypolanski commented May 13, 2026

Summary

When charts had no meaningful data—a new miner with zero PRs/issues, filters that match nothing, or a repo/language view with nothing to plot—ECharts still drew technically valid but semantically empty visuals: donuts with 0% in the center (easy to read as “bad performance”), radars with axes but no polygon, bar chart areas with no series. Users could confuse “no data yet” with “worst possible scores.”. This pr is mentioned in the previous several PRs, but not resolved successfully so far.

Related Issues

Closes #616

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other (describe below)

Checklist

  • New components are modularized/separated where sensible
  • Uses predefined theme (e.g. no hardcoded colors)
  • Responsive/mobile checked
  • Tested against the test API
  • npm run format and npm run lint:fix have been run
  • npm run build passes
  • Screenshots included for any UI/visual changes

Solution

  1. ChartEmptyPanel (src/components/common/ChartEmptyPanel.tsx)
    Reusable panel: icon, title, optional hint, dashed border, role="status". When empty is false, it renders children unchanged.

  2. chartNumericSeriesHasPositive(values)
    Shared helper: true if any value is a finite number > 0 (so an all-zero PR/issue count series is treated as empty).

  3. Miner activity

    • CredibilityChart: empty when merged + open + closed PR counts are all zero; copy explains credibility appears after PR activity in tracked repos.
    • PerformanceRadar: optional isActivityEmpty; miner Activity tab sets it when totalPrs === 0.
    • Issue mode (MinerActivity.tsx): Issue Solve Ratio donut and Discovery Profile radar use the same empty pattern when solved + open + closed issues are all zero.
  4. Leaderboard / repositories

    • TopRepositoriesTable: when the bar chart is expanded but there are no repositories to plot, show ChartEmptyPanel instead of an empty canvas.
    • LanguageWeightsTable: when the chart is expanded but no language rows exist for the chart slice, show ChartEmptyPanel.
  5. Small donuts

    • MinerCard CredDonut: if segment totals are 0, show a dashed “—” placeholder + tooltip instead of a pie and a colored 0%.
    • ActivitySidebarCards ActivityDonutCard: if total segment weight is 0, show dashed “— / No data” instead of a grey placeholder ring and a misleading center rate%.

Note: ContributionHeatmap already had copy-based empty handling when there is no contribution data; unchanged.

Files touched

Area File
Shared UI src/components/common/ChartEmptyPanel.tsx, src/components/common/index.ts
Miner PR credibility src/components/miners/CredibilityChart.tsx
Miner PR radar src/components/miners/PerformanceRadar.tsx, src/components/miners/MinerActivity.tsx
Leaderboard list src/components/leaderboard/TopRepositoriesTable.tsx, src/components/leaderboard/MinerCard.tsx, src/components/leaderboard/ActivitySidebarCards.tsx
Repo languages src/components/repositories/LanguageWeightsTable.tsx

Screenshots

image

@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label May 13, 2026
@andriypolanski andriypolanski changed the title Explicit empty states for charts (no misleading zeros) feat: Explicit empty states for charts (no misleading zeros) May 13, 2026
@andriypolanski
Copy link
Copy Markdown
Contributor Author

Hi, @anderdc , @ventura-oss
I think this pr have been mentioned before, but requested again due to no resolve.
If any other problem, please let me know, I will upgrade again.
Thanks for you trouble.

@anderdc anderdc merged commit d6d38ba into entrius:test May 16, 2026
2 checks passed
hunnyboy1217 added a commit to hunnyboy1217/gittensor-ui that referenced this pull request May 16, 2026
Resolve conflicts between the GitHub-aligned light mode work and recent
upstream changes: keep theme-aware chart colors alongside the new
ChartEmptyPanel empty-states (entrius#1122), reconcile the simplified onboarding
(entrius#1069) by adopting the new AboutContent and dropping Scoring.tsx, and
fold the RepositoryCodeBrowser GoToFileSearch (entrius#1144) into the
breadcrumb layout with theme tokens.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[UX] Charts render meaningless zero-states instead of clear "no data" messages

2 participants