File tree Expand file tree Collapse file tree 5 files changed +18
-6
lines changed
Expand file tree Collapse file tree 5 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -83,12 +83,13 @@ const PlanChat: React.FC<PlanChatProps> = ({
8383 value = { input }
8484 onChange = { setInput }
8585 onEnter = { ( ) => OnChatSubmit ( input ) }
86+ disabledChat = { ! planData . hasHumanClarificationRequest }
8687 >
8788 < Button
8889 appearance = "transparent"
8990 onClick = { ( ) => OnChatSubmit ( input ) }
9091 icon = { < Send /> }
91- disabled = { planData . hasHumanClarificationRequest && ( isTyping || ! input . trim ( ) ) }
92+ disabled = { ! planData . hasHumanClarificationRequest && ( ! input . trim ( ) ) }
9293 />
9394
9495 </ ChatInput >
Original file line number Diff line number Diff line change @@ -10,8 +10,10 @@ import { TaskDetailsProps } from "@/models";
1010
1111const PlanPanelRight : React . FC < TaskDetailsProps > = ( {
1212 planData,
13+
1314 OnApproveStep,
1415 OnRejectStep,
16+ processingSubtaskId
1517} ) => {
1618 if ( ! planData ) return null ;
1719
@@ -28,6 +30,7 @@ const PlanPanelRight: React.FC<TaskDetailsProps> = ({
2830 planData = { planData }
2931 OnApproveStep = { OnApproveStep }
3032 OnRejectStep = { OnRejectStep }
33+ processingSubtaskId = { processingSubtaskId }
3134 />
3235 </ div >
3336 </ PanelRight >
Original file line number Diff line number Diff line change @@ -18,13 +18,15 @@ import { TaskService } from "@/services";
1818const TaskDetails : React . FC < TaskDetailsProps > = ( {
1919 planData,
2020 OnApproveStep,
21- OnRejectStep
21+ OnRejectStep,
22+ processingSubtaskId
2223} ) => {
2324 const completedCount = planData . plan . completed || 0 ;
2425 const total = planData . plan . total_steps || 1 ; // Avoid division by zero
2526 const subTasks = planData . steps || [ ] ;
2627 const progress = completedCount / total ;
2728 const agents = planData . agents || [ ] ;
29+
2830 // Helper function to render the appropriate status icon
2931 const renderStatusIcon = ( status : string ) => {
3032
@@ -90,11 +92,12 @@ const TaskDetails: React.FC<TaskDetailsProps> = ({
9092 < >
9193 < CheckboxChecked20Regular
9294 onClick = { planData . hasHumanClarificationRequest ? ( ) => OnApproveStep ( subtask ) : undefined }
93- className = { `${ ! planData . hasHumanClarificationRequest ? 'task-details-checkbox-icon-disabled' : 'task-details-checkbox-icon' } ` }
95+ className = { `${ ! planData . hasHumanClarificationRequest && processingSubtaskId === subtask . id ? 'task-details-checkbox-icon-disabled' : 'task-details-checkbox-icon' } ` }
96+
9497 />
9598 < DismissSquare20Regular
9699 onClick = { planData . hasHumanClarificationRequest ? ( ) => OnRejectStep ( subtask ) : undefined }
97- className = { `${ ! planData . hasHumanClarificationRequest ? 'task-details-dismiss-icon-disabled' : 'task-details-dismiss-icon' } ` }
100+ className = { `${ ! planData . hasHumanClarificationRequest && processingSubtaskId === subtask . id ? 'task-details-dismiss-icon-disabled' : 'task-details-dismiss-icon' } ` }
98101 />
99102 </ >
100103 ) }
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ export interface Human {
2222
2323export interface TaskDetailsProps {
2424 planData : ProcessedPlanData ;
25+ processingSubtaskId : string | null ;
2526 OnApproveStep : ( step : Step ) => void ;
2627 OnRejectStep : ( step : Step ) => void ;
2728}
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ const PlanPage: React.FC = () => {
4242 const [ planData , setPlanData ] = useState < ProcessedPlanData | any > ( null ) ;
4343 const [ loading , setLoading ] = useState < boolean > ( true ) ;
4444 const [ error , setError ] = useState < Error | null > ( null ) ;
45-
45+ const [ processingSubtaskId , setProcessingSubtaskId ] = useState < string | null > ( null ) ;
4646 /**
4747 * Fetch plan data when component mounts or planId changes
4848 */
@@ -84,11 +84,14 @@ const PlanPage: React.FC = () => {
8484
8585 // Move handlers here to fix dependency order
8686 const handleApproveStep = useCallback ( async ( step : Step ) => {
87+ setProcessingSubtaskId ( step . id ) ;
8788 try {
8889 await PlanDataService . approveStep ( step ) ;
8990 await loadPlanData ( ) ;
9091 } catch ( error ) {
91- console . error ( 'Failed to approve step:' , error ) ;
92+ console . error ( 'Failed to reject step:' , error ) ;
93+ } finally {
94+ setProcessingSubtaskId ( null ) ;
9295 }
9396 } , [ loadPlanData ] ) ;
9497
@@ -142,6 +145,7 @@ const PlanPage: React.FC = () => {
142145 planData = { planData }
143146 OnApproveStep = { handleApproveStep }
144147 OnRejectStep = { handleRejectStep }
148+ processingSubtaskId = { processingSubtaskId }
145149 />
146150 </ CoralShellRow >
147151 </ CoralShellColumn >
You can’t perform that action at this time.
0 commit comments