Merged PR 2242: Refactor: New Appeal flow structural cleanup (Slices 1–8, no behaviour change)

## Summary

This PR merges the completed new-appeal refactor stream (Slices 1–8) into SIPS-Development.

This refactor was executed in controlled slices with regression validation at each step.

## Scope

Structural and readability improvements only:
- XML/form derivation extraction
- payload and file helper extraction
- side-effect facade introduction
- BuildSection and BuildCheckSection decomposition
- BuildCheckRow formatter map refactor
- nested prop boundary cleanup
- start-flow cleanup (CreateCase / AboutYou)

## Behaviour

No intended behavioural changes.

The following were explicitly preserved:
- S78 journey behaviour
- payload shapes and field names/ids
- HASCAS mapping logic
- appellant/agent branching
- validation rules and messages
- redirect/query parameters (`lpa`, `apt`, `id`)
- navigation and side-effect sequencing
- EN/CY output parity

## Validation

Full regression has been performed on:
- start flow (CreateCase / AboutYou)
- save and resume flows
- file upload handling
- check answers rendering
- submit/finalisation sequence
- confirmation flow
- CRM insertion path
- EN/CY parity

Additional checks:
- docsOffline branch behaviour
- completion and partial-save email paths
- negative-path validation scenarios
- lint (warnings baseline unchanged)

## Risk

Low:
- changes are structural only
- no business logic changes
- no contract changes

## Rollback

Safe rollback via reverting this merge commit.

## Notes

This refactor reduces coupling and prepares the new-appeal flow for future appeal-type expansion.

Related work items: #22570, #22576, #22577, #22583, #22586, #22587, #22588, #22590
This commit is contained in:
Robert Bond
2026-04-13 13:09:12 +00:00
parent bd3d311cfb
commit 0de9268255
47 changed files with 2010 additions and 945 deletions
+57
View File
@@ -912,6 +912,63 @@ Follow-ups:
- Breadcrumb route-state extraction closure slices (1/2/3) complete.
### CL-22541-Z4: breadcrumbs post-closure hotfix — callable label resolver parity (static + view-all)
date: 2026-04-09
author: Cline
scope: `components/breadcrumbs.js`, `tests/phase22/breadcrumbs-route-map-structure.test.cjs`
type: change
rationale: Fix post-refactor regression where some breadcrumbs rendered blank labels because mapped label entries were returned as function references instead of resolved values.
impact: Restores user-visible breadcrumb labels for static and view-all keyed routes; no auth/session/API/security behavior change.
status: completed
Summary:
- Fixed static text breadcrumb label resolver to invoke mapped label functions:
- `getStaticTextCrumbLabel(path)` now resolves callable entries (`resolver ? resolver() : null`).
- Fixed view-all label resolver parity to support both function-backed and string-backed map entries:
- `getViewAllLabel(viewKey)` now invokes function entries and returns string entries directly.
- Added structure guard assertions to prevent regression of callable label resolution behavior.
Validation:
- `node tests/phase22/breadcrumbs-route-map-structure.test.cjs` -> pass (4/4).
- `node tests/phase22/index.test.cjs` -> pass (combined suite).
Follow-ups:
- Breadcrumb label resolver parity now aligned across mapped/static/view-all label paths.
### CL-22541-Z5: architecture comparison overview refresh (senior architecture review)
date: 2026-04-09
author: Cline
scope: `context/architecture-overview-2026-04-09.md`
type: change
rationale: User requested a fresh senior architecture review and comparison baseline covering scalability, maintainability, coupling, boundary quality, operational/deployment risk, and prioritized technical debt actions.
impact: Documentation-only architecture guidance update; no runtime/auth/session/security/API behavior change.
status: completed
Summary:
- Added new architecture comparison baseline document:
- `context/architecture-overview-2026-04-09.md`
- Included requested structure:
1. current architecture summary
2. strengths
3. risks (scalability, maintainability, coupling, weak boundaries, operational/deployment)
4. prioritized recommendations
5. low-risk next improvements
- Added explicit comparison notes vs existing `context/architecture.md` and identified strategic focus areas for the next modernization wave.
Validation:
- Documentation coherence review against current repo architecture docs (`context/architecture.md`, `context/integration-map.md`, `context/project-overview.md`).
Follow-ups:
- Optionally elevate this architecture overview into a periodic architecture scorecard cadence and add measurable KPIs in memory-bank.
### CL-00X: 22500 `components/elements/index.js` Phase 1 helper extraction
date: 2026-04-07