@agimon-ai/po-workflow 0.0.0-alpha.155 → 0.0.0-alpha.156

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,7 +8,6 @@ import { StyleSheet } from "react-native-unistyles";
8
8
  import { Pressable } from "react-native-unistyles/components/native/Pressable";
9
9
  import { FlatList } from "react-native-unistyles/components/native/FlatList";
10
10
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
- import { useStore } from "@tanstack/react-store";
12
11
  /** The activity panel's scope line while a step tab is open. */
13
12
  const STEP_ACTIVITY_SCOPE = "diagnose step";
14
13
  const WORKFLOW_RUNS_TYPE = "workflow_runs";
@@ -3143,8 +3142,13 @@ function StepParentFill({ sessionId, sessionContext, openSession, holdSessionCha
3143
3142
  if (payload !== null) workflowRunsChannel.apply(parent, payload);
3144
3143
  });
3145
3144
  }, [parent, holdSessionChannels]);
3146
- const parentRuns = useStore(workflows.store, (state) => workflows.select(state, sessionId).parentRuns);
3147
- const ownerRuns = useStore(workflows.store, (state) => workflows.select(state, parent ?? null).runs);
3145
+ const subscribe = useCallback((listener) => {
3146
+ const subscription = workflows.store.subscribe(listener);
3147
+ return () => subscription.unsubscribe();
3148
+ }, []);
3149
+ const state = useSyncExternalStore(subscribe, () => workflows.store.state);
3150
+ const parentRuns = workflows.select(state, sessionId).parentRuns;
3151
+ const ownerRuns = workflows.select(state, parent ?? null).runs;
3148
3152
  const fromHub = stepPlace(parentRuns, sessionId);
3149
3153
  const fromOwner = step ? stepPlace(ownerRuns, sessionId)?.run : void 0;
3150
3154
  useEffect(() => {
@@ -3173,7 +3177,7 @@ function StepParentFill({ sessionId, sessionContext, openSession, holdSessionCha
3173
3177
  current = false;
3174
3178
  };
3175
3179
  }, [missing, sessionId]);
3176
- const reported = useStore(workflows.store, (state) => sessionId !== null && sessionId in state || parent !== void 0 && parent in state);
3180
+ const reported = sessionId !== null && sessionId in state || parent !== void 0 && parent in state;
3177
3181
  if (sessionId === null || !step) return null;
3178
3182
  const place = fromHub ?? stepPlace(fromOwner === void 0 ? [] : [fromOwner], sessionId);
3179
3183
  if (place === void 0 && !reported) return null;