Change to task mode

This commit is contained in:
Saoud Rizwan 2025-01-19 11:35:51 -08:00
parent 771332ca3e
commit c7c6c8f0d6
4 changed files with 12 additions and 9 deletions

View file

@ -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(`<user_message>\n${text}\n</user_message>`, images))
await this.saveCheckpoint()
// await this.saveCheckpoint()
break
}
} catch (error) {
await handleError("responding to inquiry", error)
await this.saveCheckpoint()
// await this.saveCheckpoint()
break
}
}

View file

@ -1,7 +1,7 @@
export interface ChatSettings {
mode: "code" | "chat"
mode: "task" | "chat"
}
export const DEFAULT_CHAT_SETTINGS: ChatSettings = {
mode: "code",
mode: "task",
}

View file

@ -482,7 +482,7 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
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<HTMLTextAreaElement, ChatTextAreaProps>(
<SwitchContainer disabled={textAreaDisabled} onClick={onModeToggle}>
<Slider isChat={chatSettings.mode === "chat"} />
<SwitchOption isActive={chatSettings.mode === "code"}>Code</SwitchOption>
<SwitchOption isActive={chatSettings.mode === "task"}>Task</SwitchOption>
<SwitchOption isActive={chatSettings.mode === "chat"}>Chat</SwitchOption>
</SwitchContainer>
</ControlsContainer>

View file

@ -30,7 +30,7 @@ const TaskHeader: React.FC<TaskHeaderProps> = ({
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<TaskHeaderProps> = ({
flexGrow: 1,
minWidth: 0, // This allows the div to shrink below its content size
}}>
<span style={{ fontWeight: "bold" }}>Task{!isTaskExpanded && ":"}</span>
<span style={{ fontWeight: "bold" }}>
{chatSettings.mode === "task" ? "Task" : "Chat"}
{!isTaskExpanded && ":"}
</span>
{!isTaskExpanded && <span style={{ marginLeft: 4 }}>{highlightMentions(task.text, false)}</span>}
</div>
</div>