From 7a0a6deb937520ba95ae55a139646e8bf6aee97f Mon Sep 17 00:00:00 2001 From: Justin Halsall Date: Fri, 4 Jul 2025 17:16:57 +0200 Subject: [PATCH] Port: feat(chat): add copy prompt button to task actions (#5392) Co-authored-by: Daniel Riccio --- .changeset/stale-rivers-travel.md | 5 +++++ webview-ui/src/components/chat/TaskActions.tsx | 10 ++++++++++ 2 files changed, 15 insertions(+) create mode 100644 .changeset/stale-rivers-travel.md diff --git a/.changeset/stale-rivers-travel.md b/.changeset/stale-rivers-travel.md new file mode 100644 index 0000000000..ba8047b2c8 --- /dev/null +++ b/.changeset/stale-rivers-travel.md @@ -0,0 +1,5 @@ +--- +roo-code: minor +--- + +Add copy prompt button to task actions. Based on [@vultrnerd's feedback](https://github.com/Kilo-Org/kilocode/discussions/850). diff --git a/webview-ui/src/components/chat/TaskActions.tsx b/webview-ui/src/components/chat/TaskActions.tsx index be93130282..01340de475 100644 --- a/webview-ui/src/components/chat/TaskActions.tsx +++ b/webview-ui/src/components/chat/TaskActions.tsx @@ -5,6 +5,7 @@ import { useTranslation } from "react-i18next" import type { HistoryItem } from "@roo-code/types" import { vscode } from "@/utils/vscode" +import { useCopyToClipboard } from "@/utils/clipboard" import { DeleteTaskDialog } from "../history/DeleteTaskDialog" import { IconButton } from "./IconButton" @@ -18,6 +19,7 @@ interface TaskActionsProps { export const TaskActions = ({ item, buttonsDisabled }: TaskActionsProps) => { const [deleteTaskId, setDeleteTaskId] = useState(null) const { t } = useTranslation() + const { copyWithFeedback, showCopyFeedback } = useCopyToClipboard() return (
@@ -28,6 +30,14 @@ export const TaskActions = ({ item, buttonsDisabled }: TaskActionsProps) => { disabled={buttonsDisabled} onClick={() => vscode.postMessage({ type: "exportCurrentTask" })} /> + {item?.task && ( + copyWithFeedback(item.task, e)} + /> + )} {!!item?.size && item.size > 0 && ( <>