Skip to content

Commit 67f9de3

Browse files
committed
fix(scheduled-tasks): remount task details on occurrence switch
The read-only details editor seeds its prompt + mention contexts on mount only. Selecting a different finished task while the modal stays open swapped the Status/run-time fields but left the editor on the first task's prompt. Key the content by the occurrence id so each task gets a fresh mount.
1 parent f56d9da commit 67f9de3

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

apps/sim/app/workspace/[workspaceId]/scheduled-tasks/components/task-details-modal/task-details-modal.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ export function TaskDetailsModal({ task, onClose }: TaskDetailsModalProps) {
5555
size='md'
5656
srTitle='Scheduled task'
5757
>
58-
{task && <TaskDetailsContent task={task} onClose={onClose} />}
58+
{/* Key by the occurrence id so switching tasks while the modal stays open
59+
remounts the content — the editor seeds prompt + contexts on mount, so
60+
without a fresh mount it would keep showing the first task's prompt. */}
61+
{task && <TaskDetailsContent key={task.id} task={task} onClose={onClose} />}
5962
</ChipModal>
6063
)
6164
}

0 commit comments

Comments
 (0)