/** * Remove the dev-only `?scenario=` and `?role=` params from a URL. Once the * dev switcher (debug-state) has been used, sessionStorage is the authoritative source * for both — `currentScenario()`/`currentRole()` read the URL FIRST, so a stale param * left in the address bar would override the switcher on reload (the "stuck on slow" * bug). Stripping the params before reload lets the stored value win. Pure: returns the * rewritten href, mutates nothing. */ export function stripDevParams(href: string): string { const url = new URL(href); url.searchParams.delete('scenario'); url.searchParams.delete('role'); return url.toString(); }