MCPcopy
hub / github.com/claude-code-best/claude-code / findNextPendingTask

Function findNextPendingTask

src/components/Spinner.tsx:541–551  ·  view source on GitHub ↗
(tasks: Task[] | undefined)

Source from the content-addressed store, hash-verified

539}
540
541function findNextPendingTask(tasks: Task[] | undefined): Task | undefined {
542 if (!tasks) {
543 return undefined;
544 }
545 const pendingTasks = tasks.filter(t => t.status === 'pending');
546 if (pendingTasks.length === 0) {
547 return undefined;
548 }
549 const unresolvedIds = new Set(tasks.filter(t => t.status !== 'completed').map(t => t.id));
550 return pendingTasks.find(t => !t.blockedBy.some(id => unresolvedIds.has(id))) ?? pendingTasks[0];
551}

Callers 1

SpinnerWithVerbInnerFunction · 0.85

Calls 1

hasMethod · 0.45

Tested by

no test coverage detected