Skip to content

Commit 7a0a6de

Browse files
Juice10daniel-lxs
andauthored
Port: feat(chat): add copy prompt button to task actions (#5392)
Co-authored-by: Daniel Riccio <[email protected]>
1 parent 055d2bc commit 7a0a6de

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

.changeset/stale-rivers-travel.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
roo-code: minor
3+
---
4+
5+
Add copy prompt button to task actions. Based on [@vultrnerd's feedback](https://github.com/Kilo-Org/kilocode/discussions/850).

webview-ui/src/components/chat/TaskActions.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { useTranslation } from "react-i18next"
55
import type { HistoryItem } from "@roo-code/types"
66

77
import { vscode } from "@/utils/vscode"
8+
import { useCopyToClipboard } from "@/utils/clipboard"
89

910
import { DeleteTaskDialog } from "../history/DeleteTaskDialog"
1011
import { IconButton } from "./IconButton"
@@ -18,6 +19,7 @@ interface TaskActionsProps {
1819
export const TaskActions = ({ item, buttonsDisabled }: TaskActionsProps) => {
1920
const [deleteTaskId, setDeleteTaskId] = useState<string | null>(null)
2021
const { t } = useTranslation()
22+
const { copyWithFeedback, showCopyFeedback } = useCopyToClipboard()
2123

2224
return (
2325
<div className="flex flex-row gap-1">
@@ -28,6 +30,14 @@ export const TaskActions = ({ item, buttonsDisabled }: TaskActionsProps) => {
2830
disabled={buttonsDisabled}
2931
onClick={() => vscode.postMessage({ type: "exportCurrentTask" })}
3032
/>
33+
{item?.task && (
34+
<IconButton
35+
iconClass={showCopyFeedback ? "codicon-check" : "codicon-copy"}
36+
title={t("history:copyPrompt")}
37+
disabled={buttonsDisabled}
38+
onClick={(e) => copyWithFeedback(item.task, e)}
39+
/>
40+
)}
3141
{!!item?.size && item.size > 0 && (
3242
<>
3343
<div className="flex items-center">

0 commit comments

Comments
 (0)