diff --git a/src/lib/utils/saveMarkdown.ts b/src/lib/utils/saveMarkdown.ts index 4117837..bd88540 100644 --- a/src/lib/utils/saveMarkdown.ts +++ b/src/lib/utils/saveMarkdown.ts @@ -90,11 +90,24 @@ export async function exportTranscriptsToDir( console.error("exportTranscriptsToDir write failed", path, err); } } - toasts.success( - written === items.length - ? `Exported ${written} transcript${written === 1 ? "" : "s"} to ${basename(dir)}` - : `Exported ${written} of ${items.length} transcripts to ${basename(dir)}`, - ); + if (written === 0) { + // All writes failed — surface as an error instead of "Exported 0 + // transcripts" success toast which reads like the user just bulk- + // exported nothing on purpose. + toasts.error( + "Couldn't export transcripts", + `0 of ${items.length} written to ${basename(dir)}. Check the console for details.`, + ); + } else if (written === items.length) { + toasts.success( + `Exported ${written} transcript${written === 1 ? "" : "s"} to ${basename(dir)}`, + ); + } else { + toasts.warn( + `Partial export to ${basename(dir)}`, + `${written} of ${items.length} transcripts written. Check the console for the failures.`, + ); + } return written; }