Daily Log - 2026-02-27
Formula Validations (Dynaform Builder)
- PrimeNG Accordion Refactoring: Replaced custom logic with PrimeNG's
p-accordionfor consistent UI structuring across Built-in and Formula validations. - Draft and Persisted Rules Lifecycle:
- Restructured how validation rules are managed: New rules click-added now exist purely as "drafts" initially.
- Rules are only persisted into the actual form configuration (
selectedItem.validationRules) upon successful back-end API validation (when the formula builder emits a validformulaChange). - This prevents invalid or unconfigured formulas from polluting the JSON state and preserves the last known valid formula on subsequent edits.
- Duplicate Prevention: Implemented toast validation to stop users from adding multiple unconfigured draft rules at once.
- Performance Optimization: Refactored the unified
allRulesaggregation from an Angular template getter (which ran on every change detection cycle) into a plain array updated deliberately viarefreshAllRules()on mutations and component initialization.
Form Engine Architecture Review
- Exploration & Strategy: Conducted an exhaustive review of exactly how
form-engine.service.tsparses and attaches cross-field formula validations. - AsyncValidatorFn vs Manual
setErrors: Explored if Angular 19+AsyncValidatorFncould simplify validation. Concluded that the current decoupledsetErrorspattern is actually correct and necessary, asAsyncValidatorFnonly receives the scope of its own control and natively lacks cross-field reactiveness. - Decoupled Evaluator Attachment: Verified that collecting formula elements during recursive control building (
addControlsRecursive) and wiring their observables post-build is architecturally sound, testable, and robust against dependency order issues. - Identified Code Debt & Fix Requirements:
- Identified the absence of basic
debounceTime, leading to excessive network calls on intermediate keystrokes.
- Identified the absence of basic