diff --git a/frontend/src/stores/import.js b/frontend/src/stores/import.js index 9d4832e..2358274 100644 --- a/frontend/src/stores/import.js +++ b/frontend/src/stores/import.js @@ -56,7 +56,27 @@ export const useImportStore = defineStore('import', () => { triggerError.value = null try { await api.post('/api/import/trigger', { body: { mode: 'quick' } }) + // Acknowledge immediately so the click isn't invisible. scan_directory + // can finalize the batch synchronously when every file in /import is + // already on a non-failed ImportTask (operator-flagged 2026-05-25: + // 233k existing tasks → all paths in skip-set → files_seen=0 → + // batch flashes 'running' for <100ms then 'complete' before the + // first refreshStatus() lands; UI never sees the active state). + window.__fcToast?.({ text: 'Scan triggered', type: 'success' }) await refreshStatus() + // Re-poll twice over ~5s to catch quick-finalize transitions and + // surface a result toast either way. + setTimeout(async () => { + await refreshStatus() + if (!activeBatch.value) { + // Either scan completed with zero new files, or it never visibly + // started. Fetch the freshest task to differentiate. + window.__fcToast?.({ + text: 'Scan complete — no new files (everything already on an ImportTask row)', + type: 'info', + }) + } + }, 2000) } catch (e) { triggerError.value = e.message window.__fcToast?.({ text: `Scan failed: ${e.message}`, type: 'error' })