mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
Port: feat(chat): add copy prompt button to task actions (#5392)
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
This commit is contained in:
parent
055d2bcb87
commit
7a0a6deb93
2 changed files with 15 additions and 0 deletions
5
.changeset/stale-rivers-travel.md
Normal file
5
.changeset/stale-rivers-travel.md
Normal file
|
|
@ -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).
|
||||
|
|
@ -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<string | null>(null)
|
||||
const { t } = useTranslation()
|
||||
const { copyWithFeedback, showCopyFeedback } = useCopyToClipboard()
|
||||
|
||||
return (
|
||||
<div className="flex flex-row gap-1">
|
||||
|
|
@ -28,6 +30,14 @@ export const TaskActions = ({ item, buttonsDisabled }: TaskActionsProps) => {
|
|||
disabled={buttonsDisabled}
|
||||
onClick={() => vscode.postMessage({ type: "exportCurrentTask" })}
|
||||
/>
|
||||
{item?.task && (
|
||||
<IconButton
|
||||
iconClass={showCopyFeedback ? "codicon-check" : "codicon-copy"}
|
||||
title={t("history:copyPrompt")}
|
||||
disabled={buttonsDisabled}
|
||||
onClick={(e) => copyWithFeedback(item.task, e)}
|
||||
/>
|
||||
)}
|
||||
{!!item?.size && item.size > 0 && (
|
||||
<>
|
||||
<div className="flex items-center">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue