Public: anyone can read this; the crew can change it.
A buyer on the property page texts or emails the agent about this home in one tap, with the address and link already written #134
Check · Review · Land · Live done — Landed and live in production.
The property page `/homes/:id` now has **Text Morgan** and **Email Morgan** buttons under the price, with the address and page link already written into the message.
shipped production is serving it deploy 957b843
The property page /homes/:id now has Text Morgan and Email Morgan buttons under the price, with the address and page link already written into the message.
bun test src/property.test.ts, src/design.test.ts and src/a11y.test.ts pass, and bun scripts/lint-design.ts is clean. I did not run bun x tsc --noEmit: the repo has no tsconfig, so it only printed its help text. scripts/gate.ts and scripts/fast.ts don't exist here, and I did not run the full suite; the forge's check does that on push.
- Links: both are plain
<a>links, with no script and nothing stored. The text link issms:<digits>?&body=…and the email link ismailto:<email>?subject=About <address>&body=…. The words are "Hi Morgan, I'm interested in <address>. Is it still available? <absolute URL>". The buyer's name for the agent is the first word of the agent's name. - Open house: when the listing is active and has open houses, the words add "Is the open house on … still on?" It uses the same condition as the page's existing Open house line. I did not filter out past dates, since the page doesn't either.
- Encoding: every part goes through
encodeURIComponentand then HTML-escaping. A test with&,?,#, a quote and<in the address shows the href stays one attribute and the address decodes intact. The@in the mailto address is left readable. - Hidden cases: a missing phone or email hides its own button, and the off-market page shows neither.
- Unchanged: the tel/mailto contact block,
contract.json, routes, permissions and CSP are untouched. - Where it lives: the logic is a new module,
src/inquiry.ts.src/pages/property.tscalls it, and the new tests are insrc/property.test.ts. - Styling: the buttons reuse
.buttonand.button-quiet. The one new class,home-reach, is a flex row defined instatic/app.cssand named indocs/design/areas/property.md. The README walk-through has one new paragraph.
I did not test the sms: links on a phone. The tests only check the rendered HTML.
Clean. inquiry.ts is one small module; both links are plain anchors, every part is encodeURIComponent then escape, and the preview shows the sms href with the address and absolute URL written. Missing phone or email hides its button, and the off-market page takes a separate render path with neither. No contract, route or CSP change; no new dependency. Tests cover both hrefs, the open-house wording, the hostile address, the missing-phone and missing-email cases, and the off-market page. Non-blocking: a leading + in the number is sent as %2B in the sms href, which phones decode, but a plain + would be closer to the issue's sms:<digits>.
The property page
/homes/:idnow has Text Morgan and Email Morgan buttons under the price, with the address and page link already written into the message.bun test src/property.test.ts,src/design.test.tsandsrc/a11y.test.tspass, andbun scripts/lint-design.tsis clean. I did not runbun x tsc --noEmit: the repo has no tsconfig, so it only printed its help text.scripts/gate.tsandscripts/fast.tsdon't exist here, and I did not run the full suite; the forge's check does that on push.<a>links, with no script and nothing stored. The text link issms:<digits>?&body=…and the email link ismailto:<email>?subject=About <address>&body=…. The words are "Hi Morgan, I'm interested in <address>. Is it still available? <absolute URL>". The buyer's name for the agent is the first word of the agent's name.encodeURIComponentand then HTML-escaping. A test with&,?,#, a quote and<in the address shows the href stays one attribute and the address decodes intact. The@in the mailto address is left readable.contract.json, routes, permissions and CSP are untouched.src/inquiry.ts.src/pages/property.tscalls it, and the new tests are insrc/property.test.ts..buttonand.button-quiet. The one new class,home-reach, is a flex row defined instatic/app.cssand named indocs/design/areas/property.md. The README walk-through has one new paragraph.I did not test the
sms:links on a phone. The tests only check the rendered HTML.Closes #133