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

Each deal shows how far along it is, as "4 of 7 dates done · closes in 12 days", on the clock and its page #87

Merged opened this

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

Merged

Each deal now shows how far along it is, as "4 of 7 dates done · 1 overdue · closes Nov 22, in 12 days". It appears on the clock lane head, at the top of the deal page's #deal section, and in GET /api/deals/:id as progress. The full bun test run passes (278 tests, including speed.test.ts).

Notes

shipped production is serving it deploy d2eada7

opened this

Each deal now shows how far along it is, as "4 of 7 dates done · 1 overdue · closes Nov 22, in 12 days". It appears on the clock lane head, at the top of the deal page's #deal section, and in GET /api/deals/:id as progress. The full bun test run passes (278 tests, including speed.test.ts).

What changed

  • src/progress.ts has one function, progress(deal, on). It returns {done, total, overdue, days_to_closing} as plain data. A removed date is no longer a row, so it isn't counted. A reopened date lowers done again.
  • src/pages/progress.ts holds the text and the bar, so the clock and the deal page share one renderer. The text carries the meaning and the bar is aria-hidden. A closed deal reads "All done · closed <date>". "· K overdue" appears only when K > 0.
  • src/routes.ts wraps the deal answer with progress, and contract/openapi.json is regenerated. The route reads only the one deal, so there is no extra query per deal. The clock computes it from the deals it already loaded.
  • The bar has a fixed height (.progress-bar in static/app.css), so live updates don't shift the layout. The new CSS sits before the @media print block because timeline.test.ts requires everything after that point to be scoped to the timeline page.
  • The new classes are named in docs/design/areas/clock.md.
  • src/progress.test.ts covers no dates, some overdue, removed and reopened dates, and closed. It also checks that the clock and the deal page render the line and the bar. src/server.test.ts checks the API's progress object.

Live update: I put the line inside the deal page's existing #deal section, which already has data-live="deal.changed". It refreshes with the rest of the page. I did not exercise the live refresh itself.

Not run

  • bun scripts/gate.ts and bun scripts/design-lint.ts do not exist in this clone.
  • tsc --noEmit has no tsconfig.json to run against.

I did not touch contract.json or loosen any role.

🤖 Generated with Claude Code

Closes #81

commented

Each deal now shows how far along it is, as "4 of 7 dates done · 1 overdue · closes Nov 22, in 12 days". It appears on the clock lane head, at the top of the deal page's #deal section, and in GET /api/deals/:id as progress. The full bun test run passes (278 tests, including speed.test.ts).

What changed

  • src/progress.ts has one function, progress(deal, on). It returns {done, total, overdue, days_to_closing} as plain data. A removed date is no longer a row, so it isn't counted. A reopened date lowers done again.
  • src/pages/progress.ts holds the text and the bar, so the clock and the deal page share one renderer. The text carries the meaning and the bar is aria-hidden. A closed deal reads "All done · closed <date>". "· K overdue" appears only when K > 0.
  • src/routes.ts wraps the deal answer with progress, and contract/openapi.json is regenerated. The route reads only the one deal, so there is no extra query per deal. The clock computes it from the deals it already loaded.
  • The bar has a fixed height (.progress-bar in static/app.css), so live updates don't shift the layout. The new CSS sits before the @media print block because timeline.test.ts requires everything after that point to be scoped to the timeline page.
  • The new classes are named in docs/design/areas/clock.md.
  • src/progress.test.ts covers no dates, some overdue, removed and reopened dates, and closed. It also checks that the clock and the deal page render the line and the bar. src/server.test.ts checks the API's progress object.

Live update: I put the line inside the deal page's existing #deal section, which already has data-live="deal.changed". It refreshes with the rest of the page. I did not exercise the live refresh itself.

Not run

  • bun scripts/gate.ts and bun scripts/design-lint.ts do not exist in this clone.
  • tsc --noEmit has no tsconfig.json to run against.

I did not touch contract.json or loosen any role.

🤖 Generated with Claude Code

Approved

Clean. One progress() function feeds the clock lane, the deal page and GET /api/deals/:id (progress object, in openapi.json). Output is escaped, the bar is aria-hidden, no contract cell changed, and the terminal does not show deals so there is no second door to update. Nit: a stray blank line at the end of src/progress.test.ts. The live refresh relies on the existing deal.changed region and the clock lane was not exercised live; acceptable.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs