22541 add bundled case breadcrumb state resolver

This commit is contained in:
2026-04-09 09:28:54 +01:00
parent 59d3ed287c
commit f447aa19ea
4 changed files with 97 additions and 26 deletions
+29
View File
@@ -83,6 +83,35 @@ 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-22541-C: breadcrumb case-state bundling helper (single-call resolver)
date: 2026-04-09
author: Cline
scope: `lib/routing/routeState.js`, `components/breadcrumbs.js`, `tests/phase22/route-state-helper.test.cjs`
type: change
rationale: Continue Priority 3 breadcrumbs refactor by bundling repeatedly paired breadcrumb href/label resolution into one pure helper so component call sites stay thinner and less drift-prone.
impact: Refactor-only centralization of existing route-state composition logic; no intended auth/session/API/i18n behavior change.
status: completed
Summary:
- Added `resolveCaseBreadcrumbState(...)` in `lib/routing/routeState.js` to return:
- `breadcrumbHref`
- `caseResultsHref`
- `breadcrumbLabel`
- Updated `components/breadcrumbs.js` to replace three separate helper invocations with one resolver call.
- Extended `tests/phase22/route-state-helper.test.cjs` with bundled case-state resolver coverage.
Validation:
- `npx eslint lib/routing/routeState.js components/breadcrumbs.js tests/phase22/route-state-helper.test.cjs` -> pass.
- `node tests/phase22/route-state-helper.test.cjs` -> pass (8/8).
- `node tests/phase22/index.test.cjs` -> pass (combined suite).
Follow-ups:
- Next bounded slice can extract grouped pathname render blocks from `components/breadcrumbs.js` (data-driven map or small render helpers) while preserving route parity.
### CL-00X: 22500 `components/elements/index.js` Phase 1 helper extraction
date: 2026-04-07