Two backlog trees are complete: `docs/project/backlog/` (75 files, every WP done) and `docs/project/refactor-backlog-setup/` (the arc before it). Move both under `docs/project/archive/` with `git mv`, so history stays intact through `git log --follow`. `SHOWCASE-ROADMAP.md` moves with them, because it points at the now-archived backlog README. Add `docs/project/archive/README.md`. It states that these trees are historical and names the two directories that are still live. Repoint every inbound reference named in RD-30's Files table: CLAUDE.md, the root README, both backend READMEs, `LetterHtml.cs`, `a11y.mdx`, the `document-feature` and `new-ssp` skills, and the readable-codebase PLAN, README, and RD-19 ticket. Fix two upward-relative links inside the moved WP files (WP-68, WP-69) that gained a directory level and would otherwise break. Repoint `.prettierignore`'s two agent-prompt exclusions to their new path, so prettier keeps leaving those files' exact wording alone. Mark RD-30 done and check off its acceptance criteria; flip its README row to done. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
32 lines
1.3 KiB
Markdown
32 lines
1.3 KiB
Markdown
# WP-37 — Dev-switcher reset fix (scenario/role)
|
|
|
|
Status: done
|
|
Phase: 8 — platform/DX/showcase
|
|
|
|
## Why
|
|
|
|
The WP-33 dev switcher can't reset scenario/role back to `default`/`drafter` — it gets "stuck"
|
|
(e.g. on `slow`). Cause: `currentScenario()`/`currentRole()` read the URL `?scenario=`/`?role=`
|
|
param **before** sessionStorage, so once a param is in the address bar, `location.reload()` (same
|
|
URL) re-reads the stale value and overrides what the switcher just stored.
|
|
|
|
## Decisions
|
|
|
|
- Once the switcher is used, **sessionStorage is authoritative**; a leftover URL param must not
|
|
win. Strip both dev params from the URL (`history.replaceState`) before reloading.
|
|
- Extract the URL rewrite as a **pure** `stripDevParams(href)` so it's unit-testable without
|
|
touching `location.reload()`.
|
|
|
|
## Files
|
|
|
|
- `src/app/shared/infrastructure/dev-params.ts` (+ `dev-params.spec.ts`) — pure `stripDevParams`.
|
|
- `src/app/shared/ui/debug-state/debug-state.component.ts` — `switchRole`/`switchScenario` call
|
|
`applyAndReload()` (replaceState with stripped URL, then reload).
|
|
|
|
## Acceptance criteria
|
|
|
|
- [x] Switching scenario/role to any value (incl. default/drafter) sticks after reload, even when
|
|
a `?scenario=`/`?role=` param was in the URL.
|
|
- [x] `stripDevParams` removes both params, keeps other params + path/hash (spec).
|
|
- [x] `npm run ci` green.
|