22541 introduce simple route renderer map for static breadcrumb branches

This commit is contained in:
2026-04-09 09:54:49 +01:00
parent a8ef55c65a
commit c464fbf13b
2 changed files with 55 additions and 48 deletions
+28
View File
@@ -333,6 +333,34 @@ Follow-ups:
- Next slice recommendation: extract a small route-to-renderer map for static single-branch crumbs (where branch has no bespoke side-effects) so the main JSX conditional chain shrinks further without altering explicit behavior in dynamic/sensitive branches.
### CL-22541-L: breadcrumbs simple-route renderer map introduction
date: 2026-04-09
author: Cline
scope: `components/breadcrumbs.js`
type: change
rationale: Continue bounded readability refactor by introducing a small route-to-renderer map for simple static branches, reducing conditional-chain length while preserving explicit dynamic branches.
impact: Refactor-only structural deduplication/readability improvement; no intended route/auth/session/API/EN-CY/a11y behavior change.
status: completed
Summary:
- Added `getSimpleRouteRenderer(path)` in `components/breadcrumbs.js` for simple routes with no bespoke side effects.
- Introduced a single invocation block that resolves and renders mapped simple routes when present.
- Migrated simple route branches into the map, including:
- `/myportal`, `/searchresults`, `/advancedsearch`, `/addresssearch`, `/contactus`
- `/viewall`, `/myportal/dnsapplications`
- Preserved existing label text, helper usage, and rendered crumb sequence semantics.
Validation:
- `npx eslint components/breadcrumbs.js` -> pass.
- `node tests/phase22/index.test.cjs` -> pass (combined suite).
Follow-ups:
- Next slice recommendation: extract a second tiny map for simple "link + text" pair routes (no callbacks, no side effects) to further shrink the conditional chain while keeping callback/dynamic branches explicit.
### CL-00X: 22500 `components/elements/index.js` Phase 1 helper extraction
date: 2026-04-07