Skip to content

Add /policybench vanity redirect to policybench.org#2842

Merged
MaxGhenis merged 1 commit into
mainfrom
policybench-vanity-redirect
Jun 16, 2026
Merged

Add /policybench vanity redirect to policybench.org#2842
MaxGhenis merged 1 commit into
mainfrom
policybench-vanity-redirect

Conversation

@MaxGhenis

Copy link
Copy Markdown
Contributor

What

Routes the short vanity paths to the standalone PolicyBench site:

  • policyengine.org/policybenchhttps://policybench.org
  • policyengine.org/us/policybench (and any /[countryId]/policybench) → https://policybench.org

Why

PolicyBench lives at its own domain (policybench.org). These memorable short paths under policyengine.org give a clean entry point to share verbally or in print for the launch.

How

react-router's <Navigate> only resolves in-app paths, so a small ExternalRedirect component does window.location.replace(to) and renders a fallback link. Two routes are added in PolicyEngine.jsx: a country-scoped policybench (ranked above the :appName catch-all) and a top-level /policybench. Unit-tested in src/__tests__/routing/externalRedirect.test.js.

Independent of the launch blog PR (#2841); can merge on its own.

🤖 Generated with Claude Code

Add an ExternalRedirect component (react-router's Navigate can't target
another domain) and route /policybench and /[countryId]/policybench to
https://policybench.org, so the short paths land on the standalone
benchmark site. Covered by a unit test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 16, 2026 12:22
@vercel

vercel Bot commented Jun 16, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
policyengine-app Ready Ready Preview, Comment Jun 16, 2026 12:25pm

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a small routing utility to support “vanity” paths under policyengine.org that redirect users to the standalone PolicyBench domain (policybench.org), covering both country-scoped and top-level paths.

Changes:

  • Introduces an ExternalRedirect React component that performs a window.location.replace(to) and renders a fallback link.
  • Adds two new routes in PolicyEngine.jsx for /policybench and /:countryId/policybench that use ExternalRedirect.
  • Adds unit tests for ExternalRedirect.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/routing/ExternalRedirect.jsx New component to perform external-domain redirects with a simple fallback UI.
src/PolicyEngine.jsx Adds vanity routes for /policybench and /:countryId/policybench using ExternalRedirect.
src/tests/routing/externalRedirect.test.js Adds unit coverage for redirect invocation and fallback link rendering.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MaxGhenis MaxGhenis merged commit aaa0263 into main Jun 16, 2026
3 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in policyengine-app Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants