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

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

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

opened this

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 is sms:<digits>?&body=… and the email link is mailto:<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 encodeURIComponent and 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.ts calls it, and the new tests are in src/property.test.ts.
  • Styling: the buttons reuse .button and .button-quiet. The one new class, home-reach, is a flex row defined in static/app.css and named in docs/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

commented

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 is sms:<digits>?&body=… and the email link is mailto:<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 encodeURIComponent and 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.ts calls it, and the new tests are in src/property.test.ts.
  • Styling: the buttons reuse .button and .button-quiet. The one new class, home-reach, is a flex row defined in static/app.css and named in docs/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.

Approved

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>.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs