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} followUpError={followUpError}
setFollowUpError={setFollowUpError} setFollowUpError={setFollowUpError}
canSendFollowUp={canSendFollowUp} canSendFollowUp={canSendFollowUp}
isAttemptRunning={isAttemptRunning}
projectId={projectId} projectId={projectId}
onSendFollowUp={handleSendFollowUp} onSendFollowUp={handleSendFollowUp}
/> />

View File

@@ -1,7 +1,6 @@
import { Send, AlertCircle } from 'lucide-react'; import { Send, AlertCircle } from 'lucide-react';
import { Button } from '@/components/ui/button'; import { Button } from '@/components/ui/button';
import { Alert, AlertDescription } from '@/components/ui/alert'; import { Alert, AlertDescription } from '@/components/ui/alert';
import { Label } from '@/components/ui/label';
import { FileSearchTextarea } from '@/components/ui/file-search-textarea'; import { FileSearchTextarea } from '@/components/ui/file-search-textarea';
interface TaskFollowUpSectionProps { interface TaskFollowUpSectionProps {
@@ -11,7 +10,6 @@ interface TaskFollowUpSectionProps {
followUpError: string | null; followUpError: string | null;
setFollowUpError: (error: string | null) => void; setFollowUpError: (error: string | null) => void;
canSendFollowUp: boolean; canSendFollowUp: boolean;
isAttemptRunning: boolean;
projectId: string; projectId: string;
onSendFollowUp: () => void; onSendFollowUp: () => void;
} }
@@ -23,23 +21,21 @@ export function TaskFollowUpSection({
followUpError, followUpError,
setFollowUpError, setFollowUpError,
canSendFollowUp, canSendFollowUp,
isAttemptRunning,
projectId, projectId,
onSendFollowUp, onSendFollowUp,
}: TaskFollowUpSectionProps) { }: TaskFollowUpSectionProps) {
return ( return (
<div className="border-t p-6"> <div className="border-t p-4">
<div className="space-y-3"> <div className="space-y-2">
<Label className="text-sm font-medium">Follow-up question</Label>
{followUpError && ( {followUpError && (
<Alert variant="destructive"> <Alert variant="destructive">
<AlertCircle className="h-4 w-4" /> <AlertCircle className="h-4 w-4" />
<AlertDescription>{followUpError}</AlertDescription> <AlertDescription>{followUpError}</AlertDescription>
</Alert> </Alert>
)} )}
<div className="space-y-3"> <div className="flex gap-2 items-start">
<FileSearchTextarea <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} value={followUpMessage}
onChange={(value) => { onChange={(value) => {
setFollowUpMessage(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} disabled={!canSendFollowUp}
projectId={projectId} projectId={projectId}
rows={4} rows={1}
/> />
<div className="flex justify-end"> <Button
<Button onClick={onSendFollowUp}
onClick={onSendFollowUp} disabled={
disabled={ !canSendFollowUp || !followUpMessage.trim() || isSendingFollowUp
!canSendFollowUp || !followUpMessage.trim() || isSendingFollowUp }
} size="sm"
size="sm" >
> {isSendingFollowUp ? (
{isSendingFollowUp ? ( <div className="animate-spin rounded-full h-4 w-4 border-b-2 border-current" />
<div className="animate-spin rounded-full h-4 w-4 border-b-2 border-current" /> ) : (
) : ( <>
<> <Send className="h-4 w-4 mr-2" />
<Send className="h-4 w-4 mr-2" /> Send
Send </>
</> )}
)} </Button>
</Button>
</div>
</div> </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>
</div> </div>
); );

View File

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