Fix #1007: don't export empty audio folders; trim + gate the warning modal#1074
Fix #1007: don't export empty audio folders; trim + gate the warning modal#1074sampjvv wants to merge 4 commits into
Conversation
…modal When an audio export included a file/chapter with no audio, the wizard wrote an empty per-book folder containing only a NOTICE.txt, and the step-2 warning modal could be dismissed (X / click-outside) without acknowledging it. - projectExportView: trim the "Files Without Audio" / "Files Without Text" warning text (drop the now-inaccurate "empty folder/output" wording + shared note), and require an explicit OK to dismiss the warning (remove the X and the click-outside dismissal) so the export can't proceed unacknowledged. - exportHandler: delete generateMissingContentNotices() — the only code that wrote the empty per-book folder + NOTICE.txt — plus its call and the now-unused analyzeNotebookContent import. - audioExporter: report what was omitted for lack of audio in the completion summary instead — at book (whole file) AND chapter (milestone) level — fixing the inconsistency where an empty chapter inside an audio-bearing book was dropped silently with no feedback. Tests: book-level (no NOTICE.txt + skip line) and chapter-level skip-summary cases; existing export cancellation test still passes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Follow-up edge cases — "Files Without Audio" warning (out of scope for this PR)Flagging for @LeviXIII to look into. The no-audio warning only fires the moment you click the Include Audio option, so it can be bypassed when the selection changes afterward. Two cases it misses:
Common thread: the warning is a one-shot trigger; it should re-evaluate whenever the file or chapter selection changes (i.e. gate on "current selection has no audio," re-checked at each step). |
…ing back The step-2 "Files Without Audio" warning only ran inside the audio option's click handler. Because the audio option is deliberately remembered across back-navigation (unlike text formats, which are cleared and re-clicked), a user could select an audio book, choose Include Audio, go back, add a no-audio book, and advance with no warning at all. Track the file-selection signature at the time the check last ran, and on arrival at step 2 from the file step re-run the check when the audio option is still selected and the selection changed. Unchanged selections are not re-warned (the modal was already acknowledged with OK). Follow-up to the #1007 fixes; scenario 2 from the PR #1074 edge-case comment. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Update: scenario 2 (re-selecting files after the audio format is already set) is now fixed in this PR (53c7aba) — arriving at step 2 from the file step re-runs the no-audio check when the audio option is still selected and the file selection changed. An unchanged, already-acknowledged selection is not re-warned. Scenario 1 (chapter-level deselection) remains open. |
Closes #1007.
Problem
On an audio export that includes a file/chapter with no audio: the wizard wrote an empty per-book folder containing only a
NOTICE.txt, and the step-2 "Files Without Audio" warning could be dismissed (X / click-outside) without acknowledging it.Testing also surfaced an inconsistency: a book is one
.codexfile and chapters are milestones within it. The warning/NOTICE logic was per-file, but the exporter silently drops per-chapter — so an empty chapter inside an audio-bearing book vanished with no feedback at all.Changes
1. Trim the warning modal (
projectExportView.ts) — drop the now-inaccurate "…their exported audio folders will be empty" / "…will produce empty output…" wording from the shared warning popup; keep the header + "The following files have no audio/text translations." + file list.2. Stop writing the empty folder +
NOTICE.txt(exportHandler.ts) — deletegenerateMissingContentNotices()(the only code creating the per-book folder +NOTICE.txt), its call site, and the now-unusedanalyzeNotebookContentimport.reporter.complete()is unchanged.3. Report skips in the completion summary instead — file and chapter level (
audioExporter.ts) — per book, track which selected milestones produced audio. A whole no-audio book →"Skipped (no audio): N book(s) — …"; selected-but-empty chapters →"Chapters skipped (no audio): GEN 1; …"(book-prefixed, capped at 6). These flow through the existingextraMessages→ completion summary, so there's no new plumbing. Only chapters that were selected but produced no audio task count (download failures stay in their existing category; the whole-book opt-out is excluded).4. Require explicit OK to dismiss the warning (
projectExportView.ts) — the warning is a full-screen blocking modal; removing the X button and the click-outside dismissal leaves OK as the only way out, so the export can't proceed until it's acknowledged. Applies to both the audio and text warnings (shared popup). No keyboard/Escape bypass exists for this popup.Verification
tsc --noEmit+eslint+npm run compileclean.src/test/suite/export/audioSkipSummary.test.ts): book-level (noNOTICE.txtwritten + skip line in the summary) and chapter-level (an empty selected chapter is reported as skipped, not silently dropped). ExistingexportCancellationtest still passes — 3 export tests green.NOTICE.txt, skipped books/chapters listed in the summary; (b) the warning modal has no X and ignores click-outside — only OK dismisses it.🤖 Generated with Claude Code