Public: anyone can read this; the crew can change it.
Times on the lead page and the Activity page read in the agent's time zone, not the server's #67
Check · Review · Land · Live done — Landed and live in production.
Every clock time on the lead page, the desk and Activity now reads in the agent's profile time zone instead of the server's UTC. bun test passes (323 tests) and bun run lint:design printed no errors. I couldn't run bun x tsc --noEmit or scripts/gate.ts, because the clone has no tsconfig.json or scripts/gate.ts.
shipped production is serving it deploy aba151a
1 earlier comment · 1 event
Every clock time on the lead page, the desk and Activity now reads in the agent's profile time zone instead of the server's UTC. bun test passes (323 tests) and bun run lint:design printed no errors. I couldn't run bun x tsc --noEmit or scripts/gate.ts, because the clone has no tsconfig.json or scripts/gate.ts. That matters here: tsc was meant to find missed callers, and one slipped through.
What changed
- Required zone:
when(iso, zone)andday(iso, zone)insrc/pages/parts.tsnow take the zone as a required argument and pass it totoLocaleString.consent(lead, zone)takes it too, because its "opted out" date callsday. - Callers:
- src/pages/lead.ts passes agent.timeZone for the inquiry time, messages, replies, calls, note edit time, follow-up plan days, the hold-until date and the lost date.
- src/pages/desk.ts passes the zone for the "Next follow-up" day and the consent badge.
- src/pages/activity.ts passes it for each row.
- Missed caller: I first missed
noteCard, which callswhenoutsideleadPage.bun testcaught it as a 500 on the lead page, andnoteCardnow takes the zone as a parameter. <time>tags: the lead page already wrapped its times in<time datetime="…">. Activity rows did not, so they now carry the ISO instant too.- Activity title: the line under the title now ends "Times are in America/Los_Angeles." (or whichever zone the profile holds).
- Tests: the new
src/timezone.test.tsrenders a lead created at2026-11-02T01:30Zwith the profile set to America/Los_Angeles. It asserts<time datetime="…">Nov 1, 5:30 PM</time>, which fails on the old code and its UTC "Nov 2, 1:30 AM". It also covers the Activity zone line and rows, and thatleadsCsvstill emits the ISO instant.
Not done
- The CSV export is unchanged.
src/export.test.tsalready pinned ISO instants in the CSV; the new test pins that the profile zone doesn't change them. - I didn't change any
permitcell orcontract.json.
Try it: set the profile time zone to America/Los_Angeles, open a lead and check the "They asked" time, then open /activity as an admin.
🤖 Generated with Claude Code
The web pages are right and the tests are good, but the terminal Activity screen still shows times in the server zone. Fix: in src/terminal.ts (~line 478) the activity view formats row.at with new Date(row.at).toLocaleString("en-US", {...}) and no timeZone, so it reads UTC while the page reads Pacific. Both doors must agree. Pass timeZone: currentAgent(db).timeZone there (or reuse when(row.at, zone) from pages/parts.ts), and add a line saying which zone the times are in, as the page does. Add a terminal test with a known instant and a Pacific profile that fails without the change. Boxes 1 and 3 are left until the terminal agrees; the rest are met.
The terminal Activity screen now reads in the agent's profile time zone, so it matches the web page. bun test passes (324 tests) and bun run lint:design printed no errors. I couldn't run bun x tsc --noEmit, because the clone has no tsconfig.json.
- Fix: In
src/terminal.ts,activityScreennow formats each row withwhen(row.at, zone)frompages/parts.ts, wherezoneiscurrentAgent(db).timeZone. This replaces the baretoLocaleStringcall that used the server's zone. - Zone note: The screen has a dim line under its title, "Times are in America/Los_Angeles." (or whichever zone the profile holds). It is passed through
clean, like the other profile text the terminal prints. - Test: The new test in
src/terminal.test.tssets the profile to America/Los_Angeles and gives the audit rows the instant2026-11-02T01:30Z. It asserts "Nov 1, 5:30 PM" and the zone line appear, and "Nov 2, 1:30 AM" does not. It fails on the previousterminal.tsand passes now.
The rest of the pull is unchanged: the web pages, the desk and the CSV export keep what I described before.
🤖 Generated with Claude Code
The terminal Activity screen now uses the agent zone and says which, with a test. That meets my earlier ask for the terminal door. Every caller of when, day and consent that I could find passes the zone. No permit cell changed. Non-blocking: a scheduled message renders <time datetime="">, which was already the case before this pull.
Every clock time on the lead page, the desk and Activity now reads in the agent's profile time zone instead of the server's UTC.
bun testpasses (323 tests) andbun run lint:designprinted no errors. I couldn't runbun x tsc --noEmitorscripts/gate.ts, because the clone has notsconfig.jsonorscripts/gate.ts. That matters here:tscwas meant to find missed callers, and one slipped through.What changed
when(iso, zone)andday(iso, zone)insrc/pages/parts.tsnow take the zone as a required argument and pass it totoLocaleString.consent(lead, zone)takes it too, because its "opted out" date callsday.-
src/pages/lead.tspassesagent.timeZonefor the inquiry time, messages, replies, calls, note edit time, follow-up plan days, the hold-until date and the lost date. -src/pages/desk.tspasses the zone for the "Next follow-up" day and the consent badge. -src/pages/activity.tspasses it for each row.noteCard, which callswhenoutsideleadPage.bun testcaught it as a 500 on the lead page, andnoteCardnow takes the zone as a parameter.<time>tags: the lead page already wrapped its times in<time datetime="…">. Activity rows did not, so they now carry the ISO instant too.src/timezone.test.tsrenders a lead created at2026-11-02T01:30Zwith the profile set to America/Los_Angeles. It asserts<time datetime="…">Nov 1, 5:30 PM</time>, which fails on the old code and its UTC "Nov 2, 1:30 AM". It also covers the Activity zone line and rows, and thatleadsCsvstill emits the ISO instant.Not done
src/export.test.tsalready pinned ISO instants in the CSV; the new test pins that the profile zone doesn't change them.permitcell orcontract.json.Try it: set the profile time zone to America/Los_Angeles, open a lead and check the "They asked" time, then open
/activityas an admin.🤖 Generated with Claude Code
Closes #65