Public: anyone can read this; the crew can change it.
Closed deals show days from contract to closing, and the year's total adds the average #295
Check · Review · Land · Live done — Landed and live in production.
Each deal in the Closed list now shows "Closed in N days", and the year's pace appears under the book line on the clock.
shipped production is serving it deploy d2eada7
Each deal in the Closed list now shows "Closed in N days", and the year's pace appears under the book line on the clock.
I ran src/pace.test.ts, the readme and leaks tests, and the book, closing and commission tests; all pass. I did not run the speed test, scripts/gate.ts or the full suite. bun x tsc --noEmit and scripts/design-lint.ts could not run: the clone has no tsconfig.json, and the design lint is scripts/lint-design.ts, which I did not run.
- New
src/pace.ts: it holds the math, with plain data in and out and no new dependency.
- Days to close: from the contract date to the day the Closing date was marked done. That is the same day the deal page calls "Closed on". It is never negative. - Year's pace: the average, rounded to a whole day, plus the fastest and slowest, over deals closed in the current year. - Excluded: fell-through and open deals have no pace. A year with no closed deals reads "No deals closed this year yet, so no average days to close." instead of NaN or 0.
src/pages/clock.ts: each Closed row gains "· Closed in N days". The pace line sits under the book line and reads "Average N days to close · fastest N days · slowest N days".- Tests (
src/pace.test.ts): they cover rounding, the average, the fastest and slowest, fell-through, open and other-year deals excluded, and the empty year. They also render the clock on the sample book and check for no NaN or undefined. - Docs:
README.mdhas the new text in "Commission and your year".docs/TECHNICAL.mdnamessrc/pace.ts, because a test requires every module insrc/to be named there.
I did not touch src/sample.ts. The samples already include three deals closed this year, so the figure shows on first boot. contract.json is unchanged.
I did not add pace to GET /api/book, the terminal or the MCP server. The issue asked only for the page, and adding it to the API would also mean regenerating contract/openapi.json.
To try it, open / on the preview. The Closed card shows "Closed in N days" on each closed deal, and the pace line sits under the book line.
🤖 Generated with Claude Code
The preview failure is fixed and pushed. Each Closed row now reads "closed Mon, Feb 2 · $612,000 · Closed in N days".
My first version put "Closed in N days" between the closing day and the price. That broke src/book.closed.test.ts, which expects the price straight after the closing day. I moved the pace to the end of the row rather than change the test. The test was right, so I left it alone.
I re-ran that test and the pace tests, then the 24 test files that mention the Closed list or the book line: 291 pass, 0 fail. I did not run the full suite, scripts/gate.ts or the type check. The clone has no tsconfig.json, so tsc --noEmit doesn't run here.
The rest of the pull is as described before: src/pace.ts, the pace line under the book line, the README and docs/TECHNICAL.md text, and no contract.json change.
🤖 Generated with Claude Code
Clean: pace math is a pure module, escaped in the page, no contract change, no new dependency, tests cover average, rounding, empty year, exclusions and the rendered sample book. The preview shows a guest view only (no deals), so the rendering was judged from the test on the sample book.
Each deal in the Closed list now shows "Closed in N days", and the year's pace appears under the book line on the clock.
I ran
src/pace.test.ts, the readme and leaks tests, and the book, closing and commission tests; all pass. I did not run the speed test,scripts/gate.tsor the full suite.bun x tsc --noEmitandscripts/design-lint.tscould not run: the clone has notsconfig.json, and the design lint isscripts/lint-design.ts, which I did not run.src/pace.ts: it holds the math, with plain data in and out and no new dependency.- Days to close: from the contract date to the day the Closing date was marked done. That is the same day the deal page calls "Closed on". It is never negative. - Year's pace: the average, rounded to a whole day, plus the fastest and slowest, over deals closed in the current year. - Excluded: fell-through and open deals have no pace. A year with no closed deals reads "No deals closed this year yet, so no average days to close." instead of NaN or 0.
src/pages/clock.ts: each Closed row gains "· Closed in N days". The pace line sits under the book line and reads "Average N days to close · fastest N days · slowest N days".src/pace.test.ts): they cover rounding, the average, the fastest and slowest, fell-through, open and other-year deals excluded, and the empty year. They also render the clock on the sample book and check for no NaN or undefined.README.mdhas the new text in "Commission and your year".docs/TECHNICAL.mdnamessrc/pace.ts, because a test requires every module insrc/to be named there.I did not touch
src/sample.ts. The samples already include three deals closed this year, so the figure shows on first boot.contract.jsonis unchanged.I did not add pace to
GET /api/book, the terminal or the MCP server. The issue asked only for the page, and adding it to the API would also mean regeneratingcontract/openapi.json.To try it, open
/on the preview. The Closed card shows "Closed in N days" on each closed deal, and the pace line sits under the book line.🤖 Generated with Claude Code
Closes #293