Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions webview-ui/src/components/chat/ChatTextArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
// Only hide the context menu if the user didn't click on it.
if (!isMouseDownOnMenu) {
setShowContextMenu(false)

}

setIsFocused(false)
Expand Down
13 changes: 6 additions & 7 deletions webview-ui/src/components/prompts/PromptsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -663,13 +663,13 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
// For custom modes, update the JSON file
updateCustomMode(visualMode, {
...customMode,
roleDefinition: value.trim() || "",
roleDefinition: value || "",
source: customMode.source || "global",
})
} else {
// For built-in modes, update the prompts
updateAgentPrompt(visualMode, {
roleDefinition: value.trim() || undefined,
roleDefinition: value || undefined,
})
}
}}
Expand Down Expand Up @@ -845,15 +845,15 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
// For custom modes, update the JSON file
updateCustomMode(visualMode, {
...customMode,
customInstructions: value.trim() || undefined,
customInstructions: value || undefined,
source: customMode.source || "global",
})
} else {
// For built-in modes, update the prompts
const existingPrompt = customModePrompts?.[visualMode] as PromptComponent
updateAgentPrompt(visualMode, {
...existingPrompt,
customInstructions: value.trim(),
customInstructions: value,
})
}
}}
Expand Down Expand Up @@ -989,7 +989,7 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
setCustomInstructions(value || undefined)
vscode.postMessage({
type: "customInstructions",
text: value.trim() || undefined,
text: value || undefined,
})
}}
rows={4}
Expand Down Expand Up @@ -1064,8 +1064,7 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
const value =
(e as unknown as CustomEvent)?.detail?.target?.value ||
((e as any).target as HTMLTextAreaElement).value
const trimmedValue = value.trim()
updateSupportPrompt(activeSupportOption, trimmedValue || undefined)
updateSupportPrompt(activeSupportOption, value || undefined)
}}
rows={6}
className="resize-y w-full"
Expand Down
6 changes: 5 additions & 1 deletion webview-ui/src/components/ui/autosize-textarea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ export const AutosizeTextarea = React.forwardRef<AutosizeTextAreaRef, AutosizeTe
}))

React.useEffect(() => {
setTriggerAutoSize(value as string)
// Don't trim the value when setting the trigger
if (typeof value === "string") {
setTriggerAutoSize(value)
}
}, [props?.defaultValue, value])

return (
Expand All @@ -98,6 +101,7 @@ export const AutosizeTextarea = React.forwardRef<AutosizeTextAreaRef, AutosizeTe
className,
)}
onChange={(e) => {
// Ensure we're not trimming the value
setTriggerAutoSize(e.target.value)
onChange?.(e)
}}
Expand Down