MD.OFFICE
FAL

2026-04-05

Matrix Formula: Sequential Row Evaluation & Duplicate HTTP Fix

Fixed cascading formula rows (e.g. Row 5 referencing Row 3, which is itself a formula row), and eliminated duplicate HTTP calls in the evaluation pipeline.

Decisions & Solutions

  • Sequential Processing: Modified parallel arrays to process sequentially using RxJS from(formulaRows).pipe(concatMap(...)) so preceding rows are fully resolved from network calls before calculating subsequent row results.
  • Row Index Integrity: Maintained full config.rows array indices handling to properly bind @Row.N indices securely across nested matrix logic.
  • tap() vs subscribe() Side Effects: Fixed an issue causing duplicate HTTP firing by centralizing side-effects directly within tap() instead of multiple sub-listeners, relying solely on forkJoin as the subscription anchor.
  • Builder Updates: Removed builder-side restrictions preventing formula rows from being listed as references for other formula rows.

Matrix Formula Builder UI Refactor

Improved the UX/UI of the Matrix widget's configuration right-panel by encapsulating the Formula Builders into cleanly toggled accordions.

Decisions & Solutions

  • Used standard <p-accordion> markup to wrap row and column custom nested formula builders.
  • Configured local controllers (expandedMatrixRowFormulaIndex) to auto-enforce collapse conditions (single open form).
  • Tied "tick" verification markers dynamically to successful evaluative save events allowing visual builder success indication.

Matrix Formula Validation Integration & UX

Ensured Matrix widgets correctly trigger and display "Formula not configured" validation errors across the builder UI and central save orchestrator.

Decisions & Solutions

  • Orchestrator Search: Updated BuilderValidationOrchestratorService to recursively detect missing sub-formulas specifically within table structures.
  • Real-time UX Sync: Hard-linked .validateItemFormula calls instantly to manual right-panel toggles providing immediate visual validation.
  • Auto-Expansion Expansion: Upgraded builder component to automatically expand corresponding nested <p-accordion> sections instantaneously when creating a form/col.