22541 expand breadcrumb route-state helpers for label and dns path reuse

This commit is contained in:
2026-04-09 09:26:19 +01:00
parent 1c06ef1639
commit 59d3ed287c
5 changed files with 120 additions and 30 deletions
+31
View File
@@ -52,6 +52,37 @@ Follow-ups:
- If needed, triage/fix the existing phase22 auth redirect test harness failure separately to restore full combined suite execution.
- Expand helper adoption in future slices to other navigation decision call sites if additional duplication emerges.
### CL-22541-B: breadcrumb route-state helper expansion (label + DNS path helper)
date: 2026-04-09
author: Cline
scope: `lib/routing/routeState.js`, `components/breadcrumbs.js`, `components/case/summary.js`, `tests/phase22/route-state-helper.test.cjs`
type: change
rationale: Continue Priority 3 breadcrumb refactor in a second bounded commit by extracting remaining repeated breadcrumb label and DNS-route-path decision logic into shared pure helpers.
impact: Refactor-only extraction for navigation decision logic; no auth/session/CSP/API changes; no intended EN/CY behavior change beyond internal logic centralization.
status: completed
Summary:
- Extended `lib/routing/routeState.js` with:
- `resolveSearchBreadcrumbLabel(...)`
- `isDnsRoutePath(pathname)`
- Updated `components/breadcrumbs.js` to use `resolveSearchBreadcrumbLabel(...)` and removed inline label decision IIFE.
- Updated `components/case/summary.js` to use `isDnsRoutePath(router.pathname)` and removed inline DNS path checks.
- Expanded `tests/phase22/route-state-helper.test.cjs` with coverage for:
- breadcrumb label resolution matrix
- DNS path detection helper
Validation:
- `npx eslint lib/routing/routeState.js components/breadcrumbs.js components/case/summary.js tests/phase22/route-state-helper.test.cjs` -> pass with 1 pre-existing warning in `components/case/summary.js` (`react-hooks/exhaustive-deps`).
- `node tests/phase22/route-state-helper.test.cjs` -> pass (7/7).
- `node tests/phase22/index.test.cjs` -> pass (combined suite).
Follow-ups:
- Next breadcrumbs slice can target incremental decomposition of large pathname branch rendering blocks in `components/breadcrumbs.js` into grouped render helpers with behavior parity.
### CL-00X: 22500 `components/elements/index.js` Phase 1 helper extraction
date: 2026-04-07