MCPcopy
hub / github.com/colbymchenry/codegraph / onProgress

Function onProgress

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

Source from the content-addressed store, hash-verified

29
30 return {
31 onProgress(progress: IndexProgress) {
32 const phaseName = PHASE_NAMES[progress.phase] || progress.phase;
33
34 if (progress.phase !== lastPhase && lastPhase) {
35 worker.postMessage({ type: 'finish-phase' });
36 }
37 lastPhase = progress.phase;
38
39 let percent = -1;
40 let count = 0;
41 if (progress.total > 0) {
42 percent = Math.round((progress.current / progress.total) * 100);
43 } else if (progress.current > 0) {
44 count = progress.current;
45 }
46
47 worker.postMessage({
48 type: 'update',
49 phase: progress.phase,
50 phaseName,
51 percent,
52 count,
53 });
54 },
55
56 stop() {
57 return new Promise<void>((resolve) => {

Callers 9

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

Calls 1

postMessageMethod · 0.65

Tested by

no test coverage detected