summaryrefslogtreecommitdiff
path: root/makima/frontend/src/components/directives/DirectiveDetail.tsx
diff options
context:
space:
mode:
authorsoryu <soryu@soryu.co>2026-02-13 20:35:22 +0000
committersoryu <soryu@soryu.co>2026-02-13 20:35:22 +0000
commitad5af0f7677c73fc159a3036b9479d1d847adf97 (patch)
tree718633b10a12d1c36f51a903a1f4149c5c6677f7 /makima/frontend/src/components/directives/DirectiveDetail.tsx
parentc19da4baf036a395c50dfbd19f6a1a91a69229a7 (diff)
downloadsoryu-ad5af0f7677c73fc159a3036b9479d1d847adf97.tar.gz
soryu-ad5af0f7677c73fc159a3036b9479d1d847adf97.zip
Directive page improvements
Diffstat (limited to 'makima/frontend/src/components/directives/DirectiveDetail.tsx')
-rw-r--r--makima/frontend/src/components/directives/DirectiveDetail.tsx12
1 files changed, 11 insertions, 1 deletions
diff --git a/makima/frontend/src/components/directives/DirectiveDetail.tsx b/makima/frontend/src/components/directives/DirectiveDetail.tsx
index f9e7eed..b73463d 100644
--- a/makima/frontend/src/components/directives/DirectiveDetail.tsx
+++ b/makima/frontend/src/components/directives/DirectiveDetail.tsx
@@ -54,6 +54,16 @@ export function DirectiveDetail({
const hasTerminalTasks = directive.steps.some((s) => s.taskId && terminalStatuses.has(s.status));
// Build task map from directive steps and orchestrator
+ // Derive a stable key from the actual task IDs to avoid recreating the map on every poll
+ const taskMapKey = useMemo(() => {
+ const parts: string[] = [];
+ if (directive.orchestratorTaskId) parts.push(`o:${directive.orchestratorTaskId}`);
+ for (const step of directive.steps) {
+ if (step.taskId) parts.push(`${step.id}:${step.taskId}`);
+ }
+ return parts.join(",");
+ }, [directive.orchestratorTaskId, directive.steps]);
+
const taskMap = useMemo(() => {
const map = new Map<string, string>();
if (directive.orchestratorTaskId) {
@@ -65,7 +75,7 @@ export function DirectiveDetail({
}
}
return map;
- }, [directive.orchestratorTaskId, directive.steps]);
+ }, [taskMapKey]); // eslint-disable-line react-hooks/exhaustive-deps
// Subscribe to all task outputs
const { connected, entries, clearEntries } = useMultiTaskSubscription({