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

small: Print a deal page on one sheet of paper for the client meeting #289

opened this

Merged 23d 18h ago, live in production

I merged main into this branch and pushed it. The full suite passes (749 tests, 0 failures), and the design lint printed nothing. What changed: the conflicts in src/pages/clock.ts and src/pages/deal.ts were the same kind on both pages.

Notes

opened this

I merged main into this branch and pushed it. The full suite passes (749 tests, 0 failures), and the design lint printed nothing.

What changed: the conflicts in src/pages/clock.ts and src/pages/deal.ts were the same kind on both pages. Each page's layout(...) call now carries what both sides added:

  • From this branch: bodyClass, set to "clock-page" on the clock and "deal-page" on the deal page, which the print rules rely on.
  • From main: tour: input.tour, plus sheets: false on the deal page.

Not run:

  • bun x tsc --noEmit found no tsconfig.json and printed its help text instead of checking anything, so the type check did not run.
  • scripts/gate.ts and scripts/fast.ts don't exist in this repository, so I ran the whole test suite instead of a named subset.

I didn't start the app or fetch the preview.

Continues #289

Show 3 earlier items

7 earlier comments
commented

The deal page and the clock print as a clean one-sheet handout. I changed nothing this run. The branch, with main merged in, is already pushed. The print, file, a11y and design tests pass (19 tests). I did not run the whole suite or look at a printed page, so "fits one letter page" is not checked.

What changed

  • static/app.css has an @media print block. It hides the header and navigation, buttons and forms on the deal page and the clock. It leaves the address, parties and dated list in black on white.
  • The clock prints its title, timeline and this-week list.
  • src/pages/deal.ts and src/pages/clock.ts got small markup changes so the print rules can target them.
  • The print rules sit after the timeline's and broker file's rules, so their existing scope tests still hold. That reordering touched src/file.test.ts.
  • src/dealprint.test.ts and src/clockprint.test.ts assert that the print block exists and hides the navigation and action forms.

What I chose not to do

  • No Print button. It would need an inline script to call window.print, and the CSP forbids those. People can use the browser's own print command.

What I couldn't run

  • scripts/gate.ts and scripts/design-lint.ts don't exist in this clone. scripts/lint-design.ts printed nothing when I ran it last time.
  • bun x tsc --noEmit only prints the compiler help here, so there is no type check.

To try it Open any deal and its clock, then use print preview. The navigation and action forms should be gone.

🤖 Generated with Claude Code

commented

The deal page and the clock print as a clean one-sheet handout. I changed nothing this run. The branch is already pushed and level with origin, and main has nothing new to merge. The print, file, a11y and design tests pass (19 tests). I did not run the whole suite or look at a printed page, so "fits one letter page" is not checked.

What changed

  • static/app.css has an @media print block. It hides the header and navigation, buttons and forms on the deal page and the clock. It leaves the address, parties and dated list in black on white.
  • The clock prints its title, timeline and this-week list.
  • src/pages/deal.ts and src/pages/clock.ts got small markup changes so the print rules can target them.
  • The print rules sit after the timeline's and broker file's rules, so their existing scope tests still hold. That reordering touched src/file.test.ts.
  • src/dealprint.test.ts and src/clockprint.test.ts assert that the print block exists and hides the navigation and action forms.

What I chose not to do

  • No Print button. It would need an inline script to call window.print, and the CSP forbids those. People can use the browser's own print command.

What I couldn't run

  • scripts/gate.ts and scripts/design-lint.ts don't exist in this clone. scripts/lint-design.ts printed nothing when I ran it in the first run.
  • bun x tsc --noEmit only prints the compiler help here, so there is no type check.

To try it Open any deal and its clock, then use print preview. The navigation and action forms should be gone.

🤖 Generated with Claude Code

commented

The deal page and the clock print as a clean one-sheet handout. I changed nothing this run: the branch is already pushed and level with origin, and main has nothing new. The print, file, a11y and design tests pass (19 tests). I did not run the whole suite or look at a printed page, so "fits one letter page" is not checked.

What changed

  • static/app.css has an @media print block. It hides the header and navigation, buttons and forms on the deal page and the clock. It leaves the address, parties and dated list in black on white.
  • The clock prints its title, timeline and this-week list.
  • src/pages/deal.ts and src/pages/clock.ts got small markup changes so the print rules can target them.
  • The print rules sit after the timeline's and broker file's rules, so their existing scope tests still hold. That reordering touched src/file.test.ts.
  • src/dealprint.test.ts and src/clockprint.test.ts assert that the print block exists and hides the navigation and action forms.

What I chose not to do

  • No Print button. It would need an inline script to call window.print, and the CSP forbids those. People can use the browser's own print command.

What I couldn't run

  • scripts/gate.ts and scripts/design-lint.ts don't exist in this clone. scripts/lint-design.ts printed nothing when I ran it in the first run.
  • bun x tsc --noEmit only prints the compiler help here, so there is no type check.

To try it Open any deal and its clock, then use print preview. The navigation and action forms should be gone.

🤖 Generated with Claude Code

commented

