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

Get a 'Just listed' text message to past clients to approve, short enough for one SMS, with the property page link #123

Merged opened this

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

Merged

Every listing now gets a "Text to past clients" asset (`text_message`) of at most 160 characters, property page link included. The full `bun test` run passes (426 tests, none failing). I could not run `bun x tsc --noEmit`: the clone has no `tsconfig.json`, so tsc just prints its help. There is no `scripts/gate.ts` or `scripts/fast.ts` either, so those didn't run. `scripts/lint-design.ts` ran with…

shipped production is serving it deploy 957b843

opened this

Every listing now gets a "Text to past clients" asset (text_message) of at most 160 characters, property page link included. The full bun test run passes (426 tests, none failing). I could not run bun x tsc --noEmit: the clone has no tsconfig.json, so tsc just prints its help. There is no scripts/gate.ts or scripts/fast.ts either, so those didn't run. scripts/lint-design.ts ran with no findings; scripts/design-lint.ts, the name the task gives, doesn't exist.

What changed

  • Wording: the text is in the listing's tone and starts with a "Just listed" lead on the street. It adds price, beds/baths and the first open house, dropping the last of those first until the link still fits. A street too long for even that is cut with "…". Counting is by code point (src/generate.ts).
  • Length limit: the listing shows N / 160 characters, and the live counter in static/listing.js follows it. Over 160 reads "Too long for one text by N", and the Approve button says "too long for one text". The page and the terminal won't approve it unless you say so. The API refuses unless it's sent tooLong: true, as with the MLS limit. Such an approval is audited as approved_too_long_for_text.
  • Status texts: under contract, sold, coming soon and back on market each write a text_status, labelled "Status text". They are checked, edited, approved and versioned like the other assets. They also appear in the schedule.
  • Copy: an approved text gets a Copy text button that copies it with its link. An unapproved text has no button.
  • Existing listings: draftMissingTexts in src/actions.ts adds the missing texts. The seed in src/sample.ts calls it and signs them like the other sample approvals.
  • Report, kit and API: the launch report and kit.txt list the new assets without any change to src/report.ts or src/kit.ts. contract/openapi.json lists both new kinds. The listing page has a "Text" tab. The README describes the feature, and its approved counts are updated.
  • Tests: the new src/textmessage.test.ts covers the 160 limit with a long address, each tone, the open house, over-limit approval and its audit row, the status text, and copy being absent until approval. Existing asset counts in other tests went up by one or two.

Not done: I added no new migration or table, and I did not touch contract.json. Nothing in the permission table was loosened.

Closes #117

commented

Every listing now gets a "Text to past clients" asset (text_message) of at most 160 characters, property page link included. The full bun test run passes (426 tests, none failing). I could not run bun x tsc --noEmit: the clone has no tsconfig.json, so tsc just prints its help. There is no scripts/gate.ts or scripts/fast.ts either, so those didn't run. scripts/lint-design.ts ran with no findings; scripts/design-lint.ts, the name the task gives, doesn't exist.

What changed

  • Wording: the text is in the listing's tone and starts with a "Just listed" lead on the street. It adds price, beds/baths and the first open house, dropping the last of those first until the link still fits. A street too long for even that is cut with "…". Counting is by code point (src/generate.ts).
  • Length limit: the listing shows N / 160 characters, and the live counter in static/listing.js follows it. Over 160 reads "Too long for one text by N", and the Approve button says "too long for one text". The page and the terminal won't approve it unless you say so. The API refuses unless it's sent tooLong: true, as with the MLS limit. Such an approval is audited as approved_too_long_for_text.
  • Status texts: under contract, sold, coming soon and back on market each write a text_status, labelled "Status text". They are checked, edited, approved and versioned like the other assets. They also appear in the schedule.
  • Copy: an approved text gets a Copy text button that copies it with its link. An unapproved text has no button.
  • Existing listings: draftMissingTexts in src/actions.ts adds the missing texts. The seed in src/sample.ts calls it and signs them like the other sample approvals.
  • Report, kit and API: the launch report and kit.txt list the new assets without any change to src/report.ts or src/kit.ts. contract/openapi.json lists both new kinds. The listing page has a "Text" tab. The README describes the feature, and its approved counts are updated.
  • Tests: the new src/textmessage.test.ts covers the 160 limit with a long address, each tone, the open house, over-limit approval and its audit row, the status text, and copy being absent until approval. Existing asset counts in other tests went up by one or two.

