Shrink follow ups (#30)

* Task attempt bc164e47-b15c-4550-abd3-1f980a2750c9 - Final changes

* Task attempt bc164e47-b15c-4550-abd3-1f980a2750c9 - Final changes

* Task attempt bc164e47-b15c-4550-abd3-1f980a2750c9 - Final changes

* Task attempt bc164e47-b15c-4550-abd3-1f980a2750c9 - Final changes

* Task attempt bc164e47-b15c-4550-abd3-1f980a2750c9 - Final changes

* Lint

* Prettier
This commit is contained in:
Louis Knight-Webb
2025-07-01 00:03:57 +01:00
committed by GitHub
parent a16ae05350
commit 165d99fab7
3 changed files with 25 additions and 37 deletions

View File

@@ -191,7 +191,6 @@ export function TaskDetailsPanel({
followUpError={followUpError}
setFollowUpError={setFollowUpError}
canSendFollowUp={canSendFollowUp}
isAttemptRunning={isAttemptRunning}
projectId={projectId}
onSendFollowUp={handleSendFollowUp}
/>

View File

@@ -1,7 +1,6 @@
import { Send, AlertCircle } from 'lucide-react';
import { Button } from '@/components/ui/button';
import { Alert, AlertDescription } from '@/components/ui/alert';
import { Label } from '@/components/ui/label';
import { FileSearchTextarea } from '@/components/ui/file-search-textarea';
interface TaskFollowUpSectionProps {
@@ -11,7 +10,6 @@ interface TaskFollowUpSectionProps {
followUpError: string | null;
setFollowUpError: (error: string | null) => void;
canSendFollowUp: boolean;
isAttemptRunning: boolean;
projectId: string;
onSendFollowUp: () => void;
}
@@ -23,23 +21,21 @@ export function TaskFollowUpSection({
followUpError,
setFollowUpError,
canSendFollowUp,
isAttemptRunning,
projectId,
onSendFollowUp,
}: TaskFollowUpSectionProps) {
return (
<div className="border-t p-6">
<div className="space-y-3">
<Label className="text-sm font-medium">Follow-up question</Label>
<div className="border-t p-4">
<div className="space-y-2">
{followUpError && (
<Alert variant="destructive">
<AlertCircle className="h-4 w-4" />
<AlertDescription>{followUpError}</AlertDescription>
</Alert>
)}
<div className="space-y-3">
<div className="flex gap-2 items-start">
<FileSearchTextarea
placeholder="Ask a follow-up question about this task... Type @ to search files."
placeholder="Ask a follow-up question... Type @ to search files."
value={followUpMessage}
onChange={(value) => {
setFollowUpMessage(value);
@@ -57,37 +53,28 @@ export function TaskFollowUpSection({
}
}
}}
className="w-full min-h-[80px] resize-none"
className="flex-1 min-h-[40px] resize-none"
disabled={!canSendFollowUp}
projectId={projectId}
rows={4}
rows={1}
/>
<div className="flex justify-end">
<Button
onClick={onSendFollowUp}
disabled={
!canSendFollowUp || !followUpMessage.trim() || isSendingFollowUp
}
size="sm"
>
{isSendingFollowUp ? (
<div className="animate-spin rounded-full h-4 w-4 border-b-2 border-current" />
) : (
<>
<Send className="h-4 w-4 mr-2" />
Send
</>
)}
</Button>
</div>
<Button
onClick={onSendFollowUp}
disabled={
!canSendFollowUp || !followUpMessage.trim() || isSendingFollowUp
}
size="sm"
>
{isSendingFollowUp ? (
<div className="animate-spin rounded-full h-4 w-4 border-b-2 border-current" />
) : (
<>
<Send className="h-4 w-4 mr-2" />
Send
</>
)}
</Button>
</div>
<p className="text-xs text-muted-foreground">
{!canSendFollowUp
? isAttemptRunning
? 'Wait for current execution to complete before asking follow-up questions'
: 'Complete at least one coding agent execution to enable follow-up questions'
: 'Continue the conversation with the most recent executor session'}
</p>
</div>
</div>
);

View File

@@ -265,7 +265,9 @@ export function FileSearchTextarea({
const dropdownPosition = getDropdownPosition();
return (
<div className="relative">
<div
className={`relative ${className?.includes('flex-1') ? 'flex-1' : ''}`}
>
<Textarea
ref={textareaRef}
value={value}