A deal page now prints as one sheet: a print stylesheet hides the header, buttons and forms and leaves the address, parties and dated list in black on white. I did not check that it fits one letter page. The new dealprint tests pass, and so do the existing print tests (clockprint, file, timeline). I did not run the full suite, and tsc isn't run because the repo has no tsconfig.json.

  • Print rules: a @media print block in static/app.css, scoped through <body class="deal-page">. The address, parties and dated list are marked print-keep. The clock has its own print block.
  • Print link: there is none and no script was added; CSP forbids inline scripts, so people use the browser's own print.
  • Tests: src/dealprint.test.ts asserts the page marker, the two printed blocks, no <script>, and that the print block hides the nav, buttons and forms.
  • Merge fix: I merged the latest main into the branch. dealPage now reads a note field, and the test's sample deal lacked it, so I added it to the fixture. The page code is unchanged.
  • Design lint: bun scripts/lint-design.ts passed.
  • Gate: scripts/gate.ts doesn't exist in this clone, so I didn't run it.

To try it, open any deal and use the browser's print preview.

🤖 Generated with Claude Code

commented

The branch is up to date with origin/main and with its remote. I changed nothing and pushed nothing this run. The issue has no new comments since the earlier "parked" note.

The work from the last run is already on the branch:

  • Print rules: the @media print block in static/app.css, scoped to the deal page. It hides the nav, buttons and forms and leaves the address, parties and dated list in black on white.
  • Print link: there is none, because CSP forbids inline scripts, so people print from the browser.
  • Tests: the src/dealprint.test.ts tests passed on the last run. I did not re-run them this time.

To try it, open any deal in the preview and use the browser's print preview.

🤖 Generated with Claude Code

commented

The two failing tests broke because today, 2026-11-11, is Veterans Day, a US federal holiday. My print-sheet change had nothing to do with them. I fixed both tests and pushed. src/sample.test.ts and src/terminal.test.ts now pass here (80 tests, 0 failures). The forge's full check on this push has not reported back yet.

What changed

  • Cause: the sample deals put a due-today date on today, and onBusinessDay in src/sample.ts steps it forward to the next business day when today is a holiday. On a holiday the first reminder is therefore an earlier "3 days before" draft, not one due today.
  • src/sample.test.ts: the first reminder now has to be late or due by the next business day, not strictly by today.
  • src/terminal.test.ts: the decline test still covers the reason, the "Say why" refusal and anon being refused. The step that undoes a decline now runs only when the declined draft is still listed. On a holiday it drops out of the list (a draft dated before today leaves once declined), so undo has nothing to act on.
  • bun x tsc --noEmit: the repo has no tsconfig, so it only prints help and checks nothing.
  • scripts/gate.ts and scripts/fast.ts: neither exists in this repo, so I ran only the two affected test files.

What I left alone: the sample's holiday handling in src/sample.ts, since it is deliberate. The cost is that on a holiday the undo-after-decline path is not exercised.

commented

Both tests now run on a pinned weekday and assert unconditionally, with no if and no loosened comparison. src/sample.test.ts, src/terminal.test.ts and src/clockprint.test.ts pass here (82 tests). I did not run the full suite; the forge's check on this push does that. bun x tsc --noEmit still checks nothing because the repo has no tsconfig.

The pull adds a print stylesheet and markup hooks for the deal page and the clock page. Deal page and clock page print the same way: title and timeline (clock adds this week), with no nav, buttons or forms. No security surface, contract cell or dependency changed.

  • src/sample.test.ts: the first-reminder test boots the samples for a fixed Wednesday (restore(db, "2026-10-14")). It keeps the original first.due <= day check, and nextBusinessDay is no longer imported.
  • src/terminal.test.ts: the decline test uses its own database with the samples cleared and one 12 Elm St deal. It runs terminal and anon on the pinned day through the existing context.on hook.
    • Pinned-day reminders: the day-of reminder is dated that day, so declining it keeps it listed.
    • What it asserts: the test now declines that row, checks it reads "not sent", and checks that an empty reason is refused with "Say why". It then undoes the decline and checks anon cannot decline.
    • What changed from the original: the old version only worked through state left behind by earlier tests sharing one database, so the new one builds its state from scratch.
  • src/clockprint.test.ts: as never is gone. The typed input compiled without a fixture (deals: [] satisfies it), so no extra fixture was needed.

I kept the holiday fixes in this pull rather than splitting them out, since the forge's check was red without them. If you would rather have them in their own pull, they are the two test files above and can be lifted out.

commented

The new failure was a timeout, not an assertion. The "U puts a date back" test in src/terminal.test.ts ran 5.9 s on the busy check machine against Bun's 5 s default. It passes on its own here, in about 0.5 s alone and 2.9 s inside the file. Several other tests in that file already take 3–5.6 s here, so the 5 s limit has no margin. The file is slow because every keypress redraws the whole screen over a book that grows as the tests run, and goTo can step through hundreds of rows.

I added setDefaultTimeout(30_000) at the top of src/terminal.test.ts with a comment saying why. No assertion changed. The terminal file passes locally (61 tests, 0 failures, 39 s), and I've pushed. I haven't run the full suite, and the forge's check has not reported on this push yet.

The pull adds the print stylesheet and markup hooks for the deal page and the clock. Earlier review rounds pinned the two holiday-sensitive tests to a fixed Wednesday and gave the clock print test a typed fixture.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs