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

Type your details once: a new listing's form starts with the agent's name, brokerage, license, phone, email, colours and headshot from their last listing #71

Merged opened this

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

Merged

The new-listing form on `/` now starts with the agent's name, brokerage, license, phone, email and colour from their most recent listing. The branch is pushed. I did not run `bun x tsc --noEmit`: the repo has no TypeScript dependency, so `bun x tsc` pulled an unrelated package that only printed help. The listed tests pass and `bun run lint:design` printed no findings; I did not run the full suite.…

shipped production is serving it deploy 957b843

opened this

The new-listing form on / now starts with the agent's name, brokerage, license, phone, email and colour from their most recent listing. The branch is pushed. I did not run bun x tsc --noEmit: the repo has no TypeScript dependency, so bun x tsc pulled an unrelated package that only printed help. The listed tests pass and bun run lint:design printed no findings; I did not run the full suite. Anon visitors, people with no listings, and other users see the form empty as before.

Most of this already existed: the form was prefilled from the person's last listing, and a launch with no new headshot already reused the last one. Three things were missing, and I changed those:

  • Search bug: the last listing was taken from the search-filtered list, so typing a search on / emptied the form. src/agent.ts now reads the signed-in person's own newest listing directly (lastListing), so a search no longer loses it.
  • Headshot note: headshotFrom in the same file finds the listing the reused headshot comes from, only when its file still exists. The headshot field now reads "Using your headshot from 412 Alder Lane — choose a file to replace it". Otherwise it keeps the old "optional; your last one carries over" hint.
  • Wiring: src/routes.ts calls both helpers, and src/pages/home.ts takes the new input and escapes the address.

The README's agent section now says the form remembers your details.

Tests:

  • src/prefill.test.ts (new): prefill for the author, with every field still editable; the prefill survives a search; another user, a newcomer and anon see the form empty; a listing launched without a headshot ends up with the same file as the one before it.
  • src/hostile.test.ts: the hostile brokerage is checked in the value attribute of /, escaped.
  • Speed test: still passes.

I did not touch contract.json, so no policy cell changes. Headshot reuse needed no new file copy: the new listing points at the existing file under FORGE_APP_DATA, so there is no new write to keep atomic.

To try it: sign in, launch a listing with a headshot, then open / on the preview and the details and the headshot note are there.

Closes #62

commented

The new-listing form on / now starts with the agent's name, brokerage, license, phone, email and colour from their most recent listing. The branch is pushed. I did not run bun x tsc --noEmit: the repo has no TypeScript dependency, so bun x tsc pulled an unrelated package that only printed help. The listed tests pass and bun run lint:design printed no findings; I did not run the full suite. Anon visitors, people with no listings, and other users see the form empty as before.

Most of this already existed: the form was prefilled from the person's last listing, and a launch with no new headshot already reused the last one. Three things were missing, and I changed those:

  • Search bug: the last listing was taken from the search-filtered list, so typing a search on / emptied the form. src/agent.ts now reads the signed-in person's own newest listing directly (lastListing), so a search no longer loses it.
  • Headshot note: headshotFrom in the same file finds the listing the reused headshot comes from, only when its file still exists. The headshot field now reads "Using your headshot from 412 Alder Lane — choose a file to replace it". Otherwise it keeps the old "optional; your last one carries over" hint.
  • Wiring: src/routes.ts calls both helpers, and src/pages/home.ts takes the new input and escapes the address.

The README's agent section now says the form remembers your details.

Tests:

  • src/prefill.test.ts (new): prefill for the author, with every field still editable; the prefill survives a search; another user, a newcomer and anon see the form empty; a listing launched without a headshot ends up with the same file as the one before it.
  • src/hostile.test.ts: the hostile brokerage is checked in the value attribute of /, escaped.
  • Speed test: still passes.

I did not touch contract.json, so no policy cell changes. Headshot reuse needed no new file copy: the new listing points at the existing file under FORGE_APP_DATA, so there is no new write to keep atomic.

To try it: sign in, launch a listing with a headshot, then open / on the preview and the details and the headshot note are there.

Changes requested — before the latest push

Works as described and nothing is loosened in contract.json. One fix: the headshot rule now lives in two places that can disagree. Make src/actions.ts (~line 641, the "last one carries over" query) use the helper in src/agent.ts, so the form note and the launch always name the same file. Also run bun x tsc --noEmit and say how it came out. The rest is fine: author-only prefill, escaping, tests, README.

the crew's run was interrupted: restart, resumes on the next pass — cancelled
commented

The new-listing form on / now starts with the agent's name, brokerage, license, phone, email and colour from their last listing. The headshot carries over too, and the form says whose it is. Each of these is still editable, and anon visitors, newcomers and other users see the form empty.

Most of this already existed. The form was already prefilled from the person's last listing, and a launch with no new headshot already reused the last one. I changed three things:

  • Search bug: the form took its prefill from the search-filtered list, so typing a search on / emptied it. lastListing in src/agent.ts now reads the signed-in person's own newest listing directly.
  • Headshot note: the headshot field reads "Using your headshot from 412 Alder Lane — choose a file to replace it". Otherwise it keeps the old "optional; your last one carries over" hint.
  • Wiring: src/routes.ts calls both helpers, and src/pages/home.ts takes the new input and escapes the address.

Review fix (sentinel, Medium): the form and the launch could disagree when the headshot file was gone. The form hid the note, but the launch still pointed the new listing at the missing file. Both now read one helper, headshotFrom in src/agent.ts. It returns the file name and the source address, and only if the file still exists. launch in src/actions.ts calls it in place of its own query.

Tests:

  • src/prefill.test.ts covers the author's prefill and that it survives a search. It also covers the empty form for another user, a newcomer and anon, and that a launch without a headshot reuses the previous file.
  • It has a new case where the photo files are deleted. The note disappears, and the next launch's flyer has no headshot.
  • src/hostile.test.ts checks the hostile brokerage is escaped in the value attribute of /.
  • The prefill and hostile tests pass (22 tests).
  • bun x tsc --noEmit is not run: the repo has no TypeScript dependency, so it only prints help.
  • I did not run the full suite or scripts/gate.ts; the forge runs the full check on the push.

I did not touch contract.json, so no policy cell changes. The README's agent section now says the form remembers your details.

To try it: sign in, launch a listing with a headshot, then open / on the preview. The details and the headshot note are there.

Closes #62

🤖 Generated with Claude Code

Approved

My earlier ask (form and launch disagreeing when the headshot file is gone) is met: both now read headshotFrom in src/agent.ts, which only returns a headshot whose file still exists, and a new test deletes the photo files and checks both the note and the next flyer. Prefill reads only the signer-authored rows by who.id and anon gets nothing. The address is escaped and the hostile brokerage is asserted in the value attribute. contract.json is untouched. No new dependency. The preview answers 200.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs