Commit Graph

4 Commits

Author SHA1 Message Date
Jeff Emmett 7a1ffbe635 feat(rlending): extract mortgage simulator + /api/mortgage from rFlows
- New modules/rlending/ with moved folk-mortgage-simulator, mortgage-engine,
  mortgage-types; page route at / renders the simulator
- /api/mortgage/rates + /api/mortgage/positions (GET+POST) moved to rLending;
  Aave v3 live rate lookup unchanged
- FlowsDoc schema stays in rFlows (mortgagePositions + reinvestmentPositions fields);
  rLending reads/writes via imported ensureFlowsDoc + flowsDocId + FlowsDoc types
- rFlows: export ensureFlowsDoc (renamed from ensureDoc); drop mortgage API routes,
  /mortgage page route, mortgageScripts, seed block, subPageInfos mortgage entry
- folk-flows-app: mortgage fetches now target /rlending/api/mortgage/* via a derived
  lendingBase (keeps the rPool dashboard in rFlows working unchanged)
- Display: rLending (🏦) added to module-display, rstack-app-switcher (Commerce),
  rstack-tab-bar (Funding & Commerce), e2e/fixtures/module-list
- Vite: folk-mortgage-simulator build repointed to modules/rlending/ with aliases
  resolving to modules/rlending/lib/mortgage-{types,engine}
2026-04-18 14:42:36 -04:00
Jeff Emmett 99492cc532 feat: extend browser back button support to all rApp modules with view navigation
Adds ViewHistory integration to 9 additional modules (rtime, rswag, rwallet,
rbnb, rvnb, rnetwork, crowdsurf, rtube, rflows-mortgage), bringing the total
to 17 modules. Browser back now navigates within the current rApp tab before
falling through to tab switching.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 17:48:31 -04:00
Jeff Emmett ac332468ba fix(rflows): mortgage simulator perf + basic/advanced toggle
Fix event listener accumulation (duplicate handlers on every render),
add partial DOM updates for playback/scrubbing/interactions, debounce
config slider recompute via rAF, and add Basic/Advanced mode toggle
that hides advanced controls (tranches, interest, terms, overpayment,
reinvestment) by default. Also fix pre-existing TS Map iteration errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-06 18:31:04 -04:00
Jeff Emmett 391d3a0cb6 feat(rflows): port distributed mortgage simulator from rfunds-online
Replaces the simple lending pool dashboard at /mortgage with the full
rfunds-online mortgage simulator. Models community-funded mortgages with
80+ tranches, variable terms, reinvestment loops, secondary markets,
and 5 visualization modes (Network, Flow, Grid, Lender calc, Borrower calc).

New files:
- mortgage-types.ts & mortgage-engine.ts (pure TS, copied verbatim)
- folk-mortgage-simulator.ts (1639-line web component, all views)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-06 14:10:59 -04:00