1
0

auto-git:

[change] main.js
 [change] preload.js
 [change] renderer.js
This commit is contained in:
Victor Giers
2025-12-08 13:18:53 +01:00
parent 27ad9225e9
commit f52eb353ab
3 changed files with 36 additions and 1 deletions

21
main.js
View File

@@ -2442,6 +2442,27 @@ function buildTrayMenu() {
}
});
ipcMain.handle('trigger-rewrite-now', async (_e, folderPath) => {
let folders = store.get('folders') || [];
const idx = folders.findIndex(f => f.path === folderPath);
if (idx === -1) return { success: false, error: 'folder not found' };
const folderObj = folders[idx];
if (folderObj.needsRelocation) return { success: false, error: 'needs relocation' };
if (folderObj.rewriteInProgress) return { success: false, error: 'rewrite in progress' };
if (!folderObj.llmCandidates || !folderObj.llmCandidates.length) return { success: false, error: 'no candidates' };
// Reset counters/timers
folderObj.linesChanged = 0;
folderObj.firstCandidateBirthday = Date.now();
store.set('folders', folders);
// Fire and forget
runLLMCommitRewrite(folderObj, win).catch(err => {
debug(`[trigger-rewrite-now] Error for ${folderPath}: ${err.message || err}`);
});
return { success: true };
});