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

Closed deals from earlier years fold into one line per year so a long book stays quick to read #321

opened this

Parked 20d 17h ago

Earlier years in the Closed list now fold into one per year, e.g. "2025 · 14 closed · $5,120,000 · commission $128,000". This year's closed and fell-through deals list as before.

Notes

opened this

Earlier years in the Closed list now fold into one <details> per year, e.g. "2025 · 14 closed · $5,120,000 · commission $128,000". This year's closed and fell-through deals list as before.

What changed

  • src/years.ts (new, pure) groups settled deals by the year of the day the Closing date was marked done, or the day the deal fell through. Both days are already in the agent's timezone. Earlier years come newest first.
  • src/pages/clock.ts renders the Closed card from that grouping. The row markup moved unchanged into a closedList helper, so opening a year shows exactly what the list showed before (price, "Closed in N days"). The summaries need no JavaScript.
  • When Find, side or closing narrows the clock, every year that still has a match opens. Find still searches all years.
  • A year's price and commission figures appear only for deals that carry them. Fell-through deals add " · N fell through" to the line and are left out of the money totals.
  • The year-pace and totals lines, the "Closed · N" count and the CSV link are unchanged.
  • Docs: static/app.css gets .closed-year, listed in docs/design/areas/clock.md. There is a README line under "Commission and your year" and a note in docs/TECHNICAL.md.

Tests

  • src/years.test.ts covers the 2025/2026 year boundary, the figures-only-when-carried rule, and Find opening a matching year.
  • With the change in place, src/speed.test.ts (200 deals), readme.test.ts and design.test.ts pass. bun scripts/lint-design.ts printed no complaints.

Not done or not checked

  • bun x tsc --noEmit only printed tsc's usage text because the repo has no tsconfig.json, so there was no type check. scripts/gate.ts and scripts/fast.ts don't exist here either.
  • I did not run the full suite. In the ten or so files I ran that touch the clock, the only failure was sample.test.ts ("on a fresh boot the first reminder for today…"), and it fails the same way on the base branch without my change.
  • The first run of speed.test.ts went over budget while bun install was running in the background. It passed on the rerun.
  • I didn't change the contract or add a migration, and I didn't add a "show/hide all years" control.

To try it Open / with deals closed in earlier years. The preview for this pull shows the folded years. Searching a word from an old deal's address opens its year.

Closes #312

6 earlier comments · 1 event
commented

Earlier years in the Closed list now fold into one <details> per year, e.g. "2025 · 14 closed · $5,120,000 · commission $128,000". This year's closed and fell-through deals list as before.

What changed

  • src/years.ts (new, pure) groups settled deals by the year of the day the Closing date was marked done, or the day the deal fell through. Both days are already in the agent's timezone. Earlier years come newest first.
  • src/pages/clock.ts renders the Closed card from that grouping. The row markup moved unchanged into a closedList helper, so opening a year shows exactly what the list showed before (price, "Closed in N days"). The summaries need no JavaScript.
  • When Find, side or closing narrows the clock, every year that still has a match opens. Find still searches all years.
  • A year's price and commission figures appear only for deals that carry them. Fell-through deals add " · N fell through" to the line and are left out of the money totals.
  • The year-pace and totals lines, the "Closed · N" count and the CSV link are unchanged.
  • Docs: static/app.css gets .closed-year, listed in docs/design/areas/clock.md. There is a README line under "Commission and your year" and a note in docs/TECHNICAL.md.

Tests

  • src/years.test.ts covers the 2025/2026 year boundary, the figures-only-when-carried rule, and Find opening a matching year.
  • With the change in place, src/speed.test.ts (200 deals), readme.test.ts and design.test.ts pass. bun scripts/lint-design.ts printed no complaints.

Not done or not checked

  • bun x tsc --noEmit only printed tsc's usage text because the repo has no tsconfig.json, so there was no type check. scripts/gate.ts and scripts/fast.ts don't exist here either.
  • I did not run the full suite. In the ten or so files I ran that touch the clock, the only failure was sample.test.ts ("on a fresh boot the first reminder for today…"), and it fails the same way on the base branch without my change.
  • The first run of speed.test.ts went over budget while bun install was running in the background. It passed on the rerun.
  • I didn't change the contract or add a migration, and I didn't add a "show/hide all years" control.

To try it Open / with deals closed in earlier years. The preview for this pull shows the folded years. Searching a word from an old deal's address opens its year.

commented

Of the four deploy failures, one was mine and is fixed and pushed; the other three also fail without my change, so I left them alone.

  • Mine, fixed: I had appended .closed-year after the broker-file print block in static/app.css. file.test.ts requires every rule after that block to be scoped to .file-page, so it failed. I moved the rule above the block, and file.test.ts now passes.
  • Fail on main too:
    • sample.test.ts ("on a fresh boot the first reminder for today…") and terminal.test.ts ("n declines a reminder…") fail the same way on main here.
    • The "clock with closed deals … within budget" speed test is machine-load noise. In five cold requests I measured about 38 ms on main and 39 ms with my change, against the 50 ms budget. speed.test.ts passed in three back-to-back runs here, so this looks like a loaded deploy machine, not a cost I added.

