feat(THI-50): modernize financing tab with scenario rail + editor - #20
Merged
tdody merged 1 commit intoApr 19, 2026
Conversation
Restructure the Financing tab into a 280px scenario rail + editor layout: - ScenarioCard becomes a compact tile for the rail: serif name, loan-type subtitle, monthly P&I, clickable star to set primary, border-ink when selected. All form/save state moves out of the card. - FinancingTab owns the editor: selects a scenario, holds its form state, wires snapshot + history drawer, delete with confirm, duplicate, activate. - Editor top bar: inline-editable serif scenario name + loan-type select + Make primary button (or "Primary" pill when already active). - Purchase Price as a prominent CurrencyInput above the summary. - Live summary MetricStrip (4 cells): Loan Amount, Monthly P&I / Cash Outlay for cash, Cash In, LTV. Large serif emphasis on the center metric. - SparklineAmort: new SVG sparkline of remaining balance over the loan term with accent gradient fill + 1.2s draw-in CSS animation. Keyed on scenario + term so it re-draws on scenario switch. - FormSection "Loan Terms": 4 SliderFields — interest rate, loan term, down payment %, origination points %. Each slider mirrors $ alongside (dp amount, origination fee) via the `sub` prop. - FormSection "Upfront Costs": 4 CurrencyInputs — closing, renovation, furniture, other. Linked dp/closing % ↔ $ logic preserved. - Conditional PMI field (conventional + <20% down) and IO period field (DSCR/portfolio) keep parity with the old card. - Action row: Save / Duplicate / SnapshotButton / History / Delete with token-based styling; THI-26 snapshot + history integrations unchanged. Also adds `.sparkline-stroke` / `@keyframes sparklineDraw` to index.css. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Rebuilds the Financing tab around a 280px scenario rail + 1fr editor layout, introduces the SparklineAmort primitive, and preserves the THI-26 snapshot / history integration.
New primitive
<SparklineAmort>(frontend/src/components/shared/SparklineAmort.tsx) — SVG line chart of remaining loan balance over term with gradient fill. Computes amortization client-side (no API call). 1.2s stroke-dashoffset draw-in animation via.sparkline-stroke+@keyframes sparklineDrawinindex.css. Supports optionalioPeriodYearsfor DSCR/portfolio.ScenarioCard rewritten as a rail tile
Compact, presentation-only card:
border-ink bg-paper; active star:text-accentFinancingTab (shell + editor)
<ScenarioCard>tiles) + "+ New scenario" outlined button at the bottom<CurrencyInput>above the summary (can't fit in the 4 sliders)<MetricStrip>with 4<MetricCell>— Loan Amount / Monthly P&I (emphasis large serif, or "Cash Outlay" for cash loans) / Cash In / LTV${scenarioId}-${term}so it re-animates when switching scenarios or changing term<SliderField>: interest rate, loan term, down payment %, origination points %. Thesubprop shows the derived $ (down-payment amount, origination fee).<CurrencyInput>: closing, renovation, furniture, otherPreserved behavior
<ConfirmDialog>Test plan
npm run build— passes, CSS 54.50 kB, 115 modules.sparkline-stroke+@keyframes sparklineDrawemitted in built CSS🤖 Generated with Claude Code