Repository navigation
fix(channel): ask the per-agent clear through the in-page dialog - #25951
Conversation
|
Local Opus review (head b1a5b4318ad9, same diff as 37f5abe) noted, at Low: 🤖 AI-assisted comment 🤖 |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the change moves the per-agent clear onto the channel-wide clear's existing Notes
[DESIGN-REVIEWED] cb55540 Description read[DESCRIPTION-READ] bdc2d80352c44cd96be7c8d124c10edff5388c791bab76a28ee2b29a9156db12 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks. The change moves an existing confirm from the browser's native popup into the in-page dialog the product already uses. The dark and light screenshots show the dialog, and the blind reader read it correctly. Notes
[UX-REVIEWED] cb55540 Description read[DESCRIPTION-READ] 56515fb783c64e2dc7782be5bed44df417ed572cd5aef0b7811466aee4f2f5dc That sha256 names everything this verdict read: the PR description, plus the 6 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks: the fix closes #25179 by reusing the existing What this change shipsInventory (4 items) — 4 justifiedIntent: resetting one agent's session in a channel asks in the same themed, non-blocking in-page dialog as the channel-wide clear. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] cb55540 Description read[DESCRIPTION-READ] ad59131cdf9472c50756374e1430d1dba2247cfa2495fe38cc19a6990de1e814 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
bolichen97
left a comment
There was a problem hiding this comment.
Good to ship. The per-agent Clear context now asks through useConfirm, the same hook the channel-wide clear uses.
Head reviewed: 37f5abe.
What I checked:
- The row button renders only for live agents, so the new
state !== 'done'check in clearTargetLive cannot close a dialog the moment it opens. - The shared pendingClearRef keeps the channel-wide withdraw behaviour unchanged. With no agentId it checks the channel only.
- begin() runs only after yes, so the row is not busy behind the open dialog. The finally block still resets it on every path.
- main has not changed ChannelPage.tsx, its clear-context test or ConfirmDialog.tsx since the merge base.
- I ran src/test/ChannelPage.clearContext.test.tsx at this head: 35 of 35 pass. A mutation that drops the agent check from clearTargetLive turns the new withdraw test red, so the test pins the guard.
0 must-fix, 0 should-fix.
Not approving yet: Frontend Tests (1) is red at this head. The failure is kiroUsageRefetchInterval.test.ts > maps an explicit unavailable answer to a terminal sentinel (expected 'none' to be 'api-key'), a file this PR does not touch. A re-run should clear it. I will approve once that check and readiness pass on this head.
|
Thanks @bolichen97 for the review at
🤖 AI-assisted comment 🤖 |
|
🤖 AI-assisted comment 🤖 |
37f5abe to
fec2bfe
Compare
fec2bfe to
cb55540
Compare
bolichen97
left a comment
There was a problem hiding this comment.
Approving at cb55540.
This head is a rebase of the head reviewed earlier (37f5abe). The range diff shows the PR commit unchanged and the patch id matches, so the earlier review still holds: no findings.
Gates checked at this head: readiness passed, every check green including Frontend Tests and Coverage Gate, all five AI lanes pass, no change request, mergeable, two files.
Problem / Motivation
Goal: The per-agent Clear context button in a channel's agents panel asks in the same in-page dialog as the channel-wide clear, instead of the browser's native popup.
In a channel's agents panel, the row's Clear context button still asks with the browser's native
confirm(). The channel-wide Clear Context already uses the shared in-page dialog (#11157). So the two clears in the same panel ask in two different ways, and the native popup freezes the page and cannot be themed.Why it matters
Anyone who resets one agent's session in a channel gets an unthemed OS popup that blocks the whole renderer, next to a button that asks in-page. The native popup also cannot follow the row: if the agent leaves while it is open, saying yes still sends the clear.
Not a goal
window.confirm()(open PR fix: migrate renderer native dialogs #21276 migrates it).What changed (motivation → approach → change)
The per-agent clear now asks through
useConfirm(), the hook the channel-wide clear already uses.confirm()The page pins the agent and channel when the dialog opens, and the existing withdraw effect now cancels the dialog when either is gone, or when the agent's state turns
done. The row'sonClearContexttakes abegincallback, so the row marks itself busy only once the request starts.Overlap: open PR #21276 also changes this line (without the withdraw-on-leave part). Whichever lands second can keep or drop the hunk.
Backwards compatibility
Compatible: same strings, same API call (
channelClearContext(id, 'agent', agentId)); only the way the browser asks changes.Removes nothing: the confirm step stays; only its surface moves from the native popup to the in-page dialog.
Tests
website/src/test/ChannelPage.clearContext.test.tsx:still ASKS before a per-agent clear, and does nothing when that is declined: the in-page dialog opens with the role,window.confirmis never called, the row is not busy behind it, and Cancel sends nothing.withdraws the per-agent confirmation when its agent leaves under it: achannel_agent_leftevent closes the dialog and sends nothing.window.confirm. The focus test waits for the dialog to hand focus back to the pressed row button.Proof: not provable -- frontend test (prove.py runs Python only)
Checked by hand instead: with this test file on
origin/main(2ad709c), 10 of 35 tests fail, all the per-agent ones. On this head all 35 pass, and 5 runs with--sequence.shuffle(seeds 1-5) all pass. The four related ChannelPage test files pass on this head (52 tests).tsc -p tsconfig.app.json, eslint on both files, semgrep and the flake ratchet pass.Manual verification
Rendered the existing capture page
website/capture/channel-clear-context.htmlin Chromium (dark and light), opened the agents panel and pressed a row's Clear context. Onorigin/mainthe press raised the native dialog "Reset Researcher's LLM session. The channel's shared message history is preserved." On this head no native dialog fires and the in-page dialog shows.Screenshots / video
After (dark): the in-page dialog.
After (light), and before
Before (dark): no in-page dialog; the press raised the browser's native popup, which a page screenshot cannot show.
Related Issues
Closes #25179
Sibling sweep
Swept: git grep -n "confirm(" -- website/src/pages/ChannelPage.tsx
Sibling: website/src/pages/ChannelPage.tsx -- not affected -- the remaining hit is the channel Close button, a different action; open PR #21276 migrates it.
Pattern harvest
Not generalizable: #11157 moved the channel-wide clear and left this one on purpose to keep that PR small; this finishes the same panel, and the repo-wide native-dialog migration is #21276's scope.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)🤖 AI-assisted PR 🤖