MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / onProgress

Function onProgress

src/ui/shimmer-progress.ts:74–100  ·  view source on GitHub ↗
(progress: IndexProgress)

Source from the content-addressed store, hash-verified

72
73 return {
74 onProgress(progress: IndexProgress) {
75 const phaseName = PHASE_NAMES[progress.phase] || progress.phase;
76
77 if (progress.phase !== lastPhase && lastPhase) {
78 printPhaseDone();
79 }
80 lastPhase = progress.phase;
81 lastPhaseName = phaseName;
82
83 let percent = -1;
84 let count = 0;
85 if (progress.total > 0) {
86 percent = Math.round((progress.current / progress.total) * 100);
87 } else if (progress.current > 0) {
88 count = progress.current;
89 }
90 lastPercent = percent;
91 lastCount = count;
92
93 worker.postMessage({
94 type: 'update',
95 phase: progress.phase,
96 phaseName,
97 percent,
98 count,
99 });
100 },
101
102 stop() {
103 return new Promise<void>((resolve) => {

Callers 10

scanDirectoryFunction · 0.85
scanDirectoryAsyncFunction · 0.85
walkFunction · 0.85
indexAllMethod · 0.85
storeResultMethod · 0.85
recordParseFailureMethod · 0.85
syncMethod · 0.85
resolveAllMethod · 0.85
emitFunction · 0.85

Calls 3

printPhaseDoneFunction · 0.85
postMessageMethod · 0.65
writeMethod · 0.45

Tested by

no test coverage detected