Skip to content

fix(ui): remove redundant copy button from TextPartDisplay#453

Open
haliliceylan wants to merge 3 commits intoKilo-Org:devfrom
haliliceylan:dev
Open

fix(ui): remove redundant copy button from TextPartDisplay#453
haliliceylan wants to merge 3 commits intoKilo-Org:devfrom
haliliceylan:dev

Conversation

@haliliceylan
Copy link

@haliliceylan haliliceylan commented Feb 18, 2026

Context

fixes #445

The TextPartDisplay component in packages/ui/src/components/message-part.tsx had a copy button that copied the entire part.text content (raw markdown source). This was redundant and confusing because the Markdown component already provides copy buttons for individual code blocks.

Users clicking "copy" near a code block would sometimes get the raw markdown source (including extra text, formatting markers) instead of just the code content, depending on which copy button they clicked.

flowchart LR
    subgraph UI["packages/ui"]
        MP[message-part.tsx]
        MP -->|PART_MAPPING.text| TPD[TextPartDisplay]
        TPD -->|contains| MD[Markdown]
        TPD -->|contains| CPY[Copy Button]
    end
    
    style CPY fill:#ff6b6b,color:white
Loading

Implementation

Removed the redundant copy functionality from TextPartDisplay

Screenshots

before after
image image

How to Test

from original issue

Ask it to generate the bash or command for you to run. Then try to use the copy button.

Get in Touch

https://discord.com/channels/1349288496988160052/1391109167275577464/1473821631267995872

@vercel
Copy link

vercel bot commented Feb 18, 2026

@haliliceylan is attempting to deploy a commit to the Kilo Code Team on Vercel.

A member of the Team first needs to authorize it.

@kiloconnect
Copy link
Contributor

kiloconnect bot commented Feb 18, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Clean removal of the redundant copy button from TextPartDisplay. The Markdown component already provides per-code-block copy buttons, making this text-part-level copy unnecessary.

What was verified:

  • All removed CSS selectors (text-part-body, text-part-copy-wrapper) were only used in the two modified files — no orphaned references remain
  • Removed hooks/signals (useI18n, createSignal, Tooltip, IconButton) are still used by other functions in the same file — no unused imports introduced
  • The simplified JSX structure is correct and maintains the existing data-component="text-part" wrapper
  • No security, logic, or runtime issues found
Files Reviewed (2 files)
  • packages/ui/src/components/message-part.css - Removed 18 lines of CSS for copy button positioning/hover
  • packages/ui/src/components/message-part.tsx - Removed copy button logic and simplified TextPartDisplay render

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.

The copy button sometimes copies extra fields

2 participants

Comments