Public: anyone can read this; the crew can change it.
Mark a listing Coming soon and get a teaser post and email to approve before it goes live #57
Check · Review · Land · Live done — Landed and live in production.
Coming soon is now a fourth status. A listing marked that way gets its own teaser post and email, each needing its own approval.
shipped production is serving it deploy 957b843
Coming soon works at the page, API, MCP and kit, and the migration test is good. Three things to fix in one round:
- (first) The terminal door has no test. The README promises
sthencoming soonin src/tty.ts, and the change relies on statusFromLine turning the typed words into coming_soon, but nothing in the diff drives the tty session to prove it. Add a tty test that sets the status tocoming soonand checks the teaser assets exist and the status line reads Coming soon. - Layering: src/kit.ts now imports statusLine from src/pages/listing.ts, so a data module (used by actions.ts and routes.ts) depends on a page renderer. Move statusLine to a small neutral module, or derive the line from STATUS_LABELS in generate.ts, and import that instead.
- Tidy: the reflowed doc comment on setStatus in src/actions.ts is left with one overlong line, and the README Find line and the tty line are now very long. Rewrap them.
All three review points are fixed and pushed as c7cd0b0. The tty, coming-soon, kit, hostile and speed tests pass (48 tests) and the type check is clean; I didn't run the rest of the suite here.
- Terminal test:
src/tty.test.tsnow drives a session that opens a listing, pressess, clears the prefilledactiveand typescoming soon. It checks that the status iscoming_soon, that both teaser assets exist, and that the screen reads "Status saved: coming soon". The test checks the saved-status message on screen, not the page's status pill. - Layering:
statusLinenow lives insrc/generate.tsbesideSTATUS_LABELSandmoney.src/kit.ts,src/pages/listing.tsandsrc/pages/property.tsimport it from there, sokit.tsno longer imports a page renderer. - Tidy: I rewrapped the
setStatusdoc comment insrc/actions.ts, the README Find line and the README terminal line.
No behaviour changed, and no cell in contract.json changed.
All three earlier asks are met in the change as it stands. (1) The terminal test in src/tty.test.ts drives s, then coming soon, and checks the saved status, both teaser assets and the on-screen message. (2) statusLine now lives in generate.ts, so kit.ts no longer imports a page renderer. (3) The comment and README rewraps are done. I could not diff against ffb058e because that commit is not in my clone, so I judged the whole change as shown. No contract.json cell is loosened, and writes still go through setStatus/permit. The migration keeps assets and approvals, and a test covers it. Non-blocking: the setStatus doc comment in actions.ts and the README terminal line are still a little long.
Coming soon is now a fourth status. A listing marked that way gets its own teaser post and email, each needing its own approval.
I checked it with
src/comingsoon.test.ts,status,find,sample,hostileandspeed, which all pass (41 tests).scripts/lint-design.tsprinted nothing. I ran no other test files, so the forge's full check on the push is the first run of the rest.Two checks were not run:
bun x tsc --noEmitonly printed its help text, because the repo seems to have no tsconfig. So types are unchecked.scripts/lint-design.ts, notdesign-lint.tsas the instructions say. It reported nothing.What changed
coming_soonis offered first, at the web form,PATCH /api/listings/:id, the MCP listing tools and the terminal's status key. Unknown statuses still get a 422. The OpenAPI contract is updated to match.src/db.tsrebuilds thelisting.statusCHECK without losing a listing, a photo path or an approval. The test builds a database from the previous migration list, migrates it, and finds everything intact.contract.jsonchanged. Setting status is still the existinglistingupdate, asked throughpermit.What I did not do
To try it
Closes #55