|
|
@@ -22,6 +22,7 @@ export interface FlowChartRef {
|
|
|
}
|
|
|
|
|
|
export type SubTraceEntry = { id: string; mission?: string };
|
|
|
+type FlowMessage = Message & { _injectedGoalId?: string };
|
|
|
|
|
|
const normalizeSubTraceEntries = (goal: Goal): SubTraceEntry[] =>
|
|
|
(goal.sub_trace_ids ?? [])
|
|
|
@@ -174,7 +175,7 @@ const FlowChartComponent: ForwardRefRenderFunction<FlowChartRef, FlowChartProps>
|
|
|
return false;
|
|
|
};
|
|
|
|
|
|
- let allMessages: (Message & { _injectedGoalId: string })[] = [];
|
|
|
+ let allMessages: FlowMessage[] = [];
|
|
|
Object.entries(msgGroups).forEach(([goalId, msgs]) => {
|
|
|
msgs.forEach((m) => {
|
|
|
allMessages.push({ ...m, id: m.id || m.message_id, _injectedGoalId: goalId });
|
|
|
@@ -202,7 +203,7 @@ const FlowChartComponent: ForwardRefRenderFunction<FlowChartRef, FlowChartProps>
|
|
|
const foldedNodeMap = new Map<string, LayoutNode>();
|
|
|
const timelineNodes: LayoutNode[] = [];
|
|
|
|
|
|
- const timelineItems: (Message | { _isFoldedNode: true, goalId: string, count: number })[] = [];
|
|
|
+ const timelineItems: (FlowMessage | { _isFoldedNode: true; goalId: string; count: number })[] = [];
|
|
|
const foldedGoalsContent = new Map<string, number>();
|
|
|
|
|
|
let currentFold: string | null = null;
|
|
|
@@ -256,7 +257,7 @@ const FlowChartComponent: ForwardRefRenderFunction<FlowChartRef, FlowChartProps>
|
|
|
foldedNodeMap.set(item.goalId, node);
|
|
|
}
|
|
|
} else {
|
|
|
- const msg = item as Message;
|
|
|
+ const msg = item as FlowMessage;
|
|
|
let marker: LayoutNode["marker"] = undefined;
|
|
|
const mc = typeof msg.content === "object" && msg.content ? msg.content : null;
|
|
|
|