diff --git a/messages/en.json b/messages/en.json index 2c9f1a0..be1ee69 100644 --- a/messages/en.json +++ b/messages/en.json @@ -198,6 +198,7 @@ "runs_status_running": "Running", "runs_status_completed": "Completed", "runs_status_failed": "Failed", + "runs_deleteRun": "Delete run", "runs_status_pending": "Pending", "analysis_title": "Analysis", diff --git a/src/main/ipc/catalog.ts b/src/main/ipc/catalog.ts index 7e2c35d..8932744 100644 --- a/src/main/ipc/catalog.ts +++ b/src/main/ipc/catalog.ts @@ -9,7 +9,7 @@ import { } from '../db/detections'; import { clearDatabase } from '../db/database'; import { getLocations, getLocationsWithCounts } from '../db/locations'; -import { getRunsWithStats } from '../db/runs'; +import { getRunsWithStats, deleteRun } from '../db/runs'; import { resolveAll, searchByCommonName } from '../labels/label-service'; import type { Detection, @@ -42,6 +42,10 @@ export function registerCatalogHandlers(): void { return getRunsWithStats(); }); + ipcMain.handle('catalog:delete-run', (_event, id: number) => { + deleteRun(id); + }); + ipcMain.handle('catalog:get-detections', (_event, filter: DetectionFilter) => { // If species filter is set, also resolve common name matches from label service if (filter.species) { diff --git a/src/preload/index.ts b/src/preload/index.ts index 23ac4be..c924a44 100644 --- a/src/preload/index.ts +++ b/src/preload/index.ts @@ -18,6 +18,7 @@ const ALLOWED_INVOKE_CHANNELS = new Set([ 'clip:get-spectrogram', 'clip:export-region', 'catalog:get-runs', + 'catalog:delete-run', 'catalog:get-detections', 'catalog:search-species', 'catalog:get-species-summary', diff --git a/src/renderer/src/lib/components/RunList.svelte b/src/renderer/src/lib/components/RunList.svelte index 736934c..a772451 100644 --- a/src/renderer/src/lib/components/RunList.svelte +++ b/src/renderer/src/lib/components/RunList.svelte @@ -1,5 +1,5 @@
- + {#if appState.selectedRunId && selectedRun}