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
Check · Review · Land · Live done — Landed and live in production.
`/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
/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", withnow()andsetNow()so tests can pin the date./weekand/week.icsread it.src/schedule.ts: addedweekDays(seven days with empty ones kept, each row carrying its listing),awaitingApproval(on-market listings with unapproved assets and "N of M approved") andweekIcs. I splitscheduleIcsinto 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 /weekandGET /week.ics.
- Listing access goes through listListings and getListing, which ask permit.
- contract.json is unchanged.
- Tests and docs:
/weekand/week.icsare added tospeed.test.ts,/weektoa11y.test.tsandhostile.test.ts.week.test.tspins 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.icsis not in the OpenAPI listing./listings/:id/schedule.icsis, 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
scheduleRowsreturns nothing for them.
To try it
Open /, click "This week", then "Add to calendar".
🤖 Generated with Claude Code
The web side works and is well tested, but one required item is missing.
- 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.
- 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.
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
won the terminal's listings view to see the week;escgoes back. The help line now says "w this week". weekTextinsrc/schedule.tssits besidescheduleTextand is built fromweekDaysandawaitingApproval. 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.tsintolistWeekinsrc/actions.ts, so the page,/week.icsand the terminal all use it. It askspermitper listing throughlistListingsandgetListing, 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.tshas two new tests. One coversw, the Draft mark, the help line andesc. The other covers a guest, who sees only the samples.src/week.test.tsnow pins the clock withsetNowand 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. /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.
/weeknow shows the next seven days across every listing the viewer may list,/week.icsgives the same days as one calendar file, and the home list links to it as "This week". The newsrc/week.test.tsand the schedule, speed, a11y, hostile, openapi, contract, design and deps tests all pass.bun run lint:designprinted nothing. The type check could not run, because the repo has notsconfig.jsonandbun x tscprinted only its usage text. I did not runscripts/gate.tsorscripts/fast.ts; they aren't in the clone.What changed
src/clock.ts(new): the single clock for "today", withnow()andsetNow()so tests can pin the date./weekand/week.icsread it.src/schedule.ts: addedweekDays(seven days with empty ones kept, each row carrying its listing),awaitingApproval(on-market listings with unapproved assets and "N of M approved") andweekIcs. I splitscheduleIcsinto 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 /weekandGET /week.ics.- Listing access goes through
listListingsandgetListing, which askpermit. -contract.jsonis unchanged./weekand/week.icsare added tospeed.test.ts,/weektoa11y.test.tsandhostile.test.ts.week.test.tspins 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.icsis not in the OpenAPI listing./listings/:id/schedule.icsis, but the issue didn't ask for it here.scheduleRowsreturns nothing for them.To try it Open
/, click "This week", then "Add to calendar".🤖 Generated with Claude Code
Closes #92