Skip to content

Commit bbddd33

Browse files
ozgesolidkeyclaude
andcommitted
Show live analysis progress in compare header
- analyze-file-path now fires compare-analyze-progress events with phase/percent/message (same data as the main analyze-progress channel) - Compare header shows a thin progress bar + percent + phase message that updates live as the second file is scanned - Cleans up the progress listener on completion or error Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 699945d commit bbddd33

8 files changed

Lines changed: 71 additions & 15 deletions

File tree

.claude/scheduled_tasks.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"sessionId":"8f0be499-ca98-41cd-8b47-9502b96e8650","pid":40526,"procStart":"Sun Apr 26 13:23:16 2026","acquiredAt":1777214569944}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit f6b0621147b3d352ac113ad70d6a9221263f293a

.mcp.json

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,27 @@
22
"mcpServers": {
33
"logan": {
44
"command": "node",
5-
"args": ["dist/mcp-server/index.js"],
5+
"args": [
6+
"dist/mcp-server/index.js"
7+
],
68
"cwd": "/Users/storm/MY/REPOS/log-analyzer"
79
},
10+
"firebase-channel": {
11+
"command": "/opt/homebrew/Cellar/node@20/20.19.0_1/bin/node",
12+
"args": [
13+
"/Users/storm/MY/REPOS/nexum/firebase-channel/index.js"
14+
],
15+
"env": {
16+
"FIREBASE_PROJECT": "loom-45438",
17+
"FIREBASE_UID": "kDuGnwCnBfWCRq7t1KKmPMz69K62",
18+
"WORKSPACE_NAME": "log-analyzer",
19+
"FIREBASE_CREDENTIALS": "/Users/storm/MY/REPOS/nexum/firebase-service-account.json",
20+
"PERMISSION_PORT": "8792"
21+
}
22+
},
823
"lore": {
9-
"type": "url",
10-
"url": "https://europe-west4-lore-de692.cloudfunctions.net/mcp"
24+
"type": "http",
25+
"url": "https://lore-de692.web.app/mcp"
1126
}
1227
}
1328
}

src/main/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4136,7 +4136,12 @@ ipcMain.handle('analyze-file-path', async (_, filePath: string) => {
41364136

41374137
const compareSignal = { cancelled: false };
41384138
try {
4139-
const result = await analyzer.analyze(filePath, {}, undefined, compareSignal);
4139+
const result = await analyzer.analyze(
4140+
filePath,
4141+
{},
4142+
(progress) => mainWindow?.webContents.send('compare-analyze-progress', progress),
4143+
compareSignal
4144+
);
41404145
cacheAnalysisResult(filePath, result);
41414146
return { success: true, result };
41424147
} catch (error) {

src/preload/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,12 @@ const api = {
277277
return () => ipcRenderer.removeListener('analyze-progress', handler);
278278
},
279279

280+
onCompareAnalyzeProgress: (callback: (data: { phase: string; percent: number; message?: string }) => void): (() => void) => {
281+
const handler = (_: any, data: { phase: string; percent: number; message?: string }) => callback(data);
282+
ipcRenderer.on('compare-analyze-progress', handler);
283+
return () => ipcRenderer.removeListener('compare-analyze-progress', handler);
284+
},
285+
280286
// Open external URL in default browser
281287
openExternalUrl: (url: string): Promise<void> =>
282288
ipcRenderer.invoke('open-external-url', url),

src/renderer/renderer.ts

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11390,26 +11390,39 @@ async function showCompareModal(): Promise<void> {
1139011390
// Run analysis on the second file in background for density comparison
1139111391
compareFilePath = otherPath;
1139211392
compareAnalysisResult = null;
11393-
updateCompareHeader();
11393+
updateCompareHeader(0, 'Starting…');
1139411394

11395-
window.api.analyzeFilePath(otherPath).then((result: { success: boolean; result?: any; error?: string }) => {
11396-
if (result.success && result.result) {
11397-
compareAnalysisResult = result.result;
11398-
renderCompareHeader();
11399-
}
11400-
}).catch(() => {});
11395+
const unsubProgress = window.api.onCompareAnalyzeProgress((p) => {
11396+
updateCompareHeader(p.percent, p.message || p.phase);
11397+
});
11398+
11399+
window.api.analyzeFilePath(otherPath)
11400+
.then((result: { success: boolean; result?: any; error?: string }) => {
11401+
unsubProgress();
11402+
if (result.success && result.result) {
11403+
compareAnalysisResult = result.result;
11404+
renderCompareHeader();
11405+
} else {
11406+
updateCompareHeader(0, 'Analysis failed');
11407+
}
11408+
})
11409+
.catch(() => { unsubProgress(); updateCompareHeader(0, 'Analysis failed'); });
1140111410
}
1140211411

11403-
function updateCompareHeader(): void {
11412+
function updateCompareHeader(percent = 0, message = 'Analyzing…'): void {
1140411413
let header = document.getElementById('compare-header');
1140511414
if (!header) {
1140611415
header = document.createElement('div');
1140711416
header.id = 'compare-header';
1140811417
header.className = 'compare-header';
11409-
// Insert above the split view
1141011418
elements.editorContainer.insertBefore(header, elements.editorContainer.firstChild);
1141111419
}
11412-
header.innerHTML = '<span class="compare-analyzing">Analyzing for comparison…</span>';
11420+
header.innerHTML = `
11421+
<span class="compare-analyzing">Analyzing second file for comparison…</span>
11422+
<div class="compare-progress-bar-wrap">
11423+
<div class="compare-progress-bar-fill" style="width:${Math.max(2, percent)}%"></div>
11424+
</div>
11425+
<span class="compare-analyzing" style="min-width:80px;text-align:right">${percent}% — ${escapeHtml(message)}</span>`;
1141311426
}
1141411427

1141511428
function renderCompareHeader(): void {

src/renderer/styles.css

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3227,7 +3227,21 @@ body.platform-darwin .titlebar {
32273227
flex-shrink: 0;
32283228
gap: 6px;
32293229
}
3230-
.compare-analyzing { color: var(--text-muted); font-style: italic; }
3230+
.compare-analyzing { color: var(--text-muted); font-style: italic; white-space: nowrap; }
3231+
.compare-progress-bar-wrap {
3232+
flex: 1;
3233+
height: 4px;
3234+
background: rgba(255,255,255,0.08);
3235+
border-radius: 2px;
3236+
overflow: hidden;
3237+
min-width: 60px;
3238+
}
3239+
.compare-progress-bar-fill {
3240+
height: 100%;
3241+
background: var(--accent-color, #007acc);
3242+
border-radius: 2px;
3243+
transition: width 0.25s ease;
3244+
}
32313245
.compare-header-inner {
32323246
display: flex;
32333247
align-items: center;

src/renderer/types.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ interface Api {
368368
onIndexingProgress: (callback: (percent: number) => void) => () => void;
369369
onSearchProgress: (callback: (data: { percent: number; matchCount: number }) => void) => () => void;
370370
onAnalyzeProgress: (callback: (data: { phase: string; percent: number; message?: string }) => void) => () => void;
371+
onCompareAnalyzeProgress: (callback: (data: { phase: string; percent: number; message?: string }) => void) => () => void;
371372

372373
// Utilities
373374
openExternalUrl: (url: string) => Promise<void>;

0 commit comments

Comments
 (0)