openclawdev-taskboard icon indicating copy to clipboard operation
openclawdev-taskboard copied to clipboard

# Mission Control Planning Issue Analysis

Open Trevor0132 opened this issue 9 months ago • 0 comments

Problem Description

When clicking on the "planning" tab of a task that is in "in_progress" status, the entire page refreshes instead of showing the planning content.

Root Cause

The issue is in the TaskModal component's PlanningTab usage. Currently, it always passes an onSpecLocked callback that triggers window.location.reload():

<PlanningTab 
  taskId={task.id} 
  onSpecLocked={() => {
    // Refresh task data when spec is locked
    window.location.reload();
  }}
/>

However, the PlanningTab component calls this onSpecLocked callback whenever it detects that planning is complete (data.isComplete && onSpecLocked). This happens both during active planning AND when viewing completed planning for historical tasks.

For tasks that are already in "in_progress" status (meaning planning was already completed), this causes an unnecessary page refresh when the user simply wants to view the planning results.

Solution

Modify the TaskModal component to only pass the onSpecLocked callback when the task is actually in "planning" status:

<PlanningTab 
  taskId={task.id} 
  onSpecLocked={task.status === 'planning' ? () => {
    // Refresh task data when spec is locked
    window.location.reload();
  } : undefined}
/>

This ensures that:

  • During active planning (task.status === 'planning'): Page refreshes when planning completes to show the updated task status
  • When viewing completed planning (task.status !== 'planning'): No page refresh occurs, allowing users to view planning content normally

Files Affected

  • src/components/TaskModal.tsx

Impact

This fix will resolve the reported issue without affecting the normal planning workflow. Users will be able to view planning content for tasks in any status without unexpected page refreshes.

Trevor0132 avatar Feb 06 '26 06:02 Trevor0132