4.2 KiB
4.2 KiB
Phase 5: Tech Debt - Context
Gathered: 2026-03-30 Status: Ready for planning
## Phase BoundaryFix all deferred v1.0 issues: filter ReviewStep output blocks and ZIP by scriptTargets selection, add a Back button to ReviewStep, wire BackendSelectionStep to BACKEND_REGISTRY keys, enrich registry with display metadata, remove the dead BackendFormValues<T> export, and eliminate act() warnings from the BackendSelectionStep test suite.
scriptTargets filtering (TECH-01)
- ReviewStep conditionally renders output blocks based on
state.deployment.scriptTargets— blocks are unmounted entirely when their target is deselected (not CSS-hidden) - Intune maps to: intuneInstall + intuneDetection blocks
- RMM maps to: rmmScript block
- rclone.conf OutputBlock is always shown regardless of scriptTargets
- ZIP bundle also respects scriptTargets — only files for selected targets are included (not always 4)
- Edge case: if both targets are deselected, only rclone.conf is shown and ZIP contains only rclone.conf (no blocking or warning needed)
Back button (TECH-02)
- Claude's Discretion — placement and styling left to planner
- Must preserve all form data (wizard state is in the store — navigation does not clear it)
- Back dispatches
SET_STEP(2)to return to DeploymentStep
Registry structure (TECH-03)
- Enrich
BACKEND_REGISTRYtoRecord<BackendType, { displayName: string; description: string; fields: FieldDef[] }> - All consumers of
BACKEND_REGISTRY[type]that access field arrays must update toBACKEND_REGISTRY[type].fields BackendSelectionStepderives the card list fromObject.entries(BACKEND_REGISTRY)— no hardcodedBACKENDSarray- Display metadata stays in the registry entry so Phase 6 additions auto-surface with zero additional code
- Existing test assertions on card text ('Azure Blob Storage', etc.) remain valid — source of truth just moves
Dead export removal (TECH-04)
- Remove
BackendFormValues<T>export fromsrc/schemas/index.ts(lines 27-28) - Verify no TypeScript errors arise after removal (no consumers expected)
act() warnings (TECH-05)
- Claude's Discretion — fix the act() warnings in
BackendSelectionStep.test.tsxusing appropriate testing-library patterns
<code_context>
Existing Code Insights
Reusable Assets
useWizard()/dispatch: Already providesSET_STEPaction — Back button usesdispatch({ type: 'SET_STEP', payload: 2 })OutputBlockcomponent: Already acceptscontent,filename,disabled— wrapping in conditional render is trivialdownloadZip(): Takes a files array — filter the array by scriptTargets before passing
Established Patterns
- AzureAuthToggle uses CSS hidden for field toggle (preserving state) — OutputBlocks use conditional render instead (no state to preserve between show/hide)
- DeploymentStep uses bottom nav bar pattern: Back + Next buttons side-by-side at bottom — ReviewStep Back button should follow same layout
- Wave 0 TDD stubs before implementation — continue pattern in v1.1
Integration Points
src/schemas/registry.ts:BACKEND_REGISTRYtype and shape change — updateFieldDef[]access to.fieldsinsrc/schemas/index.ts(buildZodSchema) andsrc/components/wizard/RemoteConfigStep.tsx(FieldRenderer iteration)src/components/wizard/ReviewStep.tsx: scriptTargets filtering + Back buttonsrc/components/wizard/BackendSelectionStep.tsx: replace hardcoded BACKENDS with registry-derived entriessrc/schemas/index.ts: remove BackendFormValues export + update registry field access
</code_context>
## Specific Ideas- ZIP filtering: pass only the relevant files to
downloadZip()based onscriptTargets— e.g.,['rclone.conf always', ...intune files if 'intune' in targets, ...rmm file if 'rmm' in targets] - Registry enrichment:
BACKEND_REGISTRYshape becomes{ displayName: string; description: string; fields: FieldDef[] }— existing registry entries get their current hardcoded card strings promoted into the registry
None — discussion stayed within phase scope.
Phase: 05-tech-debt Context gathered: 2026-03-30