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

View file

@ -319,6 +319,22 @@ export function AgentConfig({
</div> </div>
) : ( ) : (
<div className="space-y-6"> <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 */} {/* Instructions Section */}
<div className="space-y-2"> <div className="space-y-2">
<div className="flex items-center justify-between"> <div className="flex items-center justify-between">
@ -493,22 +509,7 @@ export function AgentConfig({
/> />
</div> </div>
</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> </div>
</SectionCard> </SectionCard>
{/* Behavior Section Card */} {/* Behavior Section Card */}