Skip to content

fix: sync hidden providers state with header totalRuns count#66

Open
NianJiuZst wants to merge 2 commits intopinchbench:mainfrom
NianJiuZst:fix/total-runs-filtered
Open

fix: sync hidden providers state with header totalRuns count#66
NianJiuZst wants to merge 2 commits intopinchbench:mainfrom
NianJiuZst:fix/total-runs-filtered

Conversation

@NianJiuZst
Copy link
Copy Markdown
Contributor

Bug

When a user hides a provider by clicking on the scatter graph's provider legend, the header's totalRuns count does not update to reflect the hidden entries.

Root Cause

hiddenProviders was managed as internal local state (useState) inside ScatterGraphs. When users toggled legend items:

  1. ScatterGraphs updated its own hiddenProviders state
  2. The chart's dots were hidden correctly
  3. But LeaderboardView's totalRuns was computed from filteredEntries, which had no knowledge of hiddenProviders
  4. Result: header showed stale run counts

Architecture (Before)

LeaderboardView
  └── ScatterGraphs (local hiddenProviders state)
         └── toggleProvider() → only updates ScatterGraphs internal state
  └── totalRuns = filteredEntries.reduce(...) ← never sees hiddenProviders

Fix

Split filtering into two layers:

Commit 1: fix(scatter-graphs): extract hiddenProviders to controlled props

Lift hiddenProviders state out of ScatterGraphs into LeaderboardView via controlled props.

Commit 2: fix(leaderboard-view): split business filters from legend-hidden providers

  • businessFilteredEntries: provider filter + open weights only. Used for totalRuns, legend provider list, and all charts/tables.
  • ScatterGraphs additionally applies hiddenProviders internally for chart rendering only.

Architecture (After)

LeaderboardView
  ├── hiddenProviders state (lifted here)
  ├── businessFilteredEntries = entries.filter(providerFilter + openWeights)
  │     └── totalRuns = businessFilteredEntries.reduce(...) ← stays in sync
  │     └── legend provider list (includes hidden providers)
  │     └── all charts/tables
  └── ScatterGraphs
        └── receives businessFilteredEntries + hiddenProviders
        └── hides dots based on hiddenProviders, but legend stays complete

Key insight: hiddenProviders only controls chart rendering in ScatterGraphs — it does NOT affect the legend's provider list or the header's totalRuns. Users can toggle providers back on/off from legend individually.

Files Changed

  • components/leaderboard-view.tsxhiddenProviders state + businessFilteredEntries memo
  • components/scatter-graphs.tsx — accepts hiddenProviders + onHiddenProvidersChange as props

Testing

  1. Open scatter graph view
  2. Note the totalRuns count in the header
  3. Click a provider in the scatter graph legend to hide it
  4. Verify totalRuns count does not change (the hidden entries are still counted in total runs)
  5. Verify the hidden provider still appears in the legend and can be clicked to restore
  6. Click "Show All" in legend → all providers restore

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 1, 2026

@NianJiuZst is attempting to deploy a commit to the Kilo Code Team on Vercel.

A member of the Team first needs to authorize it.

Move hiddenProviders state out of ScatterGraphs into LeaderboardView via
controlled props. This enables parent-level synchronization of legend
toggle state with header totalRuns.
…d state

Split filtering into two layers:
- businessFilteredEntries: provider filter + open weights (legend stays complete)
- scatterVisibleEntries: business filters + hiddenProviders (chart + header sync)

headerEntries selects scatterVisibleEntries only when in scatter graph view,
so totalRuns stays in sync with chart dots without affecting other sub-views.

Also prune hiddenProviders when business filters change to avoid stale entries.
@NianJiuZst NianJiuZst force-pushed the fix/total-runs-filtered branch from 7dc61fb to a921f9b Compare April 1, 2026 05:52
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.

1 participant