Skip to content

Add ?country= deep link to select the benchmark view#57

Merged
MaxGhenis merged 1 commit into
mainfrom
country-url-deeplink
Jun 3, 2026
Merged

Add ?country= deep link to select the benchmark view#57
MaxGhenis merged 1 commit into
mainfrom
country-url-deeplink

Conversation

@MaxGhenis
Copy link
Copy Markdown
Contributor

What

Adds a ?country= URL override to the PolicyBench dashboard:

  • ?country=uk (or ?view=uk) opens directly on the UK benchmark; ?country=us on the US one.
  • The override locks the view (skips timezone/language auto-detection).
  • Toggling the country selector now syncs the URL (replaceState), so the current view is shareable/embeddable.
  • SSR-safe — all reads are window-guarded.

Why

So the UK benchmark can be linked to and embedded directly (e.g. in a slide deck for a UK audience) instead of relying on the visitor's timezone/language. Today the embed always opens on US unless the viewer happens to be detected as UK.

Test plan

  • bun run lint (max-warnings=0) — clean
  • bun run test — 7/7 pass
  • bun run build — succeeds
  • Manual: /?country=uk → UK view; /?country=us → US view; no param → existing auto-detect; toggling updates the URL.

Reads ?country=uk (or ?view=us) on load and locks the selected view, so the UK
benchmark can be linked to and embedded directly (e.g. in slides) rather than
relying on timezone/language auto-detection. Toggling the country selector now
also syncs the URL so the current view is shareable. SSR-safe (window-guarded).
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 3, 2026

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

Project Deployment Actions Updated (UTC)
policybench-site Ready Ready Preview, Comment Jun 3, 2026 2:13am

Request Review

@MaxGhenis MaxGhenis merged commit 72b7f85 into main Jun 3, 2026
5 checks passed
@MaxGhenis MaxGhenis deleted the country-url-deeplink branch June 3, 2026 02:14
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