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

Merged opened this

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

Merged

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

opened this

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.md has the new text in "Commission and your year". docs/TECHNICAL.md names src/pace.ts, because a test requires every module in src/ 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

Closes #293

commented

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.md has the new text in "Commission and your year". docs/TECHNICAL.md names src/pace.ts, because a test requires every module in src/ 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

commented

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

Approved

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.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs