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

A lead's page prints as a one-page brief to take to a showing: who they are, what they asked, the private note, the next showing and the last few messages #105

Merged opened this

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

Merged

A lead's page now prints as a one-page brief, and a "Print brief" link on the page opens it. Checks. The new src/brief.test.ts passes, along with the notes, report, design, readme and server suites.

Notes

shipped production is serving it deploy aba151a

opened this

A lead's page now prints as a one-page brief, and a "Print brief" link on the page opens it.

Checks. The new src/brief.test.ts passes, along with the notes, report, design, readme and server suites. bun scripts/lint-design.ts is clean; the repo has no scripts/design-lint.ts, so I ran that one. bun x tsc --noEmit only printed tsc's help text (no tsconfig), so there was no type check. scripts/gate.ts and scripts/fast.ts don't exist here. I did not run the full suite or open the print preview in a browser.

What changed

  • The brief. briefCard in src/pages/lead.ts renders it.

- Contents: name, email, phone, text consent, source, the next showing (address and time in the agent's time zone), what they first asked, the private note, the last three messages with dates, and the agent's name, brokerage and license at the foot. - Screen: it is display: none, so nothing shifts. - Print: a new @media print block in static/app.css hides every other part of the lead page, so the buttons, forms, drafts editor and follow-up controls never reach paper. The existing print block is untouched and report.test.ts still passes.

  • The link. "Print brief" is a plain link to /leads/N?print=1, which shows the brief on screen in place of the desk. static/print.js, a small same-origin module, turns the click into the browser's print dialog. There is no inline script.
  • Docs. The new classes .brief and .printing are documented in docs/design/areas/lead.md, and there is a paragraph in the README about printing the brief.
  • Private note. I changed nothing about who can read a lead. Signed-out visitors are refused the lead, so the note is only in a page a signed-in reader gets. A test checks this.

Chose not to

  • No new dependency.
  • Brief messages are cut at 280 characters so they stay on one sheet.

To try it. Sign in, open a lead and press "Print brief". Or open /leads/N?print=1 and use the browser's print preview.

Closes #99

commented

A lead's page now prints as a one-page brief, and a "Print brief" link on the page opens it.

Checks. The new src/brief.test.ts passes, along with the notes, report, design, readme and server suites. bun scripts/lint-design.ts is clean; the repo has no scripts/design-lint.ts, so I ran that one. bun x tsc --noEmit only printed tsc's help text (no tsconfig), so there was no type check. scripts/gate.ts and scripts/fast.ts don't exist here. I did not run the full suite or open the print preview in a browser.

What changed

  • The brief. briefCard in src/pages/lead.ts renders it.

- Contents: name, email, phone, text consent, source, the next showing (address and time in the agent's time zone), what they first asked, the private note, the last three messages with dates, and the agent's name, brokerage and license at the foot. - Screen: it is display: none, so nothing shifts. - Print: a new @media print block in static/app.css hides every other part of the lead page, so the buttons, forms, drafts editor and follow-up controls never reach paper. The existing print block is untouched and report.test.ts still passes.

  • The link. "Print brief" is a plain link to /leads/N?print=1, which shows the brief on screen in place of the desk. static/print.js, a small same-origin module, turns the click into the browser's print dialog. There is no inline script.
  • Docs. The new classes .brief and .printing are documented in docs/design/areas/lead.md, and there is a paragraph in the README about printing the brief.
  • Private note. I changed nothing about who can read a lead. Signed-out visitors are refused the lead, so the note is only in a page a signed-in reader gets. A test checks this.

Chose not to

  • No new dependency.
  • Brief messages are cut at 280 characters so they stay on one sheet.

To try it. Sign in, open a lead and press "Print brief". Or open /leads/N?print=1 and use the browser's print preview.

Approved

Clean: the brief is escaped on every field, hidden on screen, and the print rules hide the header, footer and every other part of the lead page. The link is plain and print.js is same-origin with no inline script. No contract cell changes, and reads are still gated by the existing lead page. Nit for later: BRIEF_WORDS counts characters, not words.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs