Skip to content

Agentic UI: fix copy button space in chat - #4334

Merged
shaunandrews merged 3 commits into
trunkfrom
agenticFixCopyButtonSpace
Jul 29, 2026
Merged

Agentic UI: fix copy button space in chat#4334
shaunandrews merged 3 commits into
trunkfrom
agenticFixCopyButtonSpace

Conversation

@nightnei

Copy link
Copy Markdown
Contributor

Related issues

How AI was used in this PR

AI assisted with the fix, I reviewed and tested

Proposed Changes

We have a huge space after messages in chat due to the hidden Copy button. This PR fixes it to have a rational space

BEFORE AFTER
Screenshot 2026-07-24 at 15 58 22 Screenshot 2026-07-24 at 15 57 36

Testing Instructions

  1. Open new Agentic UI
  2. Send any massege
  3. Mouse over that message
  4. Assert that the copy button appeared and the UX is good - it's easily achievable and clickable

@nightnei
nightnei requested review from bcotrim and sejas July 24, 2026 15:22
@nightnei nightnei self-assigned this Jul 24, 2026
@wpmobilebot

wpmobilebot commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing f7c98b5 vs trunk

app-size

Metric trunk f7c98b5 Diff Change
App Size (Mac) 1378.85 MB 1381.98 MB +3.13 MB 🔴 0.2%

site-editor

Metric trunk f7c98b5 Diff Change
load 1048 ms 751 ms 297 ms 🟢 -28.3%

site-startup

Metric trunk f7c98b5 Diff Change
siteCreation 6474 ms 6511 ms +37 ms ⚪ 0.0%
siteStartup 2380 ms 2382 ms +2 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

@bcotrim bcotrim left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found that it overlaps with the next message:

Image

Could we maybe align it to the right?

@nightnei

nightnei commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Great catch @bcotrim, thanks.
I took a completely different approach to keep copy button inlined to avoid regressions in the future and aligne margins. I think it looks good.
@shaunandrews WDYT?
Screenshot 2026-07-27 at 18 02 17

@bcotrim bcotrim left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The spacing looks better now, thanks for the adjustment!

It seems we offer the copy option after each "text section" which I think it's too much.
I would say 1 copy after the last agent reply plus another for some particular sections (for example code) would be enough, in my opinion, and it would fix the spacing issue.

Example:

Image

@shaunandrews

shaunandrews commented Jul 29, 2026

Copy link
Copy Markdown
Contributor
image

I guess I don't understand; I'm still seeing all this extra whitespace for the invisible copy button. I'm going to try a few things and push some changes if thats ok.

image

I think this overlap could work if we blur/obscure the content behind it a bit. I'm going to retry this, and reconsider placement entirely—maybe it will work better on top or in the margins.

I'm also going to explore perhaps relying on right click and or double-clicking instead of a visible button.

…over space

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@shaunandrews

Copy link
Copy Markdown
Contributor

I've pushed some changes:

image

The copy button always displays for the latest response from the agent.

--

image

There's no longer any extra space between messages.

--

image

Clicking on an older message shows the copy button below the message, animated into view. Selecting a different message hides other copy buttons (except for the latest message). You can also click on a selected message to unselect it, hiding the copy button.

@shaunandrews

Copy link
Copy Markdown
Contributor

Follow up, introducing a right-click menu for copying messages as well: #4388

@bcotrim

bcotrim commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

I like this direction 👍

@shaunandrews
shaunandrews merged commit ec22696 into trunk Jul 29, 2026
13 checks passed
@shaunandrews
shaunandrews deleted the agenticFixCopyButtonSpace branch July 29, 2026 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants