From c7c6c8f0d6c904f803fd0e0bf2aa1532faa2c2c4 Mon Sep 17 00:00:00 2001 From: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com> Date: Sun, 19 Jan 2025 11:35:51 -0800 Subject: [PATCH] Change to task mode --- src/core/Cline.ts | 6 +++--- src/shared/ChatSettings.ts | 4 ++-- webview-ui/src/components/chat/ChatTextArea.tsx | 4 ++-- webview-ui/src/components/chat/TaskHeader.tsx | 7 +++++-- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/core/Cline.ts b/src/core/Cline.ts index 345719d657..b49d7015a1 100644 --- a/src/core/Cline.ts +++ b/src/core/Cline.ts @@ -2741,7 +2741,7 @@ export class Cline { if (!response) { this.consecutiveMistakeCount++ pushToolResult(await this.sayAndCreateMissingParamError("respond_to_inquiry", "response")) - await this.saveCheckpoint() + // await this.saveCheckpoint() break } this.consecutiveMistakeCount = 0 @@ -2756,12 +2756,12 @@ export class Cline { const { text, images } = await this.ask("respond_to_inquiry", response, false) await this.say("user_feedback", text ?? "", images) pushToolResult(formatResponse.toolResult(`\n${text}\n`, images)) - await this.saveCheckpoint() + // await this.saveCheckpoint() break } } catch (error) { await handleError("responding to inquiry", error) - await this.saveCheckpoint() + // await this.saveCheckpoint() break } } diff --git a/src/shared/ChatSettings.ts b/src/shared/ChatSettings.ts index 5d0e48c264..18eab25312 100644 --- a/src/shared/ChatSettings.ts +++ b/src/shared/ChatSettings.ts @@ -1,7 +1,7 @@ export interface ChatSettings { - mode: "code" | "chat" + mode: "task" | "chat" } export const DEFAULT_CHAT_SETTINGS: ChatSettings = { - mode: "code", + mode: "task", } diff --git a/webview-ui/src/components/chat/ChatTextArea.tsx b/webview-ui/src/components/chat/ChatTextArea.tsx index a7c0742862..b0fe60f04a 100644 --- a/webview-ui/src/components/chat/ChatTextArea.tsx +++ b/webview-ui/src/components/chat/ChatTextArea.tsx @@ -482,7 +482,7 @@ const ChatTextArea = forwardRef( const onModeToggle = useCallback(() => { if (textAreaDisabled) return - const newMode = chatSettings.mode === "chat" ? "code" : "chat" + const newMode = chatSettings.mode === "chat" ? "task" : "chat" vscode.postMessage({ type: "chatSettings", chatSettings: { @@ -754,7 +754,7 @@ const ChatTextArea = forwardRef( - Code + Task Chat diff --git a/webview-ui/src/components/chat/TaskHeader.tsx b/webview-ui/src/components/chat/TaskHeader.tsx index ed2017d955..253ecef5df 100644 --- a/webview-ui/src/components/chat/TaskHeader.tsx +++ b/webview-ui/src/components/chat/TaskHeader.tsx @@ -30,7 +30,7 @@ const TaskHeader: React.FC = ({ totalCost, onClose, }) => { - const { apiConfiguration, currentTaskItem, checkpointTrackerErrorMessage } = useExtensionState() + const { apiConfiguration, currentTaskItem, checkpointTrackerErrorMessage, chatSettings } = useExtensionState() const [isTaskExpanded, setIsTaskExpanded] = useState(true) const [isTextExpanded, setIsTextExpanded] = useState(false) const [showSeeMore, setShowSeeMore] = useState(false) @@ -155,7 +155,10 @@ const TaskHeader: React.FC = ({ flexGrow: 1, minWidth: 0, // This allows the div to shrink below its content size }}> - Task{!isTaskExpanded && ":"} + + {chatSettings.mode === "task" ? "Task" : "Chat"} + {!isTaskExpanded && ":"} + {!isTaskExpanded && {highlightMentions(task.text, false)}}