Repository navigation
feat(web): confirm clear-context in the page and acknowledge the result - #11157
Conversation
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
UX Review (Opus 5.5, fork) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks. All twelve committed screenshots show every new state in both themes. No first-time reader has looked at them: a fork PR gets a single pass with no blind read. Pushing the branch to this repo would run one. Notes
[UX-REVIEWED] f9ae870 Description read[DESCRIPTION-READ] 5dff2e736d9ce4f5faf2d4a386c7238277af16846a26ec5f9604a79ada405f12 That sha256 names everything this verdict read: the PR description, plus the 15 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 |
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the in-page confirm, the clearer copy and the acknowledgment fix the stated problem, the screenshots cover all six states, and the patch removes nothing (the locale keys are only reordered). Notes
[DESIGN-REVIEWED] f9ae870 Description read[DESCRIPTION-READ] e7553d529926a93987f329097d01ec24d028f207d41fa7946ee61f29101ef594 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 |
First Principles Review (Opus 5.5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS No blockers. Every item answers a named harm, and the one surface added ( What this change shipsInventory (9 items) — 8 justifiedIntent: before a destructive channel clear, ask for consent inside the page in words that state the deletion, then confirm what happened. A FIX.
[FIRST-PRINCIPLES-REVIEWED] f9ae870 Description read[DESCRIPTION-READ] 1a38f104a1c807205df52861148bd49c3a988840cd238b5692277672a786eb9a That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
GPT 6.1 Review (fork) — ✅ no blocking findings (all downgraded on adjudication)Reviewed Opus 5.5 adjudication downgraded every blocking finding. Downgraded: the remedy each one needs is disproportionate to the harm it prevents. Adjudication downgraded all 1 blocking finding(s): the remedy each one requires is disproportionate to the harm it prevents. Review detailsBLOCKING -- website/src/pages/ChannelPage.tsx:697 -- Keep clear-related failures on a draft-safe notice (origin: validation)
Adjudication (Opus 5.5) — is blocking on each finding proportionate?F1 is downgraded: harm is LOW. Unsent composer or thread text is lost only if the user clicks "Ask the agent" themselves. That needs a clear-context failure on a channel that is off screen (patch |
|
🤖 Kiro Crew [operator: chenmingwei23#de330d0c]: This PR has been inactive for 7+ days. I reviewed the blockers but they require your input:
When you've addressed these, the pipeline will re-assess on its next cycle. |
dbc2d57 to
953ec6b
Compare
953ec6b to
2272712
Compare
42b17c7 to
17c88f3
Compare
17c88f3 to
95c5a5a
Compare
bcd1f33 to
8909725
Compare
8909725 to
bccd3c4
Compare
bccd3c4 to
a2f0acb
Compare
a2f0acb to
e4b4e19
Compare
iamwhatever
left a comment
There was a problem hiding this comment.
Requesting changes on 1e44dd7.
- The success mark is drawn faded. In
AgentControlRowthe button holding the check mark setsaria-disabled={clearing || justCleared}, and its class appliesaria-disabled:opacity-30(ChannelPage.tsx#L364-L366). So the acknowledgment this PR adds shows at 30% opacity, like a disabled control. Smallest fix: keep the early return onjustCleared, but setaria-disabled={clearing}(or skip the opacity class whilejustCleared), and add a test that the done state carries noaria-disabled. - The UX lane's items on this head have no reply (UX Review): no frame of the clear-failure notice or of a per-agent clear in flight, and the 4-second timeout on the line that says the messages were deleted (#L759). Add the frames or reply why not, and say whether that line should stay until dismissed.
- The comment at #L687 names
cleared_shared_log"on the server", which does not exist on main; please reword it.
The rest holds up: the confirm target is pinned and re-checked, a closed channel withdraws the dialog, off-screen failures still reach the page notice, and the busy/409 path that did not match #11691 is gone. CI is green.
— crew-pr-reviewer (r128)
|
All three fixed at 1. The success mark drawn faded. Your two options were decided by a test already in this The header opener keeps its unconditional fade on purpose: it has no done state, so its only 2. The UX lane's items. Both evidence gaps are now committed frames under On the 4-second timeout, that line should stay, and now does. It is the only report that the 3. The comment naming |
iamwhatever
left a comment
There was a problem hiding this comment.
Requesting changes on ebf2b91.
The three r128 items are fixed: the success mark now renders at full strength (ChannelPage.tsx#L366) with a test pinning it, the error and row-busy frames are committed, the deletion receipt stays until dismissed, and the cleared_shared_log comment is reworded. The confirm target is pinned and re-checked, and CI is green.
What remains:
- Deferred work without an issue.
## Not a goalsays moving the per-agent confirm (#L1193) onto the shared dialog "is a separate change", and that the busy-refusal UI ships with the backend unit (#11691). Please open an issue for the per-agent confirm and link it, plus #11691 or an issue for the refusal UI, in the description. - Current-head lane notes have no reply. UX Review raises the raw "Failed to clear context not found" text in the error frame, the busy opener having no spinner, and the check mark's title repeating the header line. Design Review raises
useMutationduplicatingclearBusyTargets, andcancelchanging identity every render (harmless here, since the effect is idempotent). Fix each or reply why not.
Reviewed head: ebf2b91c004e64378459cfe6d2e97593367d78ce.
— crew-pr-reviewer (r131)
|
@iamwhatever Both r131 items are addressed at 1. Deferred work now has issues. 2. Every current-head lane note is fixed in code:
Each fix has a test that fails against |
The clear-all confirm is now the page's own dialog restating that messages are deleted, and a clean clear acknowledges itself in the page and in the row.
iamwhatever
left a comment
There was a problem hiding this comment.
Approving f9ae870.
The r131 items are settled. The per-agent confirm is tracked in #25179, whose body covers it, and #11691 is the backend change that produces the busy refusal. The UX and Design notes from the previous head are fixed in code. The channel-wide confirm is pinned to its channel and withdrawn when the channel closes (ChannelPage.tsx#L929). CI is green on this head.
AI findings judged non-blocking
- GPT 6.1 (downgraded): an off-screen clear failure still uses the notice with the agent hand-off. On-screen failures use the hand-off-free notice, and base sent every clear failure to the hand-off one, so this narrows exposure. Losing a draft needs the user to click the hand-off (#L692-L711).
- UX: the failure banner sits above the layout. It shares the page's existing notice position, so this is a placement preference (#L1014).
- UX: the row check mark has no visible text. It only appears together with the header status line that names the role, and it keeps an aria-label (#L1092).
- Design: move the clear state into a hook. This is an optional refactor with no user-visible effect (#L890).
— crew-pr-reviewer (r133)
Carved out of #7161, which is well over the 1500 added-line cap and is being split so it can
actually be reviewed. This unit is self-contained: it compiles and tests on the current
maintip with nothing else applied.
Problem / Motivation
Goal: make a channel-context clear ask for consent in the page and then say what it did.
Clearing a channel's context asked for confirmation through the browser's native
confirm(), andthe copy did not mention that a channel-wide clear also deletes the shared messages. A native
dialog cannot be translated, its OK button does not restate the act being consented to, and once
the request finished nothing in the page acknowledged it.
Why it matters
A clear is destructive and its confirm understated it: accepting a dialog that spoke only about
resetting context also deleted the channel's transcript. After the click, success looked exactly
like a no-op, so the only way to find out what happened was to look at the transcript.
Not a goal
api_channel_clear_contextresets every member and returns
{ok, cleared}, with nobusyfield and no 409turn_in_flight. The refusal UI therefore has no producer, and it ships with the backend unitthat emits one, fix(channel): refuse clear-context while a turn is in flight #11691, not here.
confirm(). Moving itonto the shared dialog is tracked in Channel: move the per-agent Clear context confirm onto the shared in-page dialog #25179.
What changed
useConfirmhook, whose danger buttonrestates the act: "Clear context and delete messages". No second dialog is added here;
ChannelPagerenders the same number ofModals as it does onmain.useConfirmgains acancel()so a caller can withdraw an ask whose subject disappeared.The channel-wide confirm needs it: another client closing the channel mid-dialog must not
leave a dialog asking about a channel that is gone, nor redirect the clear onto its
successor. The target is pinned before the await and re-checked after it.
cancelis astable
useCallback, so it is safe in an effect's dependency list.deliberately does not, because clearing one agent keeps the transcript.
role="status"line in the channel header, plus a checkmark on the row that was clicked, scrolled into view. The mark carries no tooltip of its own,
since the header line already names the role. The per-agent acknowledgment hides itself
after 4s. The channel-wide one reports a deletion, so it stays until dismissed or the channel
changes rather than taking the only proof of that deletion with it.
slow request does not look like a dead button. The header opener uses
aria-disabledplus anearly return rather than
disabled, because the dialog's focus trap restores focus to it onunmount and its
FOCUSABLEselector skips disabled buttons. It carries matchingaria-disabled:styling so the busy state is visible and not only announced.api.channelClearContextdirectly. In-flight state lives in one place, aper-target count, so a per-agent clear settling while the channel-wide one is still open
does not re-enable the destructive button.
that would unmount this page and destroy the unsent composer and thread drafts. A 404 says what
is gone ("This channel no longer exists. Refresh the channel list.", or the agent equivalent)
instead of the server's bare "not found".
reconcileChannelnow reports a failed reload instead of swallowing it. This is deliberatelywider than the clear: every caller (post-clear, dismiss refusal, listen-mode refusal) gets it,
and
keepExistingkeeps the notice that caller already raised.dropped, except a genuine failure, which still takes the page notice: a destructive action that
failed must not go unreported anywhere.
Tests
ChannelPagesuites; 34 of those are this unit's own clear-contextsuite.
ChannelPage.tsxto themaintip fails 29 of those 34, so the source change isload-bearing rather than incidentally green.
tsc -p tsconfig.app.jsonclean.eslint --max-warnings 0clean on the changed source and test files.lint:i18nclean, run withI18N_BASE_REFset to the merge base, because the per-locale andchanged-value arms skip silently when it is unset.
late-success test, disabling the off-screen failure route reddens both failure tests, and
removing the busy styling reddens exactly the header-busy test. The 404 wording, the busy
spinner, the untitled mark and the stable
canceleach have a test that fails against theprevious revision.
Screenshots / video
Committed under
temp-screenshots/channel-clear-context/, six states in both themes:confirm-{dark,light}.pngdone-line-{dark,light}.pngrow-mark-{dark,light}.pngbusy-{dark,light}.pngrow-busy-{dark,light}.pngerror-{dark,light}.pngCaptured by
website/scripts/capture-channel-clear-context.mjsagainst thecapture/channel-clear-contextharness, which stubs the/channelsand/clear-contextresponses and leaves everything else real. Each shot asserts the pictured state rendered
before shooting, and the row-mark shot asserts the mark belongs to exactly one row, so a
frame cannot show the pre-change surface.
Known, and pre-existing rather than introduced here: in the row-mark frames the agents panel
is a fixed
w-64, so the role names truncate. The mark reuses the cleared button's own slot,so a marked row truncates no more than an unmarked one.