Repository navigation
Conversation
hardbeat920#1021 walked a mid-turn message's fold line back to the start of the turn it joined, so a message sent eight minutes into a long turn opened already reading "Working for 8m 43s". Its own sentAt is saved with the block, so it fixes the restart-at-0 on switching back without that side effect. The day separator check reads the previous message's sentAt too, so two mid-turn messages in a row no longer get a separator between them.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
What changed
A message sent while a turn is running now times its fold line from its own
sentAt, so "Working for …" counts from when you sent it. This is a follow-up correction to #1021, which anchored it to the start of the turn it joined. The day separator check reads the same start, andjoinedTurnStartis removed.Why
groupTurnsgives a mid-turn message (appendSteerUser, which stampssentAtand nostartedAt) a turn of its own, with its own live fold line. Before #1021 that line had no start and fell back to the moment it mounted (useElapsedFrom'sDate.now()fallback), so it restarted at 0 every time you switched back to the session. #1021 fixed that by walking back to the joined turn'sstartedAt. The side effect: a message sent eight minutes into a long turn opens its fold line already reading "Working for 8m 43s", which looks like that message took eight minutes.sentAtfixes the restart too, without that side effect.sanitizeBlockkeepssentAton user blocks when saving and hydrating, so the start survives a session switch or a reload. The fallback order is nowstartedAt ?? sentAt ?? monoHabit.at ?? turn[0].startedAt. A message with neither still falls back to mount time, the same as before #1021.The day separator uses this
startedAt, sopreviousAtnow reads the previous user block'ssentAttoo. Without that, every mid-turn message after the first gets a separator, because the previous turn has nostartedAtandopensNewStretch(at, undefined)returns true. This already happens on main since #1021. In the app,daySeparatorsis only turned on together withinlineWork(Mono views), and those group mid-turn messages into the turn they joined. So this part is for consistency and isn't visible today.stampTurnDurationdoesn't change: the turn's recorded duration still runs from the prompt that started it.UI
No layout change. Only the elapsed time on a mid-turn message's live fold line changes: it now counts from when the message was sent.
Validation
AgentTranscript.test.ts: the Keep the running clock when a message joins a turn mid-way #1021 test ("times a message sent mid-turn …") now expectsWorking for 5sfor a message sent 5s ago into a turn that started 90s ago. That rules out the joined turn's start (1m 30s) and the mount fallback (0s), so the "switching back restarts at 0" case is still covered. Fails on main ("Working for 1m 30s").daySeparators, two mid-turn messages in a row add no separator after the first turn's. Fails on main (2 separators instead of 1).joinedTurnStartunit tests along with the helper.npm run check:web(vitest +tsc --noEmit): 483 files / 5362 tests passed, 13 skipped. No Rust changes, so I didn't runcheck:rust.Checklist
npm run check(check:web; no Rust files changed)Summary by CodeRabbit