Repository navigation
fix(chat): copy confirmation can disappear before it is shown when the app is busy - #2138
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR starts chat copy-feedback expiry when feedback reaches the native button and makes its UI tests observe label transitions. Example: Copy a code block while the UI thread is busy for 2.5 seconds.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR addresses a source-supported timing bug still present on main, and review found no concrete introduced defect. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherMessage and code renderers pass text and identity to ChatCopyButton, which invokes clipboard copying and owns temporary visual feedback, accessibility announcements, and reset cancellation. flowchart LR
A[Message or code renderer] --> B[ChatCopyButton]
B --> C[Clipboard helper]
C --> D[Copy result state]
D --> E[Native button and announcement]
E --> F[Reset timer]
F --> B
Technical reviewBest possible solution: Keep reset timing in ChatCopyButton at native feedback application while preserving its existing cancellation and identity fences. Do we have a high-confidence way to reproduce the issue? Main starts the reset before Reactor applies feedback, allowing delayed rendering to lose the intermediate state; the PR also describes a 2.5-second before/after demonstration, but this review ran no reproduction. Is this the best way to solve the issue? Moving the existing timer to the native application callback is a focused repair using the established owner; the transition recorder and held-window tests protect distinct timing and lifetime failures without adding production machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6ddc13b8eff7. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 12, 2026, 9:25 PM ET / November 13, 2026, 02:25 UTC. |
…e app is busy ChatCopyButton started its 2 s reset timer at the click. When the UI thread stayed busy past that window, the reset ran before the "Copied" or "Copy failed" feedback was ever rendered or announced. Start the window when the feedback reaches the native button, and name the default window. The proof tests now record the button's label transitions instead of sampling the label after a fixed settle that a loaded CI runner stretched past the 2 s timer (the CopyFeedback_MessageAndCodeCapture failure on openclaw#2127). The repeated-click, content, identity and disposal checks use held or short reset windows so each phase can only pass for the behavior it names. Co-authored-by: Copilot App <[email protected]>
1617d37 to
9aba7ea
Compare
What Problem This Solves
Fixes: the chat "Copied" / "Copy failed" confirmation is never shown or announced when the app is busy for about 2 seconds right after a copy. The
CopyFeedback_MessageAndCodeCaptureUI test also fails intermittently in CI.User Impact
User impact: after copying a message or a code block, users always see the "Copied" or "Copy failed" confirmation for its full duration, and screen readers announce it, even if the app was busy when they clicked.
Why This Change Was Made
ChatCopyButtonstarted its 2-second reset timer at the click. If the UI thread stayed busy past that window, the reset ran before the feedback was ever rendered, so nothing was shown or announced. The window now starts when the feedback reaches the native button, which is where the live-region announcement is already raised. The default window is a named constant.The CI failure has the same cause on the test side. On #2127, the fixed settle after the click took 2.94 s on a loaded runner, so the test read the label after the 2 s reset. The click block ran at 41.724 s and the assertion at 44.660 s. The tests now record the button's label transitions as they happen, so they no longer depend on when they look.
Evidence
Expected: "Copied",Actual: "Copy code".Cancel()fromCopy(), so a repeated click cannot restart the window. The rewritten repeated-click test then fails with "Timed out waiting for repeated copy feedback reset ... transitions: Copied@9ms".Change Type
Scope
winnodeRequired proof pools
none: native UI tests on the Windows desktop directly exercise the timing change in one chat control (see Validation), and CI's UI job runs the same tests. No capacity-dependent custom pool is required.Validation
All commands ran in the task worktree on base
6ddc13b8. The tested tree has diff hashfbbbc7ef. The commit adds only one source comment on top of it../build.ps1: all builds succeeded.dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore: 5,849 passed, 29 skipped, 0 failed.dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore: 6,359 passed, 0 failed.dotnet test tests/OpenClaw.Tray.UITests --no-build --filter "FullyQualifiedName~ReactorChatLayoutProofTests.CopyFeedback|FullyQualifiedName~ReactorChatLayoutProofTests.CodeCopyAutomationIds": 5 consecutive rounds of 4 tests passed, 0 failed.dotnet test tests/OpenClaw.Tray.UITests --no-build --filter "FullyQualifiedName~ReactorChatLayoutProofTests"withOPENCLAW_UI_TEST_RESOURCE_PROFILE=Standard: 177 passed, 3 skipped, 0 failed.OPENCLAW_TRAY_DATA_DIR,OPENCLAW_TRAY_APPDATA_DIRandOPENCLAW_TRAY_LOCALAPPDATA_DIR. The real OpenClawTray profile manifests were unchanged.Real Behavior Proof
fbbbc7efon6ddc13b8. The commit1617d37cadds one comment.Cancel()mutation.Expected "Copied",Actual "Copy code". New test with the same delay: passes.Yes/No/N/A) N/ASecurity Impact
Yes/No) NoYes/No) NoYes/No) NoYes/No) NoYes/No) NoYes, explain the risk and mitigation:Compatibility and Migration
Yes/No) YesYes/No) NoYes/No) NoReview Conversations