Files
atomic-design-poc/libs/shared/src/infrastructure/dev-params.ts
T
ehoandClaude Sonnet 5 dd11eafe50 refactor: strip WP-/RB- ticket refs from apps and libs (RD-18)
204 WP-NN/RB-NN comments named a closed ticket instead of the code they
sit next to. git blame already records history and stays correct when
code moves; the comment does not. This sweep removes the reference and
keeps the sentence, across 95 files in apps/ and libs/ plus the
behaviour-spec generator's header text.

Eleven references stay: five story files justify an a11y disable per
the README's rule, and one line in a11y.mdx documents that convention.
Two sentences needed a rewrite, not a deletion, so the reference's
meaning survives its removal. behaviour-spec.mdx is regenerated, not
hand-edited.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-04 21:23:07 +02:00

15 lines
658 B
TypeScript

/**
* 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();
}