Public: anyone can read this; the crew can change it.

A property page link pasted into a text or a post previews the home: its address, price, facts and hero photo #91

opened this

Merged 32d 19h ago, live in production

A link to /homes/:id now previews the home itself: its address, price, facts and hero photo. The tests I ran pass: property, hostile, offmarket, security, a11y, design, deps, walkthrough and speed. bun x tsc --noEmit printed only tsc's help text because the repo has no tsconfig.json, so it didn't type-check.

Notes

opened this

A link to /homes/:id now previews the home itself: its address, price, facts and hero photo. The tests I ran pass: property, hostile, offmarket, security, a11y, design, deps, walkthrough and speed. bun x tsc --noEmit printed only tsc's help text because the repo has no tsconfig.json, so it didn't type-check. The repo has no scripts/gate.ts or scripts/fast.ts, and I did not run the full suite. I did not try the app against a real iMessage, Facebook or LinkedIn card.

What changed

  • src/pages/layout.ts: Frame takes an optional description, image (absolute URL plus alt text) and shareTitle. Pages that pass none keep today's tags exactly. With an image, it adds og:image, og:image:alt and twitter:image, and twitter:card becomes summary_large_image. The CSP and the other security headers are untouched.
  • src/pages/property.ts:
    • og:title and twitter:title are "address · price".
    • The meta, og: and twitter: descriptions are the facts line plus the first sentence of the approved MLS words. An unapproved draft contributes nothing, and og:type stays website.
    • The image is the hero photo on the public origin, with that photo's description as alt text. A listing with no photo gets no image tags.
    • A withdrawn or expired listing's title is the address alone and its description is "This home is no longer available." It has no price and no facts.
  • Tests:
    • src/property.test.ts: the tags for the sample listing with a hero photo, no draft words in the tags, no image tags without a photo, and the off-market preview.
    • src/hostile.test.ts: /homes/:id is added to the meta-escaping check, plus a test that the hostile address stays inert inside the title and description attributes.
  • README.md: a note that the sample photos are SVG, which some networks ignore on a card, so those previews show text only. I did not convert images or add a dependency.

Things to look at

  • The facts line in the description is the app's existing factsLine, so it also carries lot and year ("3 bd · 2.5 ba · 2,140 sq ft · 0.18 acre lot · built 1928"), not just the three facts in the issue's example.
  • No role in the permission table was loosened.

Closes #84

commented

A link to /homes/:id now previews the home itself: its address, price, facts and hero photo. The tests I ran pass: property, hostile, offmarket, security, a11y, design, deps, walkthrough and speed. bun x tsc --noEmit printed only tsc's help text because the repo has no tsconfig.json, so it didn't type-check. The repo has no scripts/gate.ts or scripts/fast.ts, and I did not run the full suite. I did not try the app against a real iMessage, Facebook or LinkedIn card.

What changed

  • src/pages/layout.ts: Frame takes an optional description, image (absolute URL plus alt text) and shareTitle. Pages that pass none keep today's tags exactly. With an image, it adds og:image, og:image:alt and twitter:image, and twitter:card becomes summary_large_image. The CSP and the other security headers are untouched.
  • src/pages/property.ts:
    • og:title and twitter:title are "address · price".
    • The meta, og: and twitter: descriptions are the facts line plus the first sentence of the approved MLS words. An unapproved draft contributes nothing, and og:type stays website.
    • The image is the hero photo on the public origin, with that photo's description as alt text. A listing with no photo gets no image tags.
    • A withdrawn or expired listing's title is the address alone and its description is "This home is no longer available." It has no price and no facts.
  • Tests:
    • src/property.test.ts: the tags for the sample listing with a hero photo, no draft words in the tags, no image tags without a photo, and the off-market preview.
    • src/hostile.test.ts: /homes/:id is added to the meta-escaping check, plus a test that the hostile address stays inert inside the title and description attributes.
  • README.md: a note that the sample photos are SVG, which some networks ignore on a card, so those previews show text only. I did not convert images or add a dependency.

Things to look at

  • The facts line in the description is the app's existing factsLine, so it also carries lot and year ("3 bd · 2.5 ba · 2,140 sq ft · 0.18 acre lot · built 1928"), not just the three facts in the issue's example.
  • No role in the permission table was loosened.
Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs