Daily Log — 2026-02-23
FormulaBuilderComponent — Extraction Finalization & Dead Code Cleanup
Dead Code Removed from right-panel-static
- Removed properties:
formulaInput,formulaMessage,isFormulaValid,editingFormulaInput,operators+OPERATORSimport. - Removed methods:
onFormulaValidationResult(),toValueFormula(). - Removed all stale writes to
this.formulaMessage = ''andthis.formulaInput = ...increateNewFormula,editFormulaInLibrary,cancelFormulaEdit. - Removed
(validationResult)output bindings from both<app-formula-builder>template instances. - Verified build passes after all removals.
hasError Input Added Then Consolidated
- Initially added
@Input() hasErrorto pass__isFormulaErrorfor red border display. - Later consolidated into a single
@Input() errorMessage— presence of text drives both the red border and the error display. RemovedhasErrorentirely.
FormulaBuilderComponent — Error Handling Refinement & Cleanup
Error Message Moved Into Builder
- Moved the
__formulaErrortext (e.g. "Formula not configured") from the right-panel template intoFormulaBuilderComponentvia a new@Input() errorMessageinput. - Error text is now displayed inside the builder, alongside the validation message (
formulaMessage), keeping all formula-related messaging in one place. - Removed the standalone
<small *ngIf="selectedItem?.__isFormulaError">block fromright-panel-static.component.html.
hasError Input Removed
- Consolidated
hasError(boolean) anderrorMessage(string) into justerrorMessage. The red border condition now useserrorMessage || (!isFormulaValid && formulaMessage)— the presence oferrorMessagetext is sufficient to derive both the border and the text display. - Removed
[hasError]bindings from bothapp-formula-builderinstances in the right-panel template.
Library Editor Now Receives Error State
- Both builder instances (main tab and formula editor tab) now receive
[errorMessage]="selectedItem?.__formulaError || ''", since a formula field needs either a configured formula or at least one default formula whenuseRulesis true.
Validation Message Persistence Bug — Fixed
- Bug: "Formula is valid" message disappeared on first validate click. Root cause: successful validation emits
formulaChange→ parent savesselectedItem.formula→[formulaValue]changes →ngOnChangesreset the message. - Fix: Added
lastEmittedFormulatracking. On successful validation, the emitted formula is stored. When the setter detects the incoming value matcheslastEmittedFormula, it skips the validation state reset.
Refactored formulaValue to Input Setter (replaces ngOnChanges)
- Replaced
ngOnInit+ngOnChangeswith@Input() set formulaValue()getter/setter pattern. - Why:
ngOnChangesfires for all input changes and requires manual filtering via string-based property lookups. The setter only fires forformulaValue, is type-safe, handles both initial bind and subsequent changes in one place, and scales better as more reactive inputs are added. - Removed
SimpleChangesimport (no longer needed).
Files Changed
formula-builder.component.ts— AddederrorMessageinput,lastEmittedFormulatracking, refactored to input setter, removedngOnChanges/ngOnInit/SimpleChangesformula-builder.component.html— AddederrorMessagedisplay, updated red borderngClasscondition to useerrorMessageinstead ofhasErrorright-panel-static.component.html— Removed[hasError]bindings, added[errorMessage]to both builder instances, removed standalone error<small>