MCPcopy
hub / github.com/Dimillian/CodexMonitor / resolveVisibleParentId

Function resolveVisibleParentId

src/features/app/hooks/useThreadRows.ts:62–73  ·  view source on GitHub ↗
(threadId: string)

Source from the content-addressed store, hash-verified

60 const childrenByParent = new Map<string, ThreadSummary[]>();
61 const roots: ThreadSummary[] = [];
62 const resolveVisibleParentId = (threadId: string) => {
63 let current = threadParentById[threadId];
64 const visited = new Set<string>([threadId]);
65 while (current && !visited.has(current)) {
66 if (threadIds.has(current)) {
67 return current;
68 }
69 visited.add(current);
70 current = threadParentById[current];
71 }
72 return null;
73 };
74
75 visibleThreads.forEach((thread) => {
76 const parentId = resolveVisibleParentId(thread.id);

Callers 1

useThreadRowsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected