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

The client timeline prints as a clean one-page handout the agent can hand a buyer across the table #83

Merged opened this

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

Merged

The client timeline now has a Print button, and the print rules hide the notice toast along with the header, footer and tools. bun test passes for src/timeline.test.ts and src/server.test.ts (52 tests).

Notes

shipped production is serving it deploy d2eada7

opened this

The client timeline now has a Print button, and the print rules hide the notice toast along with the header, footer and tools. bun test passes for src/timeline.test.ts and src/server.test.ts (52 tests). I couldn't run bun scripts/design-lint.ts (the script isn't in this repo) or bun x tsc --noEmit (the run only printed tsc's help text, and I didn't check why).

  • Print button: src/pages/timeline.ts renders <button data-print hidden>Print</button> and loads a new static/print.js through asset(), so it gets the usual ?v= cache-busting. The script reveals the button and calls window.print(). There is no inline script or handler, and the CSP is unchanged. Without JavaScript the button stays hidden and the browser's own print still works.
  • Print rules: static/app.css already had a @media print block, scoped to .timeline-page. It already hid the header, footer and tools, kept each row whole with break-inside: avoid, and turned overdue to black. I added .toast to the hidden list and a screen-only rule that keeps the Print button hidden.
  • Agent contact: The page body already carries "prepared by name, brokerage" with phone and email once, and the header that repeats it is hidden in print.
  • Status marks: Each status already shows its mark plus the words Done, Upcoming or Overdue.
  • Tests: src/timeline.test.ts now checks that the Print control and print.js are served, that the print rules include the hiding and break-inside rules, and that the page has no inline script or on…= attribute. It also checks that the agent's contact and each status's mark and word are on the page. I dropped the old blanket not.toContain("<script") and "<button" assertions, since the page now legitimately has both.
  • Docs: The README's step 13 now says Print makes the handout. docs/design/areas/timeline.md names [data-print] and the Print button.

I did not touch the screen layout or the permission table.

To try it, open a deal's Client timeline, tap Print, and look at the preview.

🤖 Generated with Claude Code

Closes #79

commented

The client timeline now has a Print button, and the print rules hide the notice toast along with the header, footer and tools. bun test passes for src/timeline.test.ts and src/server.test.ts (52 tests). I couldn't run bun scripts/design-lint.ts (the script isn't in this repo) or bun x tsc --noEmit (the run only printed tsc's help text, and I didn't check why).

  • Print button: src/pages/timeline.ts renders <button data-print hidden>Print</button> and loads a new static/print.js through asset(), so it gets the usual ?v= cache-busting. The script reveals the button and calls window.print(). There is no inline script or handler, and the CSP is unchanged. Without JavaScript the button stays hidden and the browser's own print still works.
  • Print rules: static/app.css already had a @media print block, scoped to .timeline-page. It already hid the header, footer and tools, kept each row whole with break-inside: avoid, and turned overdue to black. I added .toast to the hidden list and a screen-only rule that keeps the Print button hidden.
  • Agent contact: The page body already carries "prepared by name, brokerage" with phone and email once, and the header that repeats it is hidden in print.
  • Status marks: Each status already shows its mark plus the words Done, Upcoming or Overdue.
  • Tests: src/timeline.test.ts now checks that the Print control and print.js are served, that the print rules include the hiding and break-inside rules, and that the page has no inline script or on…= attribute. It also checks that the agent's contact and each status's mark and word are on the page. I dropped the old blanket not.toContain("<script") and "<button" assertions, since the page now legitimately has both.
  • Docs: The README's step 13 now says Print makes the handout. docs/design/areas/timeline.md names [data-print] and the Print button.

I did not touch the screen layout or the permission table.

To try it, open a deal's Client timeline, tap Print, and look at the preview.

🤖 Generated with Claude Code

Approved

Clean. Print button is revealed by a static script, no inline script or handler, CSP untouched, no contract change. Print.js and the toast-hiding rule are served on the preview. Tests cover it.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs