Computation UI files
Column drafts, input controls and display helpers. The benefit formula belongs in programs/snap-negative/calculation.ts.
System explanation · Choosing checks
Source files
| File | Responsibility / entry points |
|---|---|
src/features/reviews/computation-controls.tsx
|
Money, integer, boolean and deduction controls with calculation-result cells. ComputationDiffsContext, ResultCell, InputRows |
src/features/reviews/computation-discrepancies.ts
|
Calculates isolated input differences and ranks up to six benefit effects. buildDiscrepancies |
src/features/reviews/computation-final-error.tsx
|
Signed benefit-error display and threshold/stale-Final handling. finalErrorDisplay, ComputationErrorRow |
src/features/reviews/computation-grid.helpers.ts
|
Scenario/draft selection and synchronization, money formatting, income alignment
and result rows. EditableScenarioId, ColumnId, DraftMap, EDITABLE_SCENARIO_IDS, parseDollarsToCents, formatDecimal2FromCents … |
src/features/reviews/computation-grid.tsx
|
Four-column grid, optional split columns and Save/Reset/Apply controls. ComputationGridProps, ComputationGrid |
src/features/reviews/computation-income.tsx
|
Income row rendering, add/edit popovers and draft changes. AddIncomeButton, IncomeRow |
src/features/reviews/income-validation.ts
|
Field-level income validation used before confirming grid input. IncomeField, incomeFieldErrors |
src/features/reviews/money-input.tsx
|
Reusable controlled money input with parse/reject behavior. MoneyInput |
Tests
| File | Responsibility / entry points |
|---|---|
src/features/reviews/computation-discrepancies.test.ts
|
Checks computation discrepancies. Example: “result row includes every calculated column and leaves empty or stale columns blank”. |
src/features/reviews/computation-grid.helpers.test.ts
|
Checks computation grid.helpers. Example: “only populated computation columns calculate, including populated zero-income cases”. |
src/features/reviews/income-validation.test.ts
|
Checks income validation. Example: “income errors identify missing type, stale member and malformed amounts together”. |