Add glossary feature with dynamic translation step hiding#43
Merged
nicpottier merged 3 commits intomainfrom Feb 14, 2026
Merged
Add glossary feature with dynamic translation step hiding#43nicpottier merged 3 commits intomainfrom
nicpottier merged 3 commits intomainfrom
Conversation
- Implement glossary generation from rendered HTML text with batching * Zod schemas for glossary items and LLM output * Pure extraction function with DOM parser (htmlparser2) * Configurable batching, model, and language settings * Automatic deduplication (case-insensitive, first-wins) - Integrate glossary as post-storyboard proof step (after image captioning) * Add glossary to StepName enum and AppConfig schema * Run glossary generation per page batch with LLM caching * Store glossary items with page count and timestamp - Dynamically hide translation step when not needed * Add step-skip event type to ProgressEvent schema * Backend emits step-skip when translation is determined unnecessary * Frontend tracks skipped steps and filters them from display * Fixes race condition with stale config data - Add complete test coverage (27 new tests, all passing) * Pipeline glossary tests: HTML stripping, config, text collection, generation * API route tests: retrieval, error handling * Proof runner integration tests with cache pre-population
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.
Summary
Adds the glossary feature ported from the Python
adt-pressrepository, integrated as a post-storyboard proof step. Extracts pedagogically relevant vocabulary from rendered HTML text and generates definitions via LLM.Also implements dynamic translation step hiding: the backend now emits a
step-skipevent when translation is determined unnecessary (editing language matches book language), allowing the frontend to reactively hide the step without stale config data issues.Changes
Test Plan
pnpm typecheck✓pnpm test✓ (389/389)