feat: add word highlighting, manual glossary terms, and speech audio uploads#315
Merged
elasticsounds merged 12 commits intomainfrom Apr 29, 2026
Merged
Conversation
* feat(glossary): autofill manual glossary entries from book text
Adds an autocomplete-powered Add Glossary dialog that suggests words
from the book and auto-generates definition, variations, and emoji via
a new single-term LLM route.
* fix(tts): scope audio element discovery to #content and gate word highlight toggle
- Narrow gatherAudioElements selector from .container to #content so UI chrome
elements in interface.html don't pollute the TTS queue
- Conditionally show the word-highlight toggle based on the highlight feature flag
- Drop approximate evenly-divided timings when word timecodes are missing; fall
back to simpler block highlight to avoid drift
- Force yellow-on-black styling for highlighted word spans regardless of parent
text color
- Reposition collapsed accessibility card button
* chore(tts): remove debug console logs
* fix(tts): bust browser cache when replacing audio files
Uploaded audio reuses the same on-disk filename as the generated TTS
(`{textId}.{format}`), so the audio URL didn't change after replace. With
Cache-Control: public, max-age=86400 on the audio route, the browser kept
serving the previous bytes and the waveform never refreshed.
Include a per-entry cacheKey (audio file mtime) in the TTS GET response and
upload-one response, and append it as a `?v=` query param on getAudioUrl.
Also fold cacheKey into the WaveformPlayer React key so the player remounts
on replace.
* fix(tts): use URLSearchParams for cache-bust query to satisfy lint
Contributor
|
Hey Ravi - I've made a lot of changes to make this functional. Here is the list.
|
Resolve conflicts in Lingui catalogs by accepting the feature branch, re-running extract, and backfilling translations for 35 new strings from main across es/fr/pt-BR. Adapt package-web tests to main's section schema rename (parts -> nodes).
Contributor
|
Very cool set of features, having this broken out into separate PRs would have been good. Nice work on all of these though! On highlighting, awesome feature to add, work great!
On Glossary:
|
Contributor
|
List of changes:
|
Contributor
|
Contributor
|
Contributor
|
#332) - Make word_highlighting opt-in (default false) across runtime, packaging, and preview routes - Split tts and word-timestamps into separate pipeline steps with their own progress - Cache Whisper word timestamps on audio+language+prompt for fast re-runs - Compute stage-missing counts from configured output languages so never-run langs surface - Stop reordering glossary list when adding manual entries; add inline emoji editor - Localize the word-highlight preview sentence and add ES/FR/PT-BR translations - Add re-run banner, Switch-based highlight toggle, and timestamp clamping in TranslationsView - Quick-toggle TTS button now starts playback immediately when enabling read-aloud
#334) The autofill suggestions in AddGlossaryDialog read from the text-catalog node, which is only built during the translate stage. Books that have only run through glossary/quizzes had no catalog, so suggestions were empty. The text-catalog GET endpoint now lazily builds the catalog from existing pipeline outputs when missing. Also disables Add Term and the version-picker Save button while the glossary stage is running, to prevent a pending edit from clobbering a freshly generated glossary on save.
Contributor
|
Contributor
|
@nicpottier ready for your review before merge |
Auto-generate now also fires on word input blur, but clicking the regenerate icon button blurs the input first and then runs its onClick, which caused two LLM generations per click. Skip the blur-triggered auto-generate when focus is moving to the regenerate button.
Contributor
|
@copilot resolve the merge conflicts in this pull request |
Resolved conflicts in: - packages/pipeline/src/package-web.ts: kept both speechConfig and features options - apps/api/src/services/export-service.ts: kept both speechConfig and features in opts - apps/studio/src/components/pipeline/components/StageSidebar.tsx: merged imports, used main's iconFilled logic - apps/studio/src/locales/*.po: merged all new strings from both branches Co-authored-by: elasticsounds <5905047+elasticsounds@users.noreply.github.com>
Contributor
Merge conflicts resolved in commit ff4126e. The 7 conflicting files were:
TypeScript checks and tests all pass. |
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
What Changed
Speech
Word Highlighttoggle for book creatorsAccessibility
Word highlighttoggle in AccessibilitySettingsGlossary
Add Termflow in the Glossary stagePreview and Packaging
Testing
pnpm exec vitest run apps/api/src/routes/adt-preview.test.ts apps/api/src/routes/glossary.test.ts apps/api/src/routes/tts.test.ts apps/api/src/services/stage-runner.test.ts packages/pipeline/src/__tests__/glossary.test.ts packages/pipeline/src/__tests__/text-catalog.test.ts packages/pipeline/src/__tests__/package-web.test.ts assets/adt/modules/tts_highlighter_utils.test.jspnpm exec tsc --noEmit -p apps/api/tsconfig.jsonpnpm exec tsc --noEmit -p apps/studio/tsconfig.jsonNotes