Fall back to Main when sensitivity slice is empty for the active country#10
Merged
Fall back to Main when sensitivity slice is empty for the active country#10
Conversation
Binary only on the UK leaderboard rendered an empty list because UK has zero binary outputs. The leaderboard now falls back to the Main view (with a notice) for any single-country selection that has no rows under the active sensitivity slice, mirroring the existing Global+Binary behaviour. Sensitivity buttons that would yield no rows for the current selectedView are disabled with a tooltip explaining which country to switch to. - Adds viewSupportsSelected(rows, view, selectedView) to lib/sensitivity. - ModelLeaderboard's fallback flag is now sensitivityUnsupportedForView (was globalUnsupportedForView) and applies to US, UK, and Global. - Disable + tooltip copy now name the missing country instead of always referring to "the Global view".
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Summary
Binary onlyon the UK leaderboard rendered an empty list because UK has zero binary outputs in the headline scope. This PR generalises the existing Global+Binary fallback to all single-country views.viewSupportsSelected(rows, view, selectedView)(new helper inlib/sensitivity.ts) tells whether the active slice has rows for the currently selected view.ModelLeaderboardfalls back toMainfor any selection where the slice would be empty (US, UK, or Global), not just Global. The notice copy names the missing country.disabledwith a tooltip pointing at which country to switch to (e.g. "no UK rows under this slice; switch to US or Global").Verification
bunx eslint . --max-warnings=0clean.bun run buildclean./shows the Binary button rendered withdisabled=""(because the default view is Global, where UK has zero binary rows). Switching to UK in-app renders the same fallback notice + Main scores.Follow-up
appVercel project (wherepolicybench.orgis bound) does not auto-deploy frommain. After merge, manualvercel --prodagainst that project is needed. Tracked separately.🤖 Generated with Claude Code