Not done: I added no new migration or table, and I did not touch contract.json. Nothing in the permission table was loosened.

Changes requested — before the latest push

Mostly sound; fix these in one round.

  1. (fix first) src/tty.ts:503 – approving an over-length text in the terminal reports "Approved, too long for X." (the ternary only knows MLS vs X). Use the text case ('one text'), same as the page's button in src/pages/listing.ts. The terminal is a door like the page; this message is false for a text.
  2. No terminal test for the text: add one in src/tty.test.ts (like the MLS one) that shows N / 160 characters, the 'Too long for one text by N. Press a again' prompt, the second a approving, and the audit outcome approved_too_long_for_text.
  3. Issue box 5 asks for a test of copy of an unapproved text being refused; the test only checks the page lacks 'Copy text'. Also assert it for text_status, and that the approved page offers the link in the copy box.
  4. Status texts are untested per tone and for Fair Housing: add a loop over TONES x (under_contract, sold with sold_price, coming_soon, back on market) asserting <=160 code points, link last, check(text).findings empty, and that the generated text_message/text_status pass check().
  5. The draftMissingTexts migration path (a listing launched before this, sample re-seed) has no test showing it adds text_message once and keeps existing approvals; add one.
  6. src/generate.ts: stray space in size(make("", [])) ; and the long address cut; tidy. Also src/openhouse.test.ts filters text_message out of the 'every asset carries the line' check, which hides the rule; instead assert the text carries the open house when it fits.
  7. README table row for src/postlength.ts still says social posts only; mention the text count.

No contract.json cell is loosened and no new dependency; good.

commented

All seven points are fixed and pushed. The full bun test run passes (430 tests, none failing). I did not run bun x tsc --noEmit because the clone has no tsconfig.json, and there is no scripts/gate.ts or scripts/fast.ts here either.

  1. Terminal message: approving an over-length text in the terminal now says "Approved, too long for one text." (src/tty.ts).
  2. Terminal test: a new test in src/tty.test.ts shows 163 / 160 characters and "Too long for one text by 3. Press a again to approve it anyway." The second a approves it, and the audit row reads approved_too_long_for_text.
  3. Copy: an approved text's copy box now holds the property page link. The new text_status test checks the same, and that an unapproved status text has no Copy text button. The refusal is only that the button is absent; no action tries to copy an unapproved text.
  4. Tones and statuses: a new loop in src/textmessage.test.ts covers every tone against under contract, sold with a price, coming soon and back on market. For text_message and text_status it checks at most 160 code points, link last, and an empty check().findings.
  5. Back-fill: a new test removes a listing's text_message and runs draftMissingTexts. The first run adds it and returns that listing's id, a second run returns nothing, and the existing MLS approval stays. I did not add a separate test of the sample re-seed. It uses the same function and only signs the new rows as sample.
  6. Tidy and open house: the stray space in src/generate.ts is gone. In src/openhouse.test.ts the "every asset carries the line" test still excludes text_message from the exact-line check, since it can't hold the full line. It now asserts the text carries Open <weekday>. I left the long-address cut logic as it was; the 160 limit test already covers it. If you meant something else by "tidy the cut", tell me which part.
  7. README: the src/postlength.ts row now mentions the MLS and text counts.
Approved

Earlier asks are met: terminal over-length message and test, copy box holds the link (tested for text and status text), tone/status loop with Fair Housing, back-fill test, open-house assertion, README row. No contract.json cell changed. Non-blocking: no tsconfig/gate in the clone so tsc was not run by the builder.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs