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

See the coming week across every listing on one page: what goes out each day, which open houses, and what still needs approval #94

Merged opened this

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

Merged

`/week` now shows the next seven days across every listing the viewer may list, `/week.ics` gives the same days as one calendar file, and the home list links to it as "This week". The new `src/week.test.ts` and the schedule, speed, a11y, hostile, openapi, contract, design and deps tests all pass. `bun run lint:design` printed nothing. The type check could not run, because the repo has no `tsconfig…

shipped production is serving it deploy 957b843

opened this

/week now shows the next seven days across every listing the viewer may list, /week.ics gives the same days as one calendar file, and the home list links to it as "This week". The new src/week.test.ts and the schedule, speed, a11y, hostile, openapi, contract, design and deps tests all pass. bun run lint:design printed nothing. The type check could not run, because the repo has no tsconfig.json and bun x tsc printed only its usage text. I did not run scripts/gate.ts or scripts/fast.ts; they aren't in the clone.

What changed

  • src/clock.ts (new): the single clock for "today", with now() and setNow() so tests can pin the date. /week and /week.ics read it.
  • src/schedule.ts: added weekDays (seven days with empty ones kept, each row carrying its listing), awaitingApproval (on-market listings with unapproved assets and "N of M approved") and weekIcs. I split scheduleIcs into shared event and calendar builders, so the per-listing file is byte-for-byte the same.
  • src/pages/week.ts (new): the page, in the order the issue asks for.

- The "Still needs approval" section comes first. - Each day follows, using the same day names and row styling as /listings/:id/schedule. - An empty day says "Nothing scheduled."

  • src/routes.ts: GET /week and GET /week.ics.

- Listing access goes through listListings and getListing, which ask permit. - contract.json is unchanged.

  • Tests and docs: /week and /week.ics are added to speed.test.ts, /week to a11y.test.ts and hostile.test.ts. week.test.ts pins the clock and checks the window, an open house's day and times, Draft rows, the approval count and the ICS output. The README's agent section describes the page and how to add it to a calendar.

Not done

  • /week.ics is not in the OpenAPI listing. /listings/:id/schedule.ics is, but the issue didn't ask for it here.
  • Listings that are sold, withdrawn or expired contribute no rows and are left out of the approval section, because scheduleRows returns nothing for them.

To try it Open /, click "This week", then "Add to calendar".

🤖 Generated with Claude Code

Closes #92

commented

/week now shows the next seven days across every listing the viewer may list, /week.ics gives the same days as one calendar file, and the home list links to it as "This week". The new src/week.test.ts and the schedule, speed, a11y, hostile, openapi, contract, design and deps tests all pass. bun run lint:design printed nothing. The type check could not run, because the repo has no tsconfig.json and bun x tsc printed only its usage text. I did not run scripts/gate.ts or scripts/fast.ts; they aren't in the clone.

What changed

  • src/clock.ts (new): the single clock for "today", with now() and setNow() so tests can pin the date. /week and /week.ics read it.
  • src/schedule.ts: added weekDays (seven days with empty ones kept, each row carrying its listing), awaitingApproval (on-market listings with unapproved assets and "N of M approved") and weekIcs. I split scheduleIcs into shared event and calendar builders, so the per-listing file is byte-for-byte the same.
  • src/pages/week.ts (new): the page, in the order the issue asks for.

- The "Still needs approval" section comes first. - Each day follows, using the same day names and row styling as /listings/:id/schedule. - An empty day says "Nothing scheduled."

  • src/routes.ts: GET /week and GET /week.ics.

- Listing access goes through listListings and getListing, which ask permit. - contract.json is unchanged.

  • Tests and docs: /week and /week.ics are added to speed.test.ts, /week to a11y.test.ts and hostile.test.ts. week.test.ts pins the clock and checks the window, an open house's day and times, Draft rows, the approval count and the ICS output. The README's agent section describes the page and how to add it to a calendar.

Not done

  • /week.ics is not in the OpenAPI listing. /listings/:id/schedule.ics is, but the issue didn't ask for it here.
  • Listings that are sold, withdrawn or expired contribute no rows and are left out of the approval section, because scheduleRows returns nothing for them.

To try it Open /, click "This week", then "Add to calendar".

🤖 Generated with Claude Code

Changes requested — before the latest push

The web side works and is well tested, but one required item is missing.

  1. Fix first: the terminal door. The per-listing schedule is available in src/tty.ts (it uses scheduleText), but the week across listings is not. This pull does not touch src/tty.ts, so a person in the terminal cannot see the week. Add a terminal view of the week built from weekDays and awaitingApproval. It must be gated by permit the way the page is, so a guest sees only what a guest may list. Give it a plain-text renderer next to scheduleText, a test in the tty tests, and a line in the README saying how to reach it.
  1. Minor: src/week.test.ts takes today from new Date() in the first test. That can flake across midnight UTC, so use setNow instead.

Once the terminal view is added, everything else looks right: permit is used through listListings and getListing, contract.json is unchanged, output is escaped, and the speed, a11y and hostile tests cover the new pages.

commented

The week across every listing now has a terminal view, and it's pushed to the same branch. I ran the tty, week, schedule, speed, a11y, hostile, openapi, contract, design and deps tests; they pass. The type check still can't run because the repo has no tsconfig.json.

Terminal view

  • Press w on the terminal's listings view to see the week; esc goes back. The help line now says "w this week".
  • weekText in src/schedule.ts sits beside scheduleText and is built from weekDays and awaitingApproval. It lists the listings still needing approval first, then the seven days, with a Draft row never shown as going out.
  • The listing gathering moved out of routes.ts into listWeek in src/actions.ts, so the page, /week.ics and the terminal all use it. It asks permit per listing through listListings and getListing, so a guest sees only what a guest may list.
  • Both the page and the terminal read today from src/clock.ts.
  • The README's agent section now says how to reach it from the terminal.

Tests

  • src/tty.test.ts has two new tests. One covers w, the Draft mark, the help line and esc. The other covers a guest, who sees only the samples.
  • src/week.test.ts now pins the clock with setNow and derives today from that same value, so it can't flake across midnight UTC.

Disagreement: none. I did not add a terminal view of /week.ics, since the calendar file is a web download.

🤖 Generated with Claude Code

Approved

Approved. /week and /week.ics list the next seven days across the listings the viewer may list, each asked of permit, with no contract.json change. The terminal has the same week on w, the home list links to it, and the README covers both. Tests cover the window, the open house day and times, Draft rows, the approval count, the ICS output and the terminal. I could not diff against my earlier head because the clone does not have it, so I judged the change as a whole. Non-blocking: /week.ics is not in the OpenAPI listing.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs