Daily Log - 2026-04-30
Dynaforms: Dependent Fields (Gap Closure, Type Enforcement & Performance)
Achievements
- Generic Value Authoring Modes: Rewrote the dependency value input fields to be entirely controller-type-aware. Boolean controls (checkboxes/toggles) now display proper
True/Falsedropdowns natively returning real booleans into thedependsOnpayload instead of generic strings. - O(1) Engine Wiring Performance: Optimized dependency rendering speeds significantly on larger forms by compiling a single flat
controlByJsonKeylookup map, circumventing thousands of heavy recursivefindControlscans during the engine's compilation phase. - Reactive Propagation Fix: Ensured that any downstream fields cleared by a
clearOnHidedependency effect now forcibly emit avalueChangeevent to notify external formula evaluation fields that their dependency node is empty. - Destruction Guarding: Blocked the deletion of any field inside the center panel if its
jsonKeyis actively utilized as a controller inside any dependency rule in the template.
Decisions
- Strict Evaluator Equality: Stripped dynamic type coercion from the runtime evaluator entirely. The engine now operates on a typed contract enforced centrally inside the Builder UI, making
eq/neqstrictly reliable and significantly faster. - Effect Type Accumulation: Modified the runtime behavior to aggregate matched rules sequentially by effect type. This enables multiple independent rules (e.g.,
Age > 65 -> Show FieldANDSalary > 5000 -> Make Required) to co-exist without the first match cancelling evaluation for distinct effects. - Precomputed UI Labels: Refactored the configurator to use precomputed DOM bindings (
__uiOperation,__uiOutcomeText) to bypass Angular change-detection loops generated by raw template method evaluations.
Technical Details
- Modified:
dependency-configurator.component.ts/html-> Bound controller types (isBooleanController,hasStaticValueOptions) to dynamically switch input methodologies. - Modified:
form-engine.service.ts-> BuiltbuildControlByJsonKeyIndexto inject a flat O(1) AbstractControl lookup map intodepEngine.wireUp. - Modified:
dependency-engine.service.ts-> EnabledemitEvent: trueupontargetControl.reset()when executingapplyVisibilityEffectto preserve formula event chaining. - Modified:
dynaform.service.ts-> EnhancedisFieldReferencedInFormulasto include dependency controller usage protections.