Daily Log - 2026-03-17
Formula Output Type Refinements & Clean Slate Architecture
Achievements
- Single Source of Truth (Clean Slate): Implemented logic in
RightPanelStaticComponentto explicitly clear top-level legacy properties (formula,outputType,outputCurrency) when "Use Rules" is enabled. This ensures theformulaLibraryis the sole authority for Rule-based fields. - State Promotion on Disable: Enhanced the fallback logic so that disabling Rules automatically restores the active Default Formula's logic and formatting to the parent level, ensuring a seamless return to Legacy mode.
- Isolated Builder Updates: Refined
onFormulaOutputTypeChangeto prevent property leakage; editing library-stored formulas no longer accidentally overwrites top-level metadata. - Deterministic Renderer Lookup: Replaced formula string matching with unique ID-based lookups in
FormulaFieldComponent. This ensures the correct output components (e.g., DatePicker vs Currency Input) are used even if multiple formulas in the library have identical text. - Robust Renderer Initialization: Updated
ngOnInitto prioritize looking up the default formula in the library, allowing the renderer to initialize correctly even when top-level metadata is cleared for Rules mode.
Decisions
- Minimal Sync Approach: Chose to only synchronize state during the transition from Rule mode to Legacy mode. This keeps the builder JSON clean while rules are active, relying on the renderer's ability to look deeper into the configuration when
useRulesis true. - Deterministic Type Assertion: Decided to move away from string-based matching for formula metadata to avoid "Ambiguity Bugs" where identical formula strings (like standalone numbers) could conflict.
Files Modified
src/ifile-teapot-web-dynaforms/components/dynaform-builder/right-panel-static/right-panel-static.component.tssrc/ifile-teapot-web-dynaforms/components/form-renderer/components/fields/formula-field/formula-field.component.tsdocs/dynaforms-history.md