Public: anyone can read this; the crew can change it.
The property page shows an estimated monthly payment for the home, with its assumptions in plain words #101
Check · Review · Land · Live done — Landed and live in production.
Active and coming-soon property pages now show "Est. $X/mo" under the price, with one line of assumptions. A $500,000 home reads "Est. $2,528/mo".
shipped production is serving it deploy 957b843
Active and coming-soon property pages now show "Est. $X/mo" under the price, with one line of assumptions. A $500,000 home reads "Est. $2,528/mo".
- New module:
src/payment.tsis pure.monthlyPayment(price)returns principal and interest per month in whole dollars, rounded to the nearest dollar. It returnsnullfor a missing, $0, negative or non-finite price. The assumptions are named constants:DOWN_PAYMENT20%,TERM_YEARS30 andANNUAL_RATE6.5%. The 6.5% is a sample rate with no rate feed, so it is a placeholder someone should confirm. - Wording:
PAYMENT_NOTEreads "Principal and interest at 20% down, a 30-year fixed rate of 6.5%. An estimate, not a loan offer." - Page:
src/pages/property.tsshows the estimate only foractiveandcoming_soon. Under contract, sold, withdrawn and expired pages show none, and the off-market page is untouched. The two new classes,home-paymentandhome-payment-note, are named indocs/design/areas/property.md. - Tests:
- src/payment.test.ts checks known prices to the dollar, rounding, the null cases and the note's wording.
- src/property.test.ts checks the line appears on the active page and not on the sold one.
- payment.test.ts, property.test.ts and design.test.ts pass, 25 tests.
- README: a short paragraph in the agent section says what the line means.
- Not run:
scripts/gate.tsandscripts/design-lint.tsdon't exist in this repo.scripts/lint-design.tsran and printed nothing.bun x tsc --noEmitprinted its usage text instead of checking, becausetypescriptisn't installed andbun installdidn't add it. I did not run the full suite or the speed test; the forge's check runs them on the push. - Contract: no cell changes.
To try it, approve a listing's MLS description, then open /homes/:id. Marking the listing sold removes the estimate.
🤖 Generated with Claude Code
The feature works and the maths checks out ($500,000 gives $2,528). One thing to fix first: the status gate is not tested where it matters. A sold page is not off-market, so it goes through the same propertyPage path. The only test of the gate is the sold one. Nothing proves that coming_soon shows the line or that under_contract hides it. Removing the active || coming_soon check would still pass most of it. Add both cases, plus a test that a $0 price shows nothing on the page. Also fix the wrong comment in payment.test.ts. Everything else is clean: no contract change, no dependency, the new classes are named in the area doc, and the README covers it.
I added the status-gate tests @sentinel asked for and corrected the wrong comment. I ran src/property.test.ts and src/payment.test.ts: 20 pass, 0 fail.
Changes since the last push (tests and a comment only; app code is untouched):
src/property.test.ts: three new tests, each on a page an anonymous visitor sees after the listing's page words are approved.
- A coming-soon page shows "Est. $" and "not a loan offer". - An under-contract page shows neither. - A listing with a $0 price shows no estimate.
src/payment.test.ts:9: the comment now reads "200,000 financed -> 1264.14". The assertion was already correct at 1264, since the true figure rounds down. I did not change the price.
I did not run a mutation check by removing the active || coming_soon gate. The tests exercise that gate, but I haven't seen them fail without it.
I did not run bun x tsc --noEmit. The repository has no tsconfig.json, so tsc just prints its help text. bun install also rewrote the lockfile in my working tree; I left that out of the commit.
To try it: bun test src/property.test.ts src/payment.test.ts.
🤖 Generated with Claude Code
Both earlier asks are met. The coming-soon, under-contract and $0-price page tests now exercise the status gate, and the payment.test.ts comment is corrected. Rounding is still shown by the 100k and 300k cases. No contract cell changed, there is no new door or write, and the note is escaped. Non-blocking: the 6.5% sample rate should be confirmed by a person.
Active and coming-soon property pages now show "Est. $X/mo" under the price, with one line of assumptions. A $500,000 home reads "Est. $2,528/mo".
src/payment.tsis pure.monthlyPayment(price)returns principal and interest per month in whole dollars, rounded to the nearest dollar. It returnsnullfor a missing, $0, negative or non-finite price. The assumptions are named constants:DOWN_PAYMENT20%,TERM_YEARS30 andANNUAL_RATE6.5%. The 6.5% is a sample rate with no rate feed, so it is a placeholder someone should confirm.PAYMENT_NOTEreads "Principal and interest at 20% down, a 30-year fixed rate of 6.5%. An estimate, not a loan offer."src/pages/property.tsshows the estimate only foractiveandcoming_soon. Under contract, sold, withdrawn and expired pages show none, and the off-market page is untouched. The two new classes,home-paymentandhome-payment-note, are named indocs/design/areas/property.md.-
src/payment.test.tschecks known prices to the dollar, rounding, the null cases and the note's wording. -src/property.test.tschecks the line appears on the active page and not on the sold one. -payment.test.ts,property.test.tsanddesign.test.tspass, 25 tests.scripts/gate.tsandscripts/design-lint.tsdon't exist in this repo.scripts/lint-design.tsran and printed nothing.bun x tsc --noEmitprinted its usage text instead of checking, becausetypescriptisn't installed andbun installdidn't add it. I did not run the full suite or the speed test; the forge's check runs them on the push.To try it, approve a listing's MLS description, then open
/homes/:id. Marking the listing sold removes the estimate.🤖 Generated with Claude Code
Closes #95