Repository navigation
fix(chat): give a chat row the menu's clock, so a run's time matches its day - #1876
Conversation
…its day ChatMenuView takes `now` for its day groups, but ChatRow's line asked rowTime for the time with the system clock. Past midnight a run from "today" showed its date, and chat-menu.test's "Done · 08:02" failed whenever the suite ran on another day than its fixture's (on CI, after 00:00 UTC). The row now takes the menu's `now`; other callers keep the current time. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Heads-up: since 00:00 UTC on 31 Oct, This PR fixes it: the row now takes the menu's clock. Merging it first turns the other PRs' web job green again on their next run. |
All chats passes its own clock (the one its Updated column uses) to chatLineOf, so a row's time and its Updated value come from one clock. A test pins the page's clock to a fixed day and fails without it.
gkhngyk
left a comment
There was a problem hiding this comment.
Looks good. The menu groups chats by its own now, and the row line now uses the same clock, so a run's time matches its day group. chatLineOf's other callers are All chats (which has no day groups and its own minute clock, so it can't show the mismatch) and search (no groups, no clock). Optional follow-up: pass All chats' useNow to chatLineOf too, for consistency. No migrations; merges clean on main.
gkhngyk
left a comment
There was a problem hiding this comment.
Looks good. The menu groups chats by its own now, and the row line now uses the same clock, so a run's time matches its day group. chatLineOf's other callers are All chats (which has no day groups and its own minute clock, so it can't show the mismatch) and search (no groups, no clock). Optional follow-up: pass All chats' useNow to chatLineOf too, for consistency. No migrations; merges clean on main.
gkhngyk
left a comment
There was a problem hiding this comment.
Merging in order with the other approved PRs. This head merges current main; its tree is what main will be after this squash, checked with the full server and web suites, tsc, lint, format and next build.
Summary
chat-menu.test.tsx› "counts the Inbox, and lists Agents at work…" fails on any day other than its fixture's, 2026-10-30. On CI it starts failing after 00:00 UTC on 31 October, on every PR.The cause is in the component, not the test:
ChatMenuViewtakes anowfor its day groups.ChatRow's line (chatLineOf→rowTime) asked the system clock whether a run's time was today's. So with the test'snowat noon on 30 Oct and the system clock on 31 Oct, the row showed "Done · Oct 30" instead of "Done · 08:02".The fix:
chatLineOf(chat, t, now = new Date());ChatRowtakes an optionalnow;Related issue
None. Found while running the suite past midnight.
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
Run
yarn vitest run src/components/chaton a day other than 2026-10-30.chat-menu.test.tsxpasses; it failed on main.Checklist
yarn lintpasses (0 errors; 7 old warnings in files this PR doesn't touch)yarn typecheckpassesyarn format:checkpasseshelp/(or no user-visible change): no Help changeChat components: 23 files / 233 tests pass, run on 31 October local time.
🤖 Generated with Claude Code