Skip to content

Fall back to Main when sensitivity slice is empty for the active country#10

Merged
MaxGhenis merged 1 commit intomainfrom
fix/sensitivity-empty-fallback
May 9, 2026
Merged

Fall back to Main when sensitivity slice is empty for the active country#10
MaxGhenis merged 1 commit intomainfrom
fix/sensitivity-empty-fallback

Conversation

@MaxGhenis
Copy link
Copy Markdown
Contributor

Summary

Binary only on 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 in lib/sensitivity.ts) tells whether the active slice has rows for the currently selected view.
  • ModelLeaderboard falls back to Main for any selection where the slice would be empty (US, UK, or Global), not just Global. The notice copy names the missing country.
  • The button itself is disabled with 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=0 clean.
  • bun run build clean.
  • SSR / shows the Binary button rendered with disabled="" (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

  • The app Vercel project (where policybench.org is bound) does not auto-deploy from main. After merge, manual vercel --prod against that project is needed. Tracked separately.

🤖 Generated with Claude Code

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".
@vercel
Copy link
Copy Markdown

vercel Bot commented May 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
policybench Ready Ready Preview, Comment May 9, 2026 0:48am

Request Review

@MaxGhenis MaxGhenis merged commit b26c726 into main May 9, 2026
4 checks passed
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