Repository navigation
fix(ui): report failed copies and retire stale clipboard actions - #130612
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs changes before merge. Reviewed August 26, 2026, 11:19 PM ET / August 27, 2026, 03:19 UTC. ClawSweeper reviewWhat this changesThe PR routes tool-diff, transcript-selection, and agent-ID copying through shared feedback-aware clipboard handling, including stale-attempt cancellation. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open: the shared copy behavior is sound, but the tool-diff caller drops its established tool-card action class and therefore regresses its 40px hit target and hover styling. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — step 1 Assertions:
How this fits togetherControl UI copy controls call a shared browser clipboard helper that tries the async API and then a legacy fallback. The result updates the active chat, transcript, or agent-settings control with visible success or failure feedback. flowchart LR
A[User copy action] --> B[Control UI button]
B --> C[Shared copy handler]
C --> D[Browser clipboard API]
C --> E[Legacy copy fallback]
D --> F[Copy outcome]
E --> F
F --> G[Current control feedback]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +5, Tests +310. Total +315 across 5 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the shared copy outcome and stale-attempt logic, but preserve the tool-card action’s existing class-level layout contract and add a focused rendered-style assertion before merge. Do we have a high-confidence way to reproduce the issue? Yes—source-reproducible: the checked-in Chromium scenario exercises the three copy controls and the changed tool-card source deterministically selects the generic class set. This read-only review did not execute the browser harness. Is this the best way to solve the issue? No—the shared outcome handling is the right owner boundary, but applying its generic renderer without retaining the tool-card action presentation changes an existing UI contract. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b05938bac101. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
The failed CI run was traced to the existing mobile session-header test resolving a retained boot-pane button before the requested session became active. I reproduced the original desktop→mobile sequence locally: desktop passed, then the mobile pointer click timed out behind the replacement pane. Current main already contains the exact readiness repair in #129933 (51b2665). This branch now incorporates that main commit; no forced click, keyboard substitution, retry, timeout increase, or duplicate repair was added. The effective PR still changes the original five clipboard files. After refresh, the original header sequence and clipboard/action checks passed: 21 Chromium tests, plus 603 owner/sibling tests across 10 files. The full changed-file gate also passed, including core/UI typechecks, lint, style, i18n, and dead-export checks. A fresh authenticated Codex review of the authoritative final candidate reported no actionable findings. The earlier independent 19 Chromium/249 sibling tests and source-blind five-clause/29-variant report remain recorded above; those counts overlap and are not additive unique coverage. ClawSweeper's production-LOC item is accepted as justified: the net +5 lines bind the returned copy outcome and existing fallback predicate to the current control/agent identity. The duplicated tool-diff copy path was deleted; separate caller-specific feedback or a new lifecycle abstraction would be larger. Its live-proof attempt stopped waiting after 30 seconds while the test command was still running, without a terminal assertion result; the completed browser runs above supply that evidence. The refreshed exact-head CI must still finish green before merge. The native WebKit menu follow-up and already-issued native-write cancellation limitation remain unchanged. |
|
Merged via squash.
|
Closes #130611
Additional instructions
Maintainers can edit this repository-owned branch.
What Problem This Solves
Fixes an issue where users copying a tool diff, selected transcript text, or an Agent ID would get no failure feedback when both browser clipboard methods failed. The selection menu even disappeared as though the copy had succeeded.
Why This Change Was Made
All three controls now use the existing copy-button outcome and retry behavior. Selection copying dismisses its menu only on current success. Agent controls retire their pending copy state when the selected agent changes, and the shared owner cancels an obsolete legacy fallback before it can overwrite a newer copy.
This removes duplicate tool-copy markup and reuses the existing clipboard cancellation seam, without adding a timer, transport, controller, configuration, or persisted state. The five net production lines provide the visible-label/result handoff and asynchronous resource-identity boundary; tests are counted separately.
User Impact
Failed copies are visible and retryable. Pending double-clicks do not duplicate work. A late result from a previous agent or dismissed selection menu cannot relabel the current control or overwrite the newer clipboard through the legacy fallback. Successful selection copying still closes the menu.
Evidence
Commands:
Production LOC: +38/-33 (net +5). Tests: +311/-1 (net +310).
Before/after screenshots (synthetic Gateway data; both copy methods fail):
Provenance: tool-diff copying introduced clearly by #125240 (code/PR author and merger @vyctorbrzezowski, 2026-08-18). Selection copying was carried forward by #122420 and Agent ID copying by #106003 (code/PR author and merger @steipete, 2026-08-12 and 2026-07-13 respectively); those refactors are not claimed as the original introduction. No stable-release reachability claim.
Named follow-up: native WebKit link-menu Copy uses a Web Awesome menu item that is dismissed before its callback, rather than the shared HTML-button lifetime. It needs a native menu-owner repair and actual native-container proof; this PR does not claim to fix all clipboard consumers. Browser clipboard failures here are controlled external-boundary fixtures, not a claim of native OS permission-denial testing.
An asynchronous native write that was already issued cannot be physically canceled. The blind validator observed an old successful native write completing after a newer one; the current control kept its own feedback and remained usable. This repair prevents obsolete legacy fallback and stale UI feedback, not already-issued successful native writes.