Move agent config description to instructions

This commit is contained in:
akhisud3195 2025-08-19 20:55:22 +05:30
parent 892c6d4bee
commit 3027bf0253
2 changed files with 23 additions and 19 deletions

View file

@ -41,6 +41,7 @@ interface TextInputFieldProps extends BaseInputFieldProps {
showSaveButton?: boolean;
showDiscardButton?: boolean;
immediateSave?: boolean;
minHeight?: string;
}
// Select input specific props
@ -109,6 +110,7 @@ function TextInputField({
showSaveButton = false,
showDiscardButton = false,
immediateSave = false,
minHeight,
}: TextInputFieldProps) {
const [isEditing, setIsEditing] = useState(false);
const [localValue, setLocalValue] = useState(value);
@ -248,7 +250,7 @@ function TextInputField({
{/* Input field */}
{mentions ? (
<div className="w-full min-h-[300px]">
<div className="w-full" style={minHeight ? { minHeight } : { minHeight: '300px' }}>
<MentionsEditor
atValues={mentionsAtValues}
value={localValue}
@ -326,10 +328,11 @@ function TextInputField({
"cursor-pointer hover:border-gray-300 dark:hover:border-gray-600 hover:bg-gray-50 dark:hover:bg-gray-800": !locked && !disabled,
"cursor-not-allowed opacity-60": locked || disabled,
"border-0 bg-transparent p-0": inline,
"min-h-[300px]": multiline,
"min-h-[40px]": !multiline,
"min-h-[300px]": multiline && !minHeight,
"min-h-[40px]": !multiline && !minHeight,
}
)}
style={minHeight ? { minHeight } : undefined}
onClick={() => !locked && !disabled && setIsEditing(true)}
>
{/* Content */}

View file

@ -319,6 +319,22 @@ export function AgentConfig({
</div>
) : (
<div className="space-y-6">
{/* Description Section */}
<div className="space-y-2">
<label className={sectionHeaderStyles}>Description</label>
<InputField
type="text"
value={agent.description || ""}
onChange={(value: string) => {
handleUpdate({ ...agent, description: value });
showSavedMessage();
}}
multiline={true}
placeholder="Enter a description for this agent"
minHeight="40px"
className="w-full"
/>
</div>
{/* Instructions Section */}
<div className="space-y-2">
<div className="flex items-center justify-between">
@ -493,22 +509,7 @@ export function AgentConfig({
/>
</div>
</div>
<div className="flex flex-col md:flex-row md:items-start gap-1 md:gap-0">
<label className="text-sm font-semibold text-gray-600 dark:text-gray-300 md:w-32 mb-1 md:mb-0 md:pr-4">Description</label>
<div className="flex-1">
<InputField
type="text"
value={agent.description || ""}
onChange={(value: string) => {
handleUpdate({ ...agent, description: value });
showSavedMessage();
}}
multiline={true}
placeholder="Enter a description for this agent"
className="w-full"
/>
</div>
</div>
</div>
</SectionCard>
{/* Behavior Section Card */}