Skip to content

Add Mortgage Refinancing Calculator (v3) to the framework#163

Merged
jenbreese merged 3 commits into
devfrom
mort-refi-v3-0718
Jul 21, 2026
Merged

Add Mortgage Refinancing Calculator (v3) to the framework#163
jenbreese merged 3 commits into
devfrom
mort-refi-v3-0718

Conversation

@jenbreese

@jenbreese jenbreese commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

READY FOR REVIEW

Summary

Incorporates the standalone v0/shadcn Mortgage Refinancing Calculator (v3) into this repo as a normal route so it can be reviewed and iterated on in-framework. This is a lift-and-fit only — the calculator's math and display are unchanged from the original. It's a starting point for deciding what to adapt to our conventions (Stanford tokens, shared UI components, validation rules, etc.), not a finished calculator.

What changed

New route (app/interactives/mortgage-refinancing-calculator-v3/)

  • page.tsx — the route: loads the original Geist fonts, renders the original header + , wrapped in a .mortgage-refi-v3 scope.

  • components/refinance-calculator.tsx — the calculator component, brought over as-is (only the broken import path fixed).

  • lib/mortgage.ts — the present-value / amortization helpers, unchanged.

  • theme.css — the v3 palette (light, class-dark, and system-preference dark), scoped to .mortgage-refi-v3 so it reproduces the original look without touching the Stanford tokens every other calculator uses.

  • globals.css — an unscoped reference copy of the original theme, kept for review (not imported by the build).

  • Shared theme (app/ui/globals.css)

  • Registered three color tokens in @theme that the calculator needs (--color-panel, --color-panel-foreground, --color-navy-foreground).

  • Moved brand navy behind a --navy variable (was an inlined literal) so it resolves identically for every existing bg-navy/text-navy while being overridable by scoped themes. All additive and behavior-preserving for other calculators.

Cleanup

  • Removed the standalone app scaffolding that would break the build: nested app/, package.json, pnpm-lock.yaml, next.config.mjs, postcss.config.mjs, components.json, tsconfig.json, .gitignore, and the unused components/ui/button.tsx / lib/utils.ts.
  • Fixed the one broken import (@/lib/mortgage → ../lib/mortgage).
  • Removed two pieces of dead code from the original that blocked us: an undefined setNewAmountTouched() call that crashed "Reset new loan terms," and an unused closingCosts prop that failed lint. Neither affects any calculation or displayed value.

Verification

  • yarn lint — passes (only a pre-existing warning in an unrelated file).
  • yarn build:local — succeeds; the route statically exports alongside all others.
  • yarn dev — route serves 200, renders correctly, dark mode and Reset both work.
  • Not in scope (follow-ups to review)
  • Still uses the original v0 palette/components rather than our shared shadcn primitives, InfoPopover, ThemeToggle, and Stanford tokens.
  • Does not yet follow our validation conventions (invalid-input-stays-visible, "Please enter…" messages, error/warning states, result suppression).
  • Math has not been re-derived/audited against our standards yet.

@jenbreese
jenbreese requested a review from majimmy88 July 20, 2026 18:45
@majimmy88

Copy link
Copy Markdown
image The buttons for reset and continue to refinance I dont think will pass ADA.

Also theres no error handling but I assume that will be added after feedback from clients

@majimmy88 majimmy88 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed mortgage refinancing calculator v3 is more destructured with components, functions, and styles in their own files. Lovely!

@jenbreese
jenbreese merged commit c1638c7 into dev Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants