feat: add HeroTooltip to conversation history button (#6466)
- Rename OpenDiskTaskHistoryButton to OpenDiskConversationHistoryButton - Add HeroTooltip for consistent UI experience - Update protobuf service and backend handler
This commit is contained in:
1 parent
648ae1b1fd
commit
42df03177f
5 files changed
+44
-40
No files matched your search
@@ -50,7 +50,7 @@ service FileService {
|
||||
rpc refreshRules(EmptyRequest) returns (RefreshedRules);
|
||||
|
||||
// Opens a task's conversation history file on disk
|
||||
rpc openTaskHistory(StringRequest) returns (Empty);
|
||||
rpc openDiskConversationHistory(StringRequest) returns (Empty);
|
||||
|
||||
// Toggles a workflow on or off
|
||||
rpc toggleWorkflow(ToggleWorkflowRequest) returns (ClineRulesToggles);
|
||||
|
||||
+3
-3
@@ -9,11 +9,11 @@ import { Controller } from ".."
|
||||
* @param request The request message containing the file path in the 'value' field
|
||||
* @returns Empty response
|
||||
*/
|
||||
export async function openTaskHistory(_controller: Controller, request: StringRequest): Promise<Empty> {
|
||||
export async function openDiskConversationHistory(_controller: Controller, request: StringRequest): Promise<Empty> {
|
||||
const globalStoragePath = HostProvider.get().globalStorageFsPath
|
||||
const taskHistoryPath = path.join(globalStoragePath, "tasks", request.value, "api_conversation_history.json")
|
||||
const taskConversationHistoryPath = path.join(globalStoragePath, "tasks", request.value, "api_conversation_history.json")
|
||||
if (request.value) {
|
||||
openFileIntegration(taskHistoryPath)
|
||||
openFileIntegration(taskConversationHistoryPath)
|
||||
}
|
||||
return Empty.create()
|
||||
}
|
||||
@@ -10,7 +10,7 @@ import { UiServiceClient } from "@/services/grpc-client"
|
||||
import CopyTaskButton from "./buttons/CopyTaskButton"
|
||||
import DeleteTaskButton from "./buttons/DeleteTaskButton"
|
||||
import NewTaskButton from "./buttons/NewTaskButton"
|
||||
import OpenDiskTaskHistoryButton from "./buttons/OpenDiskTaskHistoryButton"
|
||||
import OpenDiskConversationHistoryButton from "./buttons/OpenDiskConversationHistoryButton"
|
||||
import { CheckpointError } from "./CheckpointError"
|
||||
import ContextWindow from "./ContextWindow"
|
||||
import { FocusChain } from "./FocusChain"
|
||||
@@ -117,7 +117,9 @@ const TaskHeader: React.FC<TaskHeaderProps> = ({
|
||||
taskSize={currentTaskItem?.size}
|
||||
/>
|
||||
{/* Only visible in development mode */}
|
||||
{IS_DEV && <OpenDiskTaskHistoryButton className={BUTTON_CLASS} taskId={currentTaskItem?.id} />}
|
||||
{IS_DEV && (
|
||||
<OpenDiskConversationHistoryButton className={BUTTON_CLASS} taskId={currentTaskItem?.id} />
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
import { Button, cn } from "@heroui/react"
|
||||
import { StringRequest } from "@shared/proto/cline/common"
|
||||
import { ArrowDownToLineIcon } from "lucide-react"
|
||||
import HeroTooltip from "@/components/common/HeroTooltip"
|
||||
import { FileServiceClient } from "@/services/grpc-client"
|
||||
|
||||
const OpenDiskConversationHistoryButton: React.FC<{
|
||||
taskId?: string
|
||||
className?: string
|
||||
}> = ({ taskId, className }) => {
|
||||
const handleOpenDiskConversationHistory = () => {
|
||||
if (!taskId) {
|
||||
return
|
||||
}
|
||||
|
||||
FileServiceClient.openDiskConversationHistory(StringRequest.create({ value: taskId })).catch((err) => {
|
||||
console.error(err)
|
||||
})
|
||||
}
|
||||
|
||||
return (
|
||||
<HeroTooltip content="Open Conversation History File" placement="right">
|
||||
<Button
|
||||
aria-label="Open Disk Conversation History"
|
||||
className={cn("flex items-center border-0 text-sm font-bold bg-transparent hover:opacity-100", className)}
|
||||
isIconOnly={true}
|
||||
onPress={() => handleOpenDiskConversationHistory()}
|
||||
radius="sm"
|
||||
size="sm">
|
||||
<ArrowDownToLineIcon size="14" />
|
||||
</Button>
|
||||
</HeroTooltip>
|
||||
)
|
||||
}
|
||||
|
||||
export default OpenDiskConversationHistoryButton
|
||||
@@ -1,34 +0,0 @@
|
||||
import { Button, cn } from "@heroui/react"
|
||||
import { StringRequest } from "@shared/proto/cline/common"
|
||||
import { ArrowDownToLineIcon } from "lucide-react"
|
||||
import { FileServiceClient } from "@/services/grpc-client"
|
||||
|
||||
const OpenDiskTaskHistoryButton: React.FC<{
|
||||
taskId?: string
|
||||
className?: string
|
||||
}> = ({ taskId, className }) => {
|
||||
const handleOpenDiskTaskHistory = () => {
|
||||
if (!taskId) {
|
||||
return
|
||||
}
|
||||
|
||||
FileServiceClient.openTaskHistory(StringRequest.create({ value: taskId })).catch((err) => {
|
||||
console.error(err)
|
||||
})
|
||||
}
|
||||
|
||||
return (
|
||||
<Button
|
||||
aria-label="Open Disk Task History"
|
||||
className={cn("flex items-center border-0 text-sm font-bold bg-transparent hover:opacity-100", className)}
|
||||
isIconOnly={true}
|
||||
onPress={() => handleOpenDiskTaskHistory()}
|
||||
radius="sm"
|
||||
size="sm"
|
||||
title="Export Task">
|
||||
<ArrowDownToLineIcon size="14" />
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
|
||||
export default OpenDiskTaskHistoryButton
|
||||
Reference in new issue
Block a user