Skip to content

IFDM-337 IFDM-339: Fixing button recalculation behavoir and updating … - #179

Open
jenbreese wants to merge 1 commit into
devfrom
IFDM-337
Open

IFDM-337 IFDM-339: Fixing button recalculation behavoir and updating …#179
jenbreese wants to merge 1 commit into
devfrom
IFDM-337

Conversation

@jenbreese

@jenbreese jenbreese commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

READY FOR REVIEW

PR: Mortgage Refinancing Calculator v3 — Live Results Display

Overview

Replace the explicit "Calculate results" button workflow with progressive disclosure: on first load show the button, but as soon as the user edits any refinance field, hide the button permanently and show the "Net value today" section live—updating reactively, with a dash when inputs are invalid.

Changes Made

  1. State Management (refinance-calculator.tsx)
    Added hasStartedEditing state to track whether the user has typed in ANY refinance field since page load
    Triggers on first keystroke in any of: newAmount, newTerm, newRate, closingCosts, years
    Persists across tab switches; resets only on page reload
  2. Button Visibility Logic (lines 835–851)
    "Calculate results" button now shows only when !hasStartedEditing
    Once user types in any refinance field, button disappears permanently
    Entire dashed-border box containing button is removed; replaced by results section
  3. Live Results Display (lines 877–914)
    "Net value today" section always renders once hasStartedEditing is true
    Shows dash (-) when inputs are incomplete or have validation errors
    Shows calculated value + verdict + description when all required fields are valid
    Loan comparison table always visible; breakdown expandable only when results are ready
  4. Text Change (line 37)
    Changed DASH constant from em-dash (—) to regular hyphen (-)
    Behavior Flow

First Load
├─ "Calculate results" button visible (dashed box)
└─ No results section

User types in refi field
├─ Button disappears
└─ "Net value today" appears with dash

User fills all required fields
├─ "Net value today" shows calculated value
├─ Verdict icon & headline appear
└─ Loan comparison & breakdown visible

User edits any field
├─ Results update live
└─ Button never reappears

Page reload
└─ Back to first load state (button visible)
Testing
Manual QA required (no automated tests in repo). See TESTING.md for 11 comprehensive test cases covering:

First load button visibility
Button disappears on first keystroke
Results display and live updates
Reset behavior (stays in results mode)
Tab switching (preserves editing state)
Page reload (resets to button view)
Error states and validation
Dark mode compatibility
Ticket
IFDM-337: Button logic changes
IFDM-339: Text changes (dash character)

@jenbreese
jenbreese requested a review from majimmy88 September 4, 2026 17:55
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.

1 participant