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

A buyer who opens a property page sees the agent's brand, not the Listing Launch tool's header, sign-in and developer footer #120

Merged opened this

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

Merged

`/homes/:id` now shows the agent's own header and footer instead of the tool's. This covers both the live page and the off-market page. I could not run `bun x tsc --noEmit` here, because `node_modules` has no TypeScript package and the command only printed its help text. The forge's check will be the first type check. The design lint passes (exit 0), and the 13 test files that mention `/homes/` pa…

shipped production is serving it deploy 957b843

opened this

/homes/:id now shows the agent's own header and footer instead of the tool's. This covers both the live page and the off-market page. I could not run bun x tsc --noEmit here, because node_modules has no TypeScript package and the command only printed its help text. The forge's check will be the first type check. The design lint passes (exit 0), and the 13 test files that mention /homes/ pass (137 tests).

  • Frame: it gains an optional agent field in src/pages/layout.ts. When it is set, the header is the agent's name and brokerage in their palette. The footer is "Equal Housing Opportunity", the agent's phone and email, and a small "Report a problem" link. Head metadata, Open Graph tags, the skip link and the scripts are untouched. Every other page keeps its current frame because the old header and footer are the default.
  • Back link: src/pages/property.ts passes the agent's details on both pages. When the visitor is the listing's author or an admin, one quiet "Back to the listing" link to /listings/:id appears. Anonymous and other users see no sign-in, API, terminal or notes links.
  • Equal Housing line: the page body still has its own "Equal Housing Opportunity." line above the new footer, so the phrase shows twice. I left it rather than change the body.
  • CSS and docs: static/app.css has three small classes, public-head, public-brand and public-foot. They are named in docs/design/areas/property.md.
  • New tests in src/property.test.ts: the anon page has the agent's name, "Equal Housing Opportunity" and the report link, and none of "Sign in", "/api/listings", "/notes", "/openapi.json", the terminal line or "Back to the listing". / still has all of the chrome plus /__forge/report. The author sees the back link and another user does not. The admin case is not tested.

No existing test needed changing, and I did not touch the security headers or the hero photo's size.

Closes #119

commented

/homes/:id now shows the agent's own header and footer instead of the tool's. This covers both the live page and the off-market page. I could not run bun x tsc --noEmit here, because node_modules has no TypeScript package and the command only printed its help text. The forge's check will be the first type check. The design lint passes (exit 0), and the 13 test files that mention /homes/ pass (137 tests).

  • Frame: it gains an optional agent field in src/pages/layout.ts. When it is set, the header is the agent's name and brokerage in their palette. The footer is "Equal Housing Opportunity", the agent's phone and email, and a small "Report a problem" link. Head metadata, Open Graph tags, the skip link and the scripts are untouched. Every other page keeps its current frame because the old header and footer are the default.
  • Back link: src/pages/property.ts passes the agent's details on both pages. When the visitor is the listing's author or an admin, one quiet "Back to the listing" link to /listings/:id appears. Anonymous and other users see no sign-in, API, terminal or notes links.
  • Equal Housing line: the page body still has its own "Equal Housing Opportunity." line above the new footer, so the phrase shows twice. I left it rather than change the body.
  • CSS and docs: static/app.css has three small classes, public-head, public-brand and public-foot. They are named in docs/design/areas/property.md.
  • New tests in src/property.test.ts: the anon page has the agent's name, "Equal Housing Opportunity" and the report link, and none of "Sign in", "/api/listings", "/notes", "/openapi.json", the terminal line or "Back to the listing". / still has all of the chrome plus /__forge/report. The author sees the back link and another user does not. The admin case is not tested.

No existing test needed changing, and I did not touch the security headers or the hero photo's size.

Changes requested — before the latest push

Two changes. (1) First: faceOf compares roles by hand (who.role === admin / user && id === author_id). Ask permit(who, "listing", "update", {...l}) === "yes" instead (as src/actions.ts does), so the back link follows the contract. (2) The admin case of box 3 is untested; add a test with an admin identity that sees href=/listings/:id. Also: the preview shows "Equal Housing Opportunity" twice (body line plus new footer); drop the body duplicate or the footer one so a buyer sees it once, and keep the off-market page covered by a test (anon has agent name, no Sign in, and back link for the author).

commented

I've made both changes @sentinel asked for and pushed them to this branch. src/property.test.ts and src/listings.test.ts pass. I couldn't run the type check, and the gate and design lint aren't in this repo.

  • Back link: faceOf in src/pages/property.ts now asks permit(who, "listing", "update", { ...l }) === "yes" instead of comparing roles by hand. The link therefore follows the contract. No contract cell changed.
  • Equal Housing: I removed the line from the property body, so the buyer sees it once, in the agent footer.
  • Tests (src/property.test.ts):

- An admin identity sees href="/listings/:id". The same test asserts "Equal Housing Opportunity" appears exactly once. - The off-market page test withdraws the listing. Anon sees the agent name and "no longer on the market", with no "Sign in" and no back link. The author still gets the back link. - To support the admin case, the test helpers as and call now take an optional role.

  • Not run here:

- bun x tsc --noEmit fetched a standalone tsc that printed its help text, because the repo has no TypeScript dependency or tsconfig. - scripts/gate.ts, scripts/fast.ts and scripts/design-lint.ts don't exist in this clone; scripts/lint-design.ts does, and I didn't run it.

The forge's check will run the full suite on this push.

🤖 Generated with Claude Code

Approved

Both earlier asks are met: the back link now goes through permit (no hand-compared roles, no contract cell changed), and Equal Housing shows once. Admin and off-market cases are tested. Preview /homes/1 anon shows no Sign in, API or terminal chrome and one Equal Housing line.

commented

Left #119 open: 1 unticked item remain (Frame in src/pages/layout.ts gains a public variant (e.g. kind: "public" or a face field) that keeps the head metadata, tokens, Open Graph and the skip link, and swaps the header and footer: the header carries the agent's name and brokerage (from the listing, in its palette) in place of the app name, tagline, env pill, commit and Sign in; the footer carries only "Equal Housing Opportunity", the agent's contact line, and the small "Report a problem" link.).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs