Repository navigation
Conversation
…ap (openclaw#69605) The .chat-bubble-actions (containing 'Copy as markdown' button) is positioned absolutely at the top-right of the chat bubble. The CSS rule .chat-bubble.has-copy adds padding-right: 70px to prevent content from overlapping the action bar, but the has-copy class was never applied to the chat bubble element. Without this padding, the code block header (with its own 'Copy' button) extends to the right edge of the bubble, directly under the absolutely-positioned .chat-bubble-actions. When the user clicks what looks like the code block copy button in the overlapping area, the click hits the message-level 'Copy as markdown' button instead, copying the entire message rather than just the code block content. Apply the existing has-copy class when canCopyMarkdown or canExpand is true, activating the padding-right rule and preventing the overlap. Co-authored-by: AI Assistant <[email protected]>
21e024f to
aa9dc1a
Compare
Greptile SummaryThis PR fixes a click-target overlap bug where the code block's "Copy" button was being obscured by the message-level "Copy as markdown" floating action bar. The single-line fix applies the pre-existing Confidence Score: 5/5Safe to merge — one-line targeted fix with correct logic and passing tests. The change is minimal and directly closes the described gap. The condition mirrors the existing render condition for the floating action bar, so the class is applied precisely when needed. No regressions are expected; all tests pass. No files require special attention. Reviews (1): Last reviewed commit: "fix(ui): apply has-copy class to prevent..." | Re-trigger Greptile |
|
Related work from PRtags group Title: Open PR duplicate: code block copy overlap in Control UI
|
|
Thanks for the context here. I did a careful shell check against current This PR can close because its unique layout fix is already present on current main with focused coverage; the broader linked clipboard issue can continue through its separate open follow-up. So I’m closing this as already implemented rather than keeping a duplicate issue open. Review detailsBest possible solution: Keep the current-main layout implementation and let the remaining code-block clipboard-text behavior continue through the canonical linked issue and follow-up PR. Do we have a high-confidence way to reproduce the issue? No current-main failing reproduction remains from source inspection: the former missing Is this the best way to solve the issue? Yes. The current-main solution uses the existing Security review: Security review cleared: The PR diff only changes a Control UI class-list expression and introduces no dependency, workflow, permission, secret, package, or code-execution surface. What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 58bfefbad3e3; fix evidence: commit d00e9eba65dd, main fix timestamp 2026-05-13T14:45:34+01:00. |
Summary
Fixes #69605
In the Control UI webchat, clicking the copy button on a code block copies the entire assistant message instead of just the code block content.
Root Cause
The
.chat-bubble-actions(containing the "Copy as markdown" button) is positioned absolutely attop: 6px; right: 8pxof.chat-bubble. The CSS rule.chat-bubble.has-copy { padding-right: 70px; }was designed to create space for these actions, but thehas-copyclass was never applied to the.chat-bubbleelement.Without this padding, the code block header (with its own "Copy" button) extends to the right edge of the bubble, directly under the
.chat-bubble-actions. When the user clicks what appears to be the code block copy button in the overlapping area, the click hits the message-level "Copy as markdown" button instead, copying the entire message.Changes
has-copyclass to.chat-bubblewhencanCopyMarkdownorcanExpandis true, activating thepadding-right: 70pxrule and preventing the overlap between code block content and the floating action barTesting
pnpm test ui/src/ui/chat/passes (165 tests across 14 files)pnpm test ui/src/ui/markdown.test.tspasses (63 tests)pnpm tsgo:prod(typecheck) passespnpm lint:corepasses (0 errors)AI Disclosure
This pull request was created with AI assistance using OpenCode. The code was reviewed and verified by a human contributor before submission. Every line of the change has been understood and can be explained by the contributor.