fix: sync hidden providers state with header totalRuns count#66
Open
NianJiuZst wants to merge 2 commits intopinchbench:mainfrom
Open
fix: sync hidden providers state with header totalRuns count#66NianJiuZst wants to merge 2 commits intopinchbench:mainfrom
NianJiuZst wants to merge 2 commits intopinchbench:mainfrom
Conversation
|
@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.
7dc61fb to
a921f9b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
When a user hides a provider by clicking on the scatter graph's provider legend, the header's
totalRunscount does not update to reflect the hidden entries.Root Cause
hiddenProviderswas managed as internal local state (useState) insideScatterGraphs. When users toggled legend items:ScatterGraphsupdated its ownhiddenProvidersstateLeaderboardView'stotalRunswas computed fromfilteredEntries, which had no knowledge ofhiddenProvidersArchitecture (Before)
Fix
Split filtering into two layers:
Commit 1:
fix(scatter-graphs): extract hiddenProviders to controlled propsLift
hiddenProvidersstate out ofScatterGraphsintoLeaderboardViewvia controlled props.Commit 2:
fix(leaderboard-view): split business filters from legend-hidden providersbusinessFilteredEntries: provider filter + open weights only. Used for totalRuns, legend provider list, and all charts/tables.ScatterGraphsadditionally applieshiddenProvidersinternally for chart rendering only.Architecture (After)
Key insight:
hiddenProvidersonly controls chart rendering inScatterGraphs— it does NOT affect the legend's provider list or the header'stotalRuns. Users can toggle providers back on/off from legend individually.Files Changed
components/leaderboard-view.tsx—hiddenProvidersstate +businessFilteredEntriesmemocomponents/scatter-graphs.tsx— acceptshiddenProviders+onHiddenProvidersChangeas propsTesting
totalRunscount in the headertotalRunscount does not change (the hidden entries are still counted in total runs)