Repository navigation
fix(sidebar): an opened Agents list says its times as of now - #3804
Conversation
The clock the times are drawn from ticks only while the list is open and a row has a time to say, and it stood still meanwhile. Its first tick came half a minute after it started again, so a list opened after two hours went on saying "<1m" for up to thirty seconds. A phone's drawer, where the list starts folded, showed that at every opening. The clock is now set as its updates start again, in the commit that opens the list, before it is painted. Found by the merge pass's review of #3777, with the test this commit adds. Co-authored-by: sisyphus-dev-ai <[email protected]>
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
|
GitHub's Browser regression (other scripts) is red at This PR changes one effect in On the maintainer's pool of check VMs the same script passes on its first run, in 24 seconds, both for this head merged with Nothing was pushed to run the check again, and no timeout was changed. Update, 08:24 UTC. The job was run again (attempt 2; nothing was pushed) and passed, 207 of 207. |
Merge passMerged head
Two reviewers at this head: Claude (Opus) CLEAR, Codex Terra CLEAR with no findings. Follow-up to #3777 from its review; After the Agents section had been folded, opening it showed each agent's time as it was when it was folded, for up to 30 s (an agent idle for two hours read Left, LOW (Claude): the test would not notice if the update moved to after the paint (one frame of the old time). The first run of this head failed one browser script twice, |
## Summary `scripts/phone-back-demo-regression.ts` failed on #3804's run 43386193239 (Browser regression, other scripts) at line 348. It waited 30 s for `.confirm-dialog` after tapping a tab's close button in the tablet scene. #3804 changes only `src/components/AgentSidebar*`. Closing a tab asks first only while its agent is busy, or when it is the last tab. The tablet scene opened the demo's api pane, whose turn ends 4.5 s after load (`site/demo/transport.ts`). When the tap came after that, as it can on a loaded runner, the idle tab closed without a question and the wait timed out. This is the cause #3768 fixed in `phone-safe-area`. The tablet scene is now two scenes: - The first keeps the row menu and the final Back out of the app, on the api pane as before. It no longer closes a tab. - The new scene opens the web pane, whose agent waits on its question for good. It opens a new terminal beside it and asserts two tabs. It then switches back to the web pane's tab, because only the active tab shows its close, and closes it. With another tab present, the question comes from the busy check in `TabStrip.requestClose`, not from the last-tab rule. Back closes the question, and both tabs stay. `open()` takes the pane as an optional last argument and defaults to the api pane. ## Validation - `bun scripts/phone-back-demo-regression.ts` (after `bun run build`) passes. - It also passes with a temporary 6 s wait before the close, which is not committed. Main with the same wait fails at line 348. - `bun run check fast` passes. - No changelog fragment, because the change is test-only.
Change
Follow-up to #3777, from the merge pass's review of it. The Agents list draws each agent's time in its state from a clock that ticks every 30 seconds, and only while the list is open and a row has a time to say. Folding the list stopped the clock, and its first tick came half a minute after it started again, so a list opened two hours later went on saying
<1mfor up to thirty seconds. A phone's drawer, where the list starts folded, showed that at every opening.The clock is now set as its updates start again, in the commit that opens the list and before it is painted (
AgentSidebar.tsx). Nothing else of the list changes, and DESIGN.md's rule for the times stands: they are redrawn in steps while the list is open.The changelog fragment is
changelog.d/agents-list-time-after-fold.md.Validation
At
33413ab, one commit onmainatf2e8674, on the maintainer's pool of check VMs:server/copilot.test.ts"keeps a logged binding when only the log's timestamps change"), in a file this PR does not touch.agent-state-groups-demo-regression.ts,sidebar-tokens-demo-regression.ts,sidebar-activity-demo-regression.ts): pass, each on its first run.src/components/AgentSidebar.test.tsx), on a fake clock with no sleep: an agent seen to finish says<1m; the list is folded, two hours pass, and it is opened; its row says2hat once. It fails onmainwith<1m, and fails again with the one line of the fix taken out.Not run: the integration suite and the other browser scripts (the change is one effect in
AgentSidebar.tsx), Safari, and the Windows and macOS jobs.