feat(create-lesson): multi-select book sections + exclusion heuristic + batch generation (#1949)#1953
Merged
Conversation
… + batch generation (#1949) Turn the #1927 book-file section picker from a single-select dropdown into a checkbox multi-select and generate one standalone lesson per selected section in a single batch run (one set, N lessons in document order). - section-heuristics: multilingual (DE/EN/FR) predicate that deselects likely front/back matter (preface, glossary, TOC, imprint, index, …) by default while keeping every section visible + checkable. - generate-book-lessons: extracts the single chunk->lesson step shared by the single and batch paths (no second generation logic) and a fault- tolerant batch loop (per-section failure recorded, run continues) with progress reporting. - book-to-lesson: buildBookLessons / buildBookLessonsUserSetInput assemble N lessons with unique ids into one set; the single builders delegate to them (regression-preserving: an empty entry title tracks meta.title). - BookFileUpload: checkbox list; exactly one selected keeps the existing "insert into text field" single path, more than one shows "Generate N lessons"; document-order emission; exclusion hint. - BookTextStep/BookSteps/CreateLesson: batch progress + summary (X of N, failed sections), bookLessons state, review lists N lessons, save persists the whole set. - i18n: new keys in all 11 catalogs. Manual test plan updated (DE + EN). Refs #1927 Closes #1949
astrapi69
force-pushed
the
claude/book-sections-multi-select-ee9wof
branch
from
July 22, 2026 21:48
f4cf43d to
4cdca32
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Turns the #1927 book-file section picker from a single-select dropdown into a checkbox multi-select, and generates one standalone lesson per selected section in a single batch run (one set, N lessons). Builds on #1927 (Phase 2a upload + single-select picker).
Binding design decision: batch produces N standalone lessons (one per section), not one giant lesson — short, focused micro-learning units mapped 1:1 to the book's author-set chapter boundaries. The "one run -> one lesson" model is preserved structurally, extended to "one batch run -> N lessons".
What changed
section-heuristics.ts): multilingual (DE/EN/FR) predicate that deselects likely front/back matter (preface, glossary, table of contents, imprint, index, …) by default while keeping every section visible and manually checkable.generate-book-lessons.ts): extracts the single chunk→lesson step shared by the single and batch paths (no second generation logic) plus a fault-tolerant batch loop — a per-section failure is recorded and the run continues — with progress reporting and an oversized-section guard.book-to-lesson.ts):buildBookLessons/buildBookLessonsUserSetInputassemble N lessons with unique ids into one set; the single builders delegate to them. Regression-preserving: the single paste path passes an empty entry title so the lesson id/title still trackmeta.title.BookFileUpload/BookTextStep/BookSteps/CreateLesson): checkbox list; exactly one selected keeps the existing "Insert into text field" single path (with the replace-confirm dialog and preview), more than one shows "Generate N lessons"; document-order emission (not selection order); batch progress ("Generating lesson 2 of 5…") + summary (X of N succeeded, which failed); review lists N lessons; save persists the whole set.Type of Change
Testing
--max-warnings 0clean on the changed files)Vorwort), batch-generates, and saves one set with two lessons.Documentation
make sync-i18n);verify-i18n-scriptscleanChecklist
Screenshots / Logs
Manual device verification (upload with front matter, multi-select batch, single-select regression) is the remaining human step per the Visual-Device-Check; automated coverage is green.
Refs #1927
Closes #1949
🤖 Generated with Claude Code
Generated by Claude Code