fix(web): move copy button to inline layout to prevent tool card overlap#404
Merged
hqhq1025 merged 1 commit intotiann:mainfrom Apr 6, 2026
Merged
Conversation
The copy button was absolutely positioned (right-0 top-0) over the entire message content area. When assistant messages contain both text and tool calls (e.g. TodoWrite), the button overlapped the tool card UI. Move the button from absolute positioning inside the content wrapper to an inline flex layout after the content. This places it at the bottom- right of the message, below all content (text + tool cards), so it never overlaps anything. The hover-to-reveal behavior is preserved. Also restores getAssistantCopyText to its original logic so mixed text+tool messages remain copyable (the previous fix of suppressing the button entirely for mixed messages was too aggressive). via [HAPI](https://hapi.run) Co-Authored-By: HAPI <noreply@hapi.run>
There was a problem hiding this comment.
Findings
- No issues identified in the modified lines.
Summary
- Review mode: initial
- No actionable issues found in
web/src/components/AssistantChat/messages/AssistantMessage.tsxafter checking the changed lines against adjacent message-rendering code. - Residual risk: assistant copy-button placement and hover visibility for text-only vs. mixed text+tool messages still rely on manual UI verification; no web test in repo covers that interaction.
Testing
- Not run in this runner:
bunis unavailable (/bin/bash: bun: command not found). - Existing coverage in repo does not exercise assistant copy-button layout/visibility states.
HAPI Bot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The assistant message copy button was absolutely positioned (
right-0 top-0) over the entire message content area. When messages contain both text and tool calls (e.g. TodoWrite task list), the button overlapped the tool card UI, looking like a misplaced button on the task list.Root cause
<button className="absolute right-0 top-0">inside<div className="relative pr-8">pins the button to the top-right of the whole message block. When tool cards render below the text, the button visually sits on top of the first content element, which may be a tool card if text is short or absent.Fix
Move the copy button from absolute positioning inside the content wrapper to an inline flex layout after the content:
sm:opacity-0 sm:group-hover/msg:opacity-100)pr-8padding removed (no longer needed for absolute positioning)getAssistantCopyTextremains unchanged — mixed text+tool messages stay copyableTest plan