feat(ui): aggiunge anteprima desktop dei file non smistati

This commit is contained in:
2026-03-16 10:11:59 +01:00
parent 164959acaf
commit 3a567c390c
5 changed files with 198 additions and 1 deletions

16
main.js
View File

@@ -1,9 +1,10 @@
const { app, BrowserWindow, dialog, ipcMain } = require('electron');
const { app, BrowserWindow, dialog, ipcMain, shell } = require('electron');
const path = require('path');
const fs = require('fs-extra');
const { processFolder } = require('./services/folderProcessor');
const { processZip } = require('./services/zipProcessor');
const { resolveUnroutedDir, listUnroutedFiles } = require('./services/unrouted');
const CAD_EXTENSIONS = ['prt', 'asm', 'dwr'];
const DEFAULT_DESTINATION = './output/cad';
@@ -168,3 +169,16 @@ ipcMain.handle('update-destination', async (_event, payload) => {
await persistDestination(config.destination);
return { destination: config.destination };
});
ipcMain.handle('open-unrouted-folder', async () => {
const unroutedDir = await resolveUnroutedDir();
const openResult = await shell.openPath(unroutedDir);
if (openResult) {
throw new Error(`Impossibile aprire la cartella: ${openResult}`);
}
return { path: unroutedDir };
});
ipcMain.handle('list-unrouted-files', async () => listUnroutedFiles());