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

This week shows each inspection and walkthrough's time and place, and orders a day's dates by time, so the agent sees where to be hour by hour #193

opened this

Merged 27d 2h ago, live in production

/week now shows an inspection or walkthrough's time and place beside the date. A day's timed dates now come first, earliest first. The new tests and the neighbouring week, OpenAPI and speed tests pass; the full suite and bun x tsc --noEmit were not run, and tsc has no tsconfig.json in this clone.

Notes

opened this

/week now shows an inspection or walkthrough's time and place beside the date. A day's timed dates now come first, earliest first. The new tests and the neighbouring week, OpenAPI and speed tests pass; the full suite and bun x tsc --noEmit were not run, and tsc has no tsconfig.json in this clone. The forge's check will run the full suite.

  • Display: an Inspection or Walkthrough row with a time or place shows it after the closing-style separator, for example · 10:00 am · <place>, with the text escaped. A row with neither renders as it did before.
  • Time format: clock12 is lowercase, so the time reads 10:00 am, not the 10:00 AM in the issue. I kept clock12 unchanged because the closing already uses it.
  • Order: within one day, timed closings and timed appointments sort together by time, then everything untimed in today's order. Other days are untouched.
  • No extra queries: the deadline rows already carry time and place, so the 50 ms budget is untouched.
  • JSON: GET /api/book is the book summary, not the week. The week's JSON is the deadline objects, in GET /api/deals and in MCP this_week, and they already carried time and place. I added both fields to the deadline schema in src/routes.ts so /openapi.json describes them, and regenerated contract/openapi.json.
  • Tests: src/week.appointment.test.ts covers a timed walkthrough on /week, a <script> place rendered escaped, and a week with the time cleared rendering byte-for-byte as before. It also checks that a day's timed dates come out earliest first with the untimed one after. The ordering check compares positions in the HTML, so it is looser than a row-by-row assertion.
  • Not run: scripts/design-lint.ts does not exist here. scripts/lint-design.ts is the nearest script, and I ran it, but it printed nothing, so I can't say it passed. I added no new component class.

The change is in src/week.ts, src/pages/week.ts and src/routes.ts, plus the regenerated contract.

To try it, set a time and place on a deal's walkthrough that falls in the next seven days, then open /week.

🤖 Generated with Claude Code

Closes #189

2 earlier comments
commented

/week now shows an inspection or walkthrough's time and place beside the date. A day's timed dates now come first, earliest first. The new tests and the neighbouring week, OpenAPI and speed tests pass; the full suite and bun x tsc --noEmit were not run, and tsc has no tsconfig.json in this clone. The forge's check will run the full suite.

  • Display: an Inspection or Walkthrough row with a time or place shows it after the closing-style separator, for example · 10:00 am · <place>, with the text escaped. A row with neither renders as it did before.
  • Time format: clock12 is lowercase, so the time reads 10:00 am, not the 10:00 AM in the issue. I kept clock12 unchanged because the closing already uses it.
  • Order: within one day, timed closings and timed appointments sort together by time, then everything untimed in today's order. Other days are untouched.
  • No extra queries: the deadline rows already carry time and place, so the 50 ms budget is untouched.
  • JSON: GET /api/book is the book summary, not the week. The week's JSON is the deadline objects, in GET /api/deals and in MCP this_week, and they already carried time and place. I added both fields to the deadline schema in src/routes.ts so /openapi.json describes them, and regenerated contract/openapi.json.
  • Tests: src/week.appointment.test.ts covers a timed walkthrough on /week, a <script> place rendered escaped, and a week with the time cleared rendering byte-for-byte as before. It also checks that a day's timed dates come out earliest first with the untimed one after. The ordering check compares positions in the HTML, so it is looser than a row-by-row assertion.
  • Not run: scripts/design-lint.ts does not exist here. scripts/lint-design.ts is the nearest script, and I ran it, but it printed nothing, so I can't say it passed. I added no new component class.

The change is in src/week.ts, src/pages/week.ts and src/routes.ts, plus the regenerated contract.

To try it, set a time and place on a deal's walkthrough that falls in the next seven days, then open /week.

🤖 Generated with Claude Code

commented

I pushed a fix for the 503, but I couldn't see which health check failed, so the cause is inferred and the preview isn't re-checked.

Diagnosis. A fresh database boots with /healthz returning 200 on this branch. My #189 change adds no migration and touches no schema. So the preview's database is the likely cause. My guess is that its recorded schema version is past a migration whose column it doesn't have, perhaps because migrations ran in a different order on another branch. /healthz is built to return 503 in exactly that case. I can't read the preview's database or its log. Production at https://deal-clock--forge-trevato-apps.open-platform.sh returned a 502 when I tried it, so I couldn't compare against it.

Fix. openDb now calls a new restoreColumns in src/db.ts, right after migrate. For every ALTER TABLE … ADD COLUMN migration, it re-runs the statement if the table lacks that column. Columns already present are untouched, and existing migrations are unchanged, so the pins still hold.

Tests. I added a test in src/db.test.ts that drops deadline.place, reopens the database, and checks that /healthz's checks pass. That test and the health and migration tests pass. I did not run the full suite.

If the preview still returns 503, the cause is something other than a missing ADD COLUMN column. The log line naming the failed check would settle it.

commented

I took out restoreColumns as asked and tightened the ordering test; the pull is now just the week feature. I ran the week, week-page and db tests, and they pass. I did not run the full suite.

  • restoreColumns removed. I reverted the commit that added it. That removes the function, its call in openDb and its db.test.ts test. I agree it was out of scope and was written on a guess about a 503 I couldn't see. I opened no separate drift issue, because the preview is healthy now and I have no evidence of a real bug.
  • Ordering test. src/week.appointment.test.ts now builds the three walkthroughs due on the same day from thisWeek and asserts their order directly. The addresses come out as the 09:00 deal, the 15:30 deal, then the untimed deal, and the times as ["09:00", "15:30", null]. It still checks that 9:00 am appears before 3:30 pm in the rendered page.
  • Design lint. bun scripts/lint-design.ts exits 0. It printed nothing, and this pull adds no component class.

The feature is as before: time and place show on /week, escaped; a day's timed dates sort first, earliest first; and the deadline schema in /openapi.json describes time and place.

🤖 Generated with Claude Code

Sign in to join this conversation.

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

Keyboard shortcuts

Docs