From e3b9da27df22dedd7a2100ed8894cc024b9e91b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20ceylan?= <33789758+haliliceylan@users.noreply.github.com> Date: Wed, 18 Feb 2026 23:11:15 +0000 Subject: [PATCH 1/3] fix(ui): remove redundant copy button from TextPartDisplay --- packages/ui/src/components/message-part.tsx | 30 +-------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/packages/ui/src/components/message-part.tsx b/packages/ui/src/components/message-part.tsx index 42dc37abc5c..6da22168fb5 100644 --- a/packages/ui/src/components/message-part.tsx +++ b/packages/ui/src/components/message-part.tsx @@ -668,42 +668,14 @@ PART_MAPPING["tool"] = function ToolPartDisplay(props) { PART_MAPPING["text"] = function TextPartDisplay(props) { const data = useData() - const i18n = useI18n() const part = props.part as TextPart const displayText = () => relativizeProjectPaths((part.text ?? "").trim(), data.directory) const throttledText = createThrottledValue(displayText) - const [copied, setCopied] = createSignal(false) - - const handleCopy = async () => { - const content = displayText() - if (!content) return - await navigator.clipboard.writeText(content) - setCopied(true) - setTimeout(() => setCopied(false), 2000) - } return (
-
- -
- - e.preventDefault()} - onClick={handleCopy} - aria-label={copied() ? i18n.t("ui.message.copied") : i18n.t("ui.message.copy")} - /> - -
-
+
) From cb5e3cea234c90de76c1193b0de8c239bd2d798c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20ceylan?= <33789758+haliliceylan@users.noreply.github.com> Date: Wed, 18 Feb 2026 23:24:57 +0000 Subject: [PATCH 2/3] refactor(ui): remove unused text part copy wrapper styles --- packages/ui/src/components/message-part.css | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/packages/ui/src/components/message-part.css b/packages/ui/src/components/message-part.css index 44db4f9aa52..af9786f00c8 100644 --- a/packages/ui/src/components/message-part.css +++ b/packages/ui/src/components/message-part.css @@ -114,24 +114,6 @@ [data-component="text-part"] { width: 100%; - [data-slot="text-part-body"] { - position: relative; - margin-top: 32px; - } - - [data-slot="text-part-copy-wrapper"] { - position: absolute; - top: -28px; - right: 8px; - opacity: 0; - transition: opacity 0.15s ease; - z-index: 1; - } - - [data-slot="text-part-body"]:hover [data-slot="text-part-copy-wrapper"] { - opacity: 1; - } - [data-component="markdown"] { margin-top: 0; font-size: var(--font-size-base); From 8dcc40f01b342aa9db919fa1c3099d344cf494a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Catriel=20M=C3=BCller?= Date: Fri, 20 Feb 2026 12:53:09 -0300 Subject: [PATCH 3/3] refactor: simplify pr --- .../kilo-ui/src/components/message-part.css | 4 +++ packages/ui/src/components/message-part.css | 18 +++++++++++ packages/ui/src/components/message-part.tsx | 30 ++++++++++++++++++- 3 files changed, 51 insertions(+), 1 deletion(-) diff --git a/packages/kilo-ui/src/components/message-part.css b/packages/kilo-ui/src/components/message-part.css index 7aa79677bae..5b9bfbfde47 100644 --- a/packages/kilo-ui/src/components/message-part.css +++ b/packages/kilo-ui/src/components/message-part.css @@ -5,4 +5,8 @@ [data-slot="text-part-body"] { margin-top: 0; } + + [data-slot="text-part-copy-wrapper"] { + display: none; + } } diff --git a/packages/ui/src/components/message-part.css b/packages/ui/src/components/message-part.css index af9786f00c8..44db4f9aa52 100644 --- a/packages/ui/src/components/message-part.css +++ b/packages/ui/src/components/message-part.css @@ -114,6 +114,24 @@ [data-component="text-part"] { width: 100%; + [data-slot="text-part-body"] { + position: relative; + margin-top: 32px; + } + + [data-slot="text-part-copy-wrapper"] { + position: absolute; + top: -28px; + right: 8px; + opacity: 0; + transition: opacity 0.15s ease; + z-index: 1; + } + + [data-slot="text-part-body"]:hover [data-slot="text-part-copy-wrapper"] { + opacity: 1; + } + [data-component="markdown"] { margin-top: 0; font-size: var(--font-size-base); diff --git a/packages/ui/src/components/message-part.tsx b/packages/ui/src/components/message-part.tsx index 6da22168fb5..42dc37abc5c 100644 --- a/packages/ui/src/components/message-part.tsx +++ b/packages/ui/src/components/message-part.tsx @@ -668,14 +668,42 @@ PART_MAPPING["tool"] = function ToolPartDisplay(props) { PART_MAPPING["text"] = function TextPartDisplay(props) { const data = useData() + const i18n = useI18n() const part = props.part as TextPart const displayText = () => relativizeProjectPaths((part.text ?? "").trim(), data.directory) const throttledText = createThrottledValue(displayText) + const [copied, setCopied] = createSignal(false) + + const handleCopy = async () => { + const content = displayText() + if (!content) return + await navigator.clipboard.writeText(content) + setCopied(true) + setTimeout(() => setCopied(false), 2000) + } return (
- +
+ +
+ + e.preventDefault()} + onClick={handleCopy} + aria-label={copied() ? i18n.t("ui.message.copied") : i18n.t("ui.message.copy")} + /> + +
+
)