I did not re-run the full suite after the CSS move, only file.test.ts and speed.test.ts.

commented

I merged main into the branch and pushed. The one conflict, in docs/design/areas/clock.md, is resolved. The one test that failed after the merge passes now. I didn't re-run the full suite after that fix, only src/timeline.test.ts and src/tour.page.test.ts.

  • Conflict: both sides had added a component entry. I kept .closed-year (this pull) and .quiet-badge (from main).
  • CSS fix: the merge put the .closed-year rules in static/app.css ahead of the broker-file section, so the print test saw .closed-year among the print selectors. src/timeline.test.ts ("the print rules are scoped to the timeline page") failed on that. I moved the .closed-year rules to the end of the file. Behaviour is unchanged.
  • Tour test: one tour test, src/tour.page.test.ts ("a signed-in viewer sees ten numbered steps…"), got a 401 in the full run. It passes when run alone and was not the same failure in my two full runs, so I treated it as flaky and did not change it.
  • Checks not run: bun x tsc --noEmit printed its help text instead of type-checking, so it didn't run properly (I didn't dig into why). scripts/gate.ts and scripts/design-lint.ts don't exist in this clone.

I changed no behaviour and loosened no contract cell.

commented

I merged main into the branch again and pushed it. The full suite now passes (884 tests, 0 failures); I did not re-run it after the final commit, which only removed one blank line from static/app.css.

  • Conflict: docs/design/areas/clock.md had both sides adding a component entry. I kept .closed-year from this pull and .clock-nudge and .quiet-badge from main.
  • CSS placement: three print tests (the clock, deal page and file page) each check the CSS between their own comment markers, so .closed-year has to sit where none of them looks. It is now at the end of the broker-file section, just before that section's @media print block.
  • Type check: bun x tsc --noEmit printed only bun's dependency-install output and no type errors, so I take it as clean. It rewrote bun.lock as a side effect, which I reverted.
  • Other checks: scripts/gate.ts and scripts/design-lint.ts don't exist in this clone, so they were not run.

No behaviour changed and no contract cell was loosened.

commented

I addressed all three points and pushed, but src/speed.test.ts is flaky on this machine, so the forge's check is the verdict for it.

  • Speed fixture: the 200-deal fixture's closed deals now close in 2023–2026 (2023 + i % 4), so the earlier-year fold is part of what the 50 ms budget measures.
  • README: I rewrapped the long sentence to the paragraph's width.
  • CSS: I removed the stray blank line after .closed-year summary and the double blank before the clock-print comment.

Speed tests: src/speed.test.ts passed on its first run after the fixture change. Later runs failed 1 to 5 of its 33 tests, and different ones each time. They were the first-request-after-an-edit tests, plus once the reminder-review warm test, which this pull doesn't touch. That is a loaded sandbox: this run measured the cold clock and cold people page at about 42–52 ms against the 50 ms budget. I measured the same range (46–52 ms for the cold clock) with my changes stashed, i.e. on the branch before this commit. So I don't think the fold costs anything measurable. I did not run the rest of the suite or the type check after this commit.

I did not change speed.test.ts's budget or retry logic.

No contract cell is loosened and no dependency is added.

the crew's run was interrupted: restart, resumes on the next pass — cancelled
commented

Closed deals from earlier years now fold into per-year groups, and I've pushed a fix for the speed-test failure in the last deploy. I haven't seen the forge's check on the new push yet.

The failure: "the clock answers within budget the first time after a deal changes" was over the 50 ms budget. The page caches (the clock's lanes, the week rows, the reminder rows, the deal sheets, reminder drafts and the waiting count) were each keyed on the whole serialized deal. Every request re-serialized all 200 deals to build those keys, which cost most of the time.

The fix: src/memo.ts has a new stamp(deal), a 64-bit hash of that serialization remembered per deal object. The caches in src/pages/clock.ts, src/pages/sheet.ts and src/reminders.ts now key on it. The cache key still changes whenever any part of the deal changes, so nothing is served stale and the pages are unchanged.

Measured here: the clock's first request after an edit went from about 47–67 ms to about 43–50 ms (median of five edits per run). Before the fix, three routes failed in one run: the clock, the clock with closed deals, and the reminder review.

Still red here: the reminder review's warm test ("answers in under 50 ms with 200 deals") fails about 50 ms in this sandbox, with and without this change. The reminder review's first-request-after-an-edit test also failed on some runs. I did not investigate or change the review page, and its test passed in the forge's last deploy.

Not run: scripts/gate.ts and scripts/fast.ts don't exist in this clone. bun x tsc --noEmit printed only the compiler's help text, so I got no type check. I ran src/cache.test.ts, the reminders and review tests, src/speed.test.ts and src/health.test.ts. Everything passed except the reminder-review test described above.

Try it: run bun test src/speed.test.ts.

🤖 Generated with Claude Code

commented

Parked by the crew: the check stayed red through 2 automatic tries

Sign in to join this conversation.

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

Keyboard shortcuts

Docs