22541 extract deterministic case breadcrumb branches into factory maps
This commit is contained in:
@@ -565,6 +565,43 @@ Follow-ups:
|
||||
- Next slice option A (larger): extract remaining deterministic inline branches (`/myportal/case`, `/case/id/[incident]` if kept deterministic after constraints review) only if they remain callback/state free.
|
||||
- Next slice option B (smaller): add one focused assertion in helper-level tests that empty grouped map entries are tolerated without affecting precedence resolution.
|
||||
|
||||
### CL-22541-S: breadcrumbs deterministic case-branch extraction (`/myportal/case`, `/case/id/[incident]`)
|
||||
|
||||
date: 2026-04-09
|
||||
author: Cline
|
||||
scope: `lib/routing/breadcrumbRendererFactories.js`, `components/breadcrumbs.js`, `tests/phase22/breadcrumbs-route-map-structure.test.cjs`
|
||||
type: change
|
||||
rationale: Execute the next deterministic extraction slice by migrating remaining callback-free case breadcrumb branches into the case-detail factory group while preserving map precedence and leaving stateful/callback routes inline.
|
||||
impact: Refactor-only structural extraction and test guardrail expansion; no intended route/auth/session/API/EN-CY/a11y behavior change.
|
||||
status: completed
|
||||
|
||||
Summary:
|
||||
|
||||
- Extended `createCaseDetailRouteRenderers(...)` in `lib/routing/breadcrumbRendererFactories.js` to map:
|
||||
- `/myportal/case`
|
||||
- `/case/id/[incident]`
|
||||
- Injected additional deterministic inputs required by these routes:
|
||||
- `currentReference`
|
||||
- `nestedSearchString`
|
||||
- Updated `createMappedRouteRendererGroups(...)` wiring to pass the new inputs to case-detail factory composition.
|
||||
- Updated `components/breadcrumbs.js` to pass `nestedSearchString` into grouped factory composition.
|
||||
- Removed now-redundant inline `isPath(...)` branches for:
|
||||
- `/myportal/case`
|
||||
- `/case/id/[incident]`
|
||||
- Expanded `tests/phase22/breadcrumbs-route-map-structure.test.cjs` to assert:
|
||||
- both new routes are mapped in `createCaseDetailRouteRenderers`
|
||||
- both inline branches are absent from `components/breadcrumbs.js`
|
||||
|
||||
Validation:
|
||||
|
||||
- `npx eslint lib/routing/breadcrumbRendererFactories.js components/breadcrumbs.js tests/phase22/breadcrumbs-route-map-structure.test.cjs tests/phase22/index.test.cjs` -> pass.
|
||||
- `node tests/phase22/index.test.cjs` -> pass (combined suite; breadcrumbs-route-map 4/4).
|
||||
|
||||
Follow-ups:
|
||||
|
||||
- Next slice option A (larger): evaluate whether any remaining deterministic inline branches can be extracted without violating callback/state constraints.
|
||||
- Next slice option B (smaller): add a focused helper-level precedence test where earlier map contains falsy/non-function values and later maps contain valid renderers.
|
||||
|
||||
### CL-00X: 22500 `components/elements/index.js` Phase 1 helper extraction
|
||||
|
||||
date: 2026-04-07
|
||||
|
||||
Reference in New Issue
Block a user