Key-point chips in the pre-generation outline editor used a single-line
`truncate`, so longer points were cut off with an ellipsis and users could
not read the full text while reviewing the outline. Let the text wrap within
the chip's max width and add a native title tooltip as a fallback.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(generation): changeOutlineType total constructor for valid type switches
Switching a scene outline's type in the editor only flipped `type` and left
the new type without its required config, so applyOutlineFallbacks silently
downgraded interactive/pbl back to slide. changeOutlineType returns a new
outline that strips foreign per-type config and seeds the target type's
required config from the shared fields, valid by construction.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* i18n(generation): keys for interactive widget kind and PBL project config
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(editor): make outline type changes take effect with config forms
TypePill now builds a valid outline via changeOutlineType (replace, not
partial-merge) so a type switch drops stale config and seeds the new type's
required config — no longer silently downgraded to slide by applyOutlineFallbacks.
Adds InteractiveConfigDisclosure (widget kind + concept) and PblConfigDisclosure
(topic / description / target skills), mirroring QuizConfigDisclosure, so users
can configure interactive and PBL scenes that previously had no input UI.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(editor): move type-specific config under the type pill
The quiz/interactive/PBL config disclosure rendered as a detached chip at the
bottom-left of the card, reading like a stray key point. Pin it to the
bottom-right of the key-points row instead, so it sits directly under the
TypePill it configures (type top-right -> its config bottom-right, same edge),
with key points flowing on the left.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(editor): cascade type config as a connected segment left of the type pill
Replace the standalone config chip with a cascading control in the header: the
type-specific config (quiz count / interactive widget kind / PBL project) renders
as a themed segment joined to the left of the TypePill, the two clipped into one
rounded pill split by a hairline divider. Reads as a single 'config › type'
cascade and groups the config with the selector it refines.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(editor): address cross-review — preserve widget config, drop stale fields
- changeOutlineType: preserve an existing procedural-skill widget config
instead of replacing it with a seeded simulation (codex P2 — task-engine
fields were silently dropped on Interactive re-select).
- InteractiveConfigDisclosure.setWidgetType: reset widgetOutline to the shared
concept only, so switching widget kind drops the previous kind's fields
(claude P2 — language/gameType/etc. leaked across kinds).
- i18n locale-coverage test now also checks ko-KR and pt-BR.
- Drop a redundant WidgetType cast; add tests for procedural-skill preservation
and pbl targetSkills dedupe/cap.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(editor): round 2 cross-review nits — procedural-skill label + skill a11y
- InteractiveConfigDisclosure: when an outline carries a preserved
procedural-skill widget, surface it as the current (selected) kind with its
own label instead of mislabeling it 'Simulation', and make a same-kind
re-select a no-op so its task-engine fields are never silently clobbered.
- PBL target-skill remove button uses a dedicated removeSkill aria-label.
- Add widgetProceduralSkill / removeSkill i18n keys (8 locales) + test coverage.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(generation): make re-selecting the current outline type a no-op
changeOutlineType rebuilt the outline on every type-menu click, so re-selecting
the already-current type dropped fields it doesn't re-seed — legacy
interactiveConfig, or a partial pblConfig whose projectTopic is empty — turning a
harmless click into data loss. Short-circuit same-type selections to return the
outline untouched (codex P2).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(format): prettier --write files left unformatted on main
These 14 agent/edit files (not part of this PR's feature) fail the repo-wide
`prettier . --check` in the required Lint job — they landed on main unformatted,
turning main's CI (and therefore this PR after a branch update) red. Formatting
them here unblocks the required check; pure formatting, no logic changes.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(lint): suppress intentional set-state-in-effect in reasoning timer
The reasoning timer does a deliberate one-shot setState in its effect to show
the right elapsed value before the first 1s interval tick. main's CI fails the
required Lint job on the new react-hooks/set-state-in-effect rule here; suppress
it with a justification (no behavior change). Unblocks the required check.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(settings): enforce "usable provider ⇒ concrete model" invariant (#580)
Layer 1 — resolve provider AND model atomically at every source:
- add resolveSelectedModel(): like validateModel but no empty-input
short-circuit, so it returns '' only when the provider has no models
- fetchServerProviders: symmetric LLM/image/video provider recovery +
resolveSelectedModel; remove the asymmetric #577 isServerConfigured-gated
LLM tail and the separate first-load auto-select block (now subsumed,
and covers client-API-key providers too)
- setProviderConfig: entering an API key for the active/unset LLM provider
resolves a concrete model in the same set()
- setVideoProvider: resolve a model on switch (was id-only); setImageProvider
routed through the shared resolver
Layer 2 — remove states unreachable under the invariant:
- add shared isLLMProviderConfigured / hasUsableLLMProvider; gate the
landing-page generate button on a usable provider (state A vs B) and drop
the modelNotConfigured toast + forced SettingsDialog
- generation-toolbar: use the shared predicate; drop the dead "Select Model"
label/tooltip fallback
- delete dead components/settings/model-selector.tsx (zero refs) and the
now-orphan settings.selectModel i18n key (6 locales)
Note: generation-toolbar's `providerEntries.length === 0` branch is KEPT —
it is reachable via search (search-no-results), not the dead no-provider
state the issue assumed. modelNotConfigured i18n key kept (still used by
the chat path in use-chat-sessions).
Tests: resolveSelectedModel + hasUsableLLMProvider unit tests; server-sync
invariant tests (client-key resolution, atomic API-key entry, provider
switch, serverModels-preference + first-load regression guards).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix(settings): address code review — symmetric image/video config resolution
Code review Important #1: fold atomic model resolution into
setImageProviderConfig / setVideoProviderConfig (design doc Layer 1 step 2
scoped these). Deleting the selected custom image/video model on the active
provider now resolves to a valid model in the same set() instead of leaving
it stale until the next server sync — restores LLM/image/video symmetry.
Minor #2/#3: document the deliberate store-level (credential path) vs
UX-level (incl. ≥1 model) "usable" split on isProviderUsable; clarify that
setProviderConfig also adopts providerId on the first-load API-key path.
Tests: +2 invariant tests (delete selected custom image/video model →
falls back to a valid model). 89/89 store tests pass, tsc clean.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix(settings): keyless providers need explicit baseUrl to count as usable (#580)
Code-review/e2e follow-up. ollama/lemonade ship requiresApiKey:false +
a registry defaultBaseUrl, so the old isLLMProviderConfigured counted them
as configured on a fresh install — but buildFallback/reconcile never
auto-selects keyless providers, so hasUsableProvider could be true while
modelId stayed '', re-enabling generation with no model (the exact #498/#580
class of bug, just via the keyless path).
Narrow isLLMProviderConfigured to be consistent with isProviderUsable:
keyless ⇒ usable only once the user sets an explicit baseUrl (registry
defaultBaseUrl alone is not user intent); server-config and key-requiring
paths unchanged. Now gate + toolbar + reconcile agree, and genuine State A
(no usable provider) is reachable again.
Add e2e/tests/model-invariant-580.spec.ts: State A (no provider → generate
disabled + single "Set up model" affordance, no toast/forced dialog) and
State B (server-configured → concrete model auto-resolved, generation
enabled). +3 keyless unit tests. 92/92 store tests + 2 e2e pass, tsc clean.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix(settings): re-resolve selection on bulk provider-config change (#580)
Self-test found: deleting the selected provider in Settings left the model
selector pointing at the deleted/invalid provider (or, via the component's
hand-rolled fallback, at an unusable built-in like openai with no key).
Root cause: setProvidersConfig (the bulk setter behind delete-provider /
delete-model) did ZERO re-resolution — Layer 1 covered setProviderConfig
(singular) + image/video setters + the reconcile, but not this path. The
component's confirmDeleteProvider then picked Object.keys()[0] (always a
built-in, ignoring usability), the exact per-call-site hand-rolled shape
#580 condemns.
Fix at the source: setProvidersConfig now re-resolves (providerId, modelId)
via the canonical isLLMProviderConfigured + resolveSelectedModel — keep the
current provider if still usable, else first usable, else State A. Removed
the brittle confirmDeleteProvider override (kept only its local Settings-tab
selection). Now every bulk config mutation (delete, import, reset) holds the
invariant.
Tests: +2 store tests (delete selected/only-usable provider → State A, not
the deleted/invalid one; delete non-selected → keep usable selection).
94/94 store tests, full suite green (only pre-existing ssrf DNS), tsc/eslint clean.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix(settings): one shared LLM-selection resolver for all config edits (#580)
Clarified repro: the realistic case isn't deleting a custom provider — it's
clearing the SELECTED provider's API key so it becomes invalid. setProvider
Config only re-resolved when the edit made a provider *usable*; the
"became unusable" transition fell through (return base) → the now-invalid
provider stayed selected. The previous commit fixed only the bulk path.
Root-cause fix: extract one shared `resolveLLMSelection(config, providerId,
modelId)` — keep current provider if still usable, else first usable, else
State A; then resolve the model. Use it in BOTH setProviderConfig (single
edit: key add/clear, model-list edit) and setProvidersConfig (bulk: delete,
import, reset). The two paths can no longer diverge — exactly the per-call-
site asymmetry #580 set out to eliminate. Drops the now-unused
isProviderUsable import.
Tests: +2 store tests (clear selected provider key → drops stale selection;
clear non-selected key → keeps usable selection). 96/96 store tests, full
suite green except pre-existing ssrf DNS; tsc + eslint clean.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* style: prettier-format #580 test specs
CI 'Lint, Typecheck & Unit Tests' ran prettier . --check and failed on the
two added test specs (only tsc/eslint/vitest were run locally). Pure
whitespace reformat, no logic change — 96/96 store tests still green.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
* feat: add outline review preview flow
* style: refine outline review editor
* fix(home): make draft cache survive round-trips through generation flows
The `useDraftCache` hook initialised state via `useState`'s lazy
initialiser. Under React 18+ SSR, the initialiser runs on the server
(returns `undefined` because `window` is missing), the SSR'd state is
sent to the client, and React reuses it on hydration without re-running
the initialiser. As a result `cachedValue` was always `undefined` and
nothing ever rehydrated from `localStorage`.
The home page's `prevCachedRequirement` derived-state pattern then
masked the symptom: it initialised `prev` to the same (always
undefined) `cachedRequirement`, so the comparison never fired and the
restore branch was unreachable.
Switch to an effect-based read so consumers actually receive a state
update after mount, and replace the home page's derived-state restore
with a `useEffect` + `useRef` guard that only fills the input when it
is empty. Side benefit: PBL chat draft and quiz answer caches start
working too — they used the same broken pattern.
* feat(outline-review): clickable streaming card morphs into editor + UX overhaul
Major refresh of the outline review surface introduced in #198, applying
the placement design from docs/superpowers/specs. Key shifts:
Streaming card → editor morph
- The streaming preview card in the generation-preview page is now an
interactive surface (tilt + hover-straighten + always-visible "点击审阅"
affordance) that morphs into the full editor via shared `layoutId`.
- SSE keeps streaming uninterrupted into the expanded editor; the editor
consumes either `session.sceneOutlines` or live `streamingOutlines` so
scenes appear as they arrive and stay in sync after edits.
- A header collapse button shrinks back to the preview card. Mid-stream
collapse keeps SSE running; post-stream collapse re-arms the same 2.5s
auto-continue timer the no-review path uses, so the card doesn't strand.
Document-style editor
- Replaces the bordered card + accordion + numbered rail with a Notion-
feeling stack: drag handle and number share a flex left rail aligned to
the title baseline; title/description are inline-editable borderless
textareas with auto-resize.
- ⋮ overflow menu and explicit move-up/move-down are removed; reordering
is drag-only, with hover-revealed delete (popover-confirmed) next to the
type pill.
- Hover-revealed `+` insert dividers between scenes; faint `+` at the
list edges replaces the "Add scene" bar so insertion is uniform.
- Quiz config popover redesigned: stepper for question count, segmented
control for difficulty, multi-select pills for question types so mixed
types from the LLM round-trip correctly (the previous single-select
silently truncated `questionTypes` to one element).
- Streaming placeholder row pulses below the latest scene during SSE.
- Scene types use a colour-coded pill that doubles as the type switcher.
State + flow plumbing
- Adds `previewPhase: 'review'` entry from the streaming visualizer via
`outlineReviewIntentRef`; SSE-completion ORs in this intent when
deciding whether to wait for confirmation.
- `localStorage.removeItem('requirementDraft')` moves to after the review
promise resolves so "Back to requirements" actually restores the draft.
- Auto-start condition broadened so refreshes during early-review
reattach to a fresh SSE rather than stalling on an empty editor.
- Six new locales (en-US, zh-CN, zh-TW, ja-JP, ru-RU, ar-SA) for the
expand hint, streaming progress, collapse, delete confirmation,
insert hint, and quiz summary; locale coverage test asserts the new
keys plus the `{{count}}` interpolation contracts.
Removed: the redundant "Review outline" button + auto-continue caption
under the preview card, since the card itself is now the entry point.
Removed: the home toolbar "Outline" tab from #198 — placement design
explicitly rejects adding another always-visible toolbar control.
* fix(outline-review): address code review feedback (PR #558)
Single follow-up commit batching the issues raised in code review:
Critical
- E2E page object's reviewOutlineButton was hunting for the removed
"Review outline" button. Re-target it to the streaming card's
outlineExpandHint aria-label across all six locales.
Important
- waitForOutlineReviewChoice now accepts an AbortSignal and rejects on
abort, so goBackToHome / unmount settle the parked promise instead of
leaking the awaiting startGeneration closure. The existing AbortError
catch swallows the rejection cleanly.
- Add CLDR plural variants for the count-bearing strings: en gets _one;
ru gets _one and _few for quizConfigSummary; ar gets _one and _two
for the three count-bearing strings. Bare key remains as _other
fallback. (zh / zh-TW / ja have a single plural form.)
- Document the mid-stream collapse intent: dropping outlineReviewIntentRef
is deliberate so SSE-completion takes the no-review path.
- Add keyboard reorder on the drag handle (Ctrl/⌘ + ArrowUp/ArrowDown)
with aria-keyshortcuts; replace dragScene copy with dragSceneHint that
surfaces the shortcut. Restores WCAG 2.1.1 reachability for reorder.
- KeyPointInput no longer commits on blur — only Enter / comma. Avoids
surprise chips when users click away mid-typing.
Minor
- Drop unused i18n keys: reviewOutlineAction, moveSceneUp/Down, dragScene,
sceneDescriptionLabel, keyPointsLabel/Placeholder, quizConfigLabel,
addScene. Locale coverage test pruned to match actual usage.
- requestAnimationFrame-batch useAutoResize so a burst of edits doesn't
thrash layout (forced reflow per keystroke).
- Reset isConfirmingOutlines in the no-parked-promise fallback path of
handleConfirmOutlines so state doesn't linger.
* chore(outline-review): prettier format + drop redundant session check
- Run prettier on outlines-editor.tsx (CI Lint job was red).
- Remove `&& session` from the StepVisualizer onExpandOutline conditional;
`session` is guaranteed non-null at that point by the early-return guard
above (flagged by github-code-quality bot).
* fix(home): silence react-hooks/set-state-in-effect on draft restore
Match the existing eslint-disable convention already used in
app/page.tsx for the other localStorage-hydration effects. The setState
calls are deliberate: client-side state hydration from localStorage
must happen in an effect to remain SSR-safe (the lazy useState
initialiser runs on the server with `window` undefined).
* revert(i18n): drop CLDR plural variants until key-alignment check supports them
scripts/check-i18n-keys.mjs enforces strict key equality across all
locales, which is incompatible with i18next's per-locale plural-suffix
keys (a Russian locale needs `_one`/`_few`/`_many`/`_other`, an
Arabic one adds `_two`/`_zero`, while zh / ja need none). The check
script doesn't strip plural suffixes before comparing, so any partial
pluralization breaks alignment.
Roll back the partial fix from PR review #2 and revert to the bare
keys. The original "ungrammatical for n=1" wording stays, to be
addressed in a follow-up that also teaches check-i18n-keys.mjs to
ignore CLDR plural suffixes when comparing key sets.
* fix(outline-review): make streaming card expand-hint pill actually visible
The "Tap to review" pill was rendering but invisible in practice because:
- Both the bottom white gradient (z-auto) and the pill (z-10) sit inside the
same parent stacking context, but motion.div applies a transform that
creates per-element stacking contexts; the implicit ordering put the
gradient above the pill in some browsers.
- text-[9px] + bg-blue-500/95 was too thin/translucent to read against the
white gradient even when on top.
Make stacking explicit (gradient z-0, pill z-20), bump the pill to text-[10px]
font-semibold with solid bg-blue-500, larger Maximize icon, and lift it
slightly to bottom-2 so it sits above the gradient haze.
Keyless providers (e.g. Ollama) with a hardcoded defaultBaseUrl were
unconditionally passing the provider filter because `!requiresApiKey`
short-circuited to true. Now keyless providers require an explicit
user-provided baseUrl or server configuration to appear.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: inline language inference in outline generation
Replace manual language selection with automatic inference from user
requirement text. The outline generator now produces a languageDirective
that propagates through the entire generation pipeline.
Key changes:
- Rewrite Language Inference section in outline prompt with decision
rules for foreign language learning, cross-language PDF, proxy
requests, and terminology handling
- Reorder pipeline: outlines before agents, so agent profiles can
use the inferred languageDirective
- Pass languageDirective through scene content/actions generation
- Add SSE streaming of languageDirective from outline generation
- Remove manual language selection UI
Eval test suite:
- 50 test cases covering 9 scenario types: single-language, language
learning, immersive, explicit instruction, code-switching, minimal
input, user profiles, cross-language PDF, locale mismatch
- LLM-as-judge evaluation with configurable inference/judge models
- 50/50 pass rate with gemini-3-flash-preview + gpt-4o judge
- Excluded from CI (requires LLM API keys)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* chore: remove useless attributes in test case
* feat: pass languageDirective to PBL, remove hardcoded zh-CN/en-US
- Remove pblConfig.language field, use languageDirective from outline
inference instead
- Delete all Chinese prompt duplicates in pbl-system-prompt.ts,
agent-templates.ts; keep English templates with languageDirective
injection
- Remove zh-CN/en-US branches in generate-pbl.ts (initial prompt,
post-process context, welcome message)
- Pipe languageDirective through scene-generator → generatePBLContent
→ IssueboardMCP → agent templates
- Remove i18n template wrapping from PBL welcome messages in
pbl-renderer.tsx and use-pbl-chat.ts; use LLM-generated content
directly to avoid language mismatch when UI locale ≠ course language
- Update pblConfig schema in outline prompt (remove language field)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor: clean up legacy language fields, pass languageDirective through buildSceneFromOutline
- Add languageDirective param to buildSceneFromOutline, combining with
outline.languageNote via buildLanguageText
- Remove dead types: AudienceProfile, StylePreferences, LegacyUserRequirements,
SceneOutline.language
- Remove Stage.language and all its propagation (storage, stageInfo, prompt-builder fallback)
- Remove GenerateClassroomInput.language and job store inputSummary.language
- Remove unused pdfLanguageSample from outline SSE route
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: persist languageDirective to IndexedDB, fix TTS preview and dead refs
- Add languageDirective to StageRecord and stage-storage write path
- Add DB v9 migration: convert legacy language locale codes to directives
- Use voice.language for TTS preview text instead of dead localStorage key
- Omit empty ## Language section in PBL agent prompts
- Use JSON.parse for extractLanguageDirective unescape (\uXXXX support)
- Remove dead i18n keys: toolbar.languageHint, pbl.chat.welcomeMessage
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat(audio): extend TTSProviderId/ASRProviderId to support custom providers
* feat(audio): update provider registry helpers for custom provider support
* feat(audio): route custom providers to OpenAI-compatible implementations
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(audio): add custom TTS/ASR provider CRUD to settings store
* feat(audio): add dialog for creating custom audio providers
* feat(audio): add custom provider UI with voice management and delete
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat(i18n): add custom audio provider translation strings
* fix(audio): resolve remaining type errors for custom provider support
Add `as keyof typeof` casts where TTSProviderId/ASRProviderId (which now
include template literal types) index into the built-in-only registries
TTS_PROVIDERS, ASR_PROVIDERS, DEFAULT_TTS_VOICES, and DEFAULT_TTS_MODELS.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(audio): allow custom provider IDs to reach switch default branch
The early guard `if (!provider) throw` blocked custom provider IDs from
reaching the switch-case default branch where they get routed to
OpenAI-compatible implementations.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat(audio): add default model field to dialog and polish voice list UI
- Add "Default Model" input to custom audio provider dialog (fixes
Kokoro needing model:"kokoro" instead of fallback "gpt-4o-mini-tts")
- Redesign voice list as aligned table with column headers, hover
reveal delete buttons, and empty state message
- Add Enter key support to voice add inputs
- Use consistent grid layout for add voice row
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(audio): fallback to customDefaultBaseUrl when testing custom TTS provider
The baseUrl field in provider config is empty by default (it's an
override field). Custom providers store their default URL in
customDefaultBaseUrl, which needs to be used as fallback for test.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(audio): auto-select first voice when adding to custom TTS provider
When a custom provider's voice is 'default' (initial state before any
voices are added), adding the first voice now automatically updates the
active voice selection so test TTS works immediately.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(audio): fallback to customDefaultBaseUrl in all TTS call sites
Scene generator, discussion TTS, and agent bar voice preview all read
providerConfig.baseUrl which is empty for custom providers (the default
URL is stored in customDefaultBaseUrl). Add fallback chain to all 4
call sites so custom providers work during actual playback, not just
in the settings test.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(audio): include custom provider voices in agent voice picker
getAvailableProvidersWithVoices only iterated built-in TTS_PROVIDERS,
so custom providers never appeared in the agent bar voice dropdown.
Now also iterates ttsProvidersConfig for custom-tts-* entries and
includes their customVoices in the picker.
Also updated getServerVoiceList, findVoiceDisplayName, and
resolveAgentVoice to handle custom provider voice lookups.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(audio): fallback to customDefaultBaseUrl in all ASR call sites
Same issue as TTS: audio-recorder, asr-settings, and audio-settings
all read providerConfig.baseUrl which is empty for custom providers.
Add customDefaultBaseUrl fallback to all 3 ASR call sites.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat(audio): add model list management for custom ASR providers
Custom ASR providers now support adding/removing models with a table
UI (same design as TTS voice list). The model selector dropdown shows
custom models and auto-selects the first one.
Also adds custom ASR providers to the Toolbar's ASR provider dropdown
and fixes custom provider handling in audio-settings.tsx (baseUrl
fallback, request URL preview, API key section visibility).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(audio): seed customModels from defaultModel and fix ASR model label
- When creating custom ASR provider with a defaultModel, auto-add it
to customModels so the model list isn't empty on first visit
- Fix ASR settings label from "TTS Model" to "Default Model"
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(audio): separate ASR model management from creation dialog
ASR models should be managed in provider settings (add/remove from
list, select default), not pre-filled at creation time. Unlike TTS
where a single default model suffices, ASR users need to manage
multiple models (e.g. whisper-small, whisper-large-v3).
- Remove Default Model field from ASR creation dialog (keep for TTS)
- Remove defaultModel parameter from addCustomASRProvider
- ASR models are added via the model list UI in provider settings
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(audio): simplify ASR model management — first model is default
Remove the separate model selector dropdown for custom ASR providers.
The first model in the list is always used as default. Users manage
the model list only (add/remove), no separate "default" selection.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(audio): add loading state and detailed errors to ASR test
- Show spinner with "Processing..." while waiting for transcription
- Disable record button during processing
- Show specific error messages from API (e.g. "No transcription
generated") instead of generic failure text
- Handle empty transcription result as an error with helpful message
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(i18n): use correct key for processing label in ASR test button
* fix(audio): polish custom provider UX and type safety
- Add proper type declarations for custom provider fields (customName,
customDefaultBaseUrl, customVoices, etc.) eliminating 30+ unsafe casts
- Show custom ASR providers in toolbar with default language list
- Hide custom ASR providers without models from toolbar selection
- Add no-models warning in ASR settings panel
- Add delete confirmation dialog for custom TTS/ASR providers
- Add duplicate voice/model ID validation with toast error
- Add dedicated i18n keys for ASR model management (modelNamePlaceholder, addModel)
- Fix i18n key for ASR processing label (settings.asrProcessing)
- Add radio-button model selection in custom ASR provider settings
- Add visible OpenAI-compatible description in provider creation dialog
- Add CUSTOM_ASR_DEFAULT_LANGUAGES constant for toolbar language options
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(test): add isCustomTTSProvider/isCustomASRProvider to audio types mock
The settings-server-sync test mocked @/lib/audio/types as an empty object,
but settings.ts now imports isCustomASRProvider for provider validation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(audio): add customDefaultBaseUrl fallback in all TTS/ASR call sites
When a custom provider is created, the actual URL is stored in
customDefaultBaseUrl while baseUrl is initialized empty. Several call
sites only checked baseUrl, causing fetch failures during course
generation. Add fallback to customDefaultBaseUrl in:
- generation-preview/page.tsx (course generation TTS)
- tts-providers.ts (getCurrentTTSConfig)
- asr-providers.ts (getCurrentASRConfig)
- media-popover.tsx (TTS preview)
- tts-config-popover.tsx (TTS preview)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* style: format generation-preview/page.tsx
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: remove unused ttsSpeedRange variable in media-popover
Flagged by CodeQL code quality check.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* chore: update Ollama logo to official version
Closes#399
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: improve OpenAI and Ollama logo visibility across themes
OpenAI logo (white fill) was invisible on light backgrounds, and Ollama
logo (black fill) was invisible on dark backgrounds. Normalize OpenAI SVG
to black fill and apply dark:invert via a central MONO_LOGO_PROVIDERS set.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(tts): unify model selection to per-provider and fix ElevenLabs model_id (#324)
- Move model selection from global ttsModelId to per-provider
ttsProvidersConfig[providerId].modelId
- Remove supportsModelSelection flag, use models.length > 0 instead
- Add defaultModelId to TTSProviderConfig and ASRProviderConfig
- Add providerOptions field to TTSModelConfig for future extensibility
- Fix ElevenLabs hardcoded model_id: 'eleven_multilingual_v2'
- Fix MiniMax TTS using config.model instead of config.modelId
- Update model lists from provider docs:
- Qwen: add qwen3-tts-instruct-flash, qwen-tts
- ElevenLabs: add eleven_flash_v2_5, eleven_flash_v2
- MiniMax: remove non-existent speech-2.8 series
- Replace custom model CRUD UI with simple Select dropdown
- Remove MiniMax-specific hardcoded model selector from audio-settings
- Add migration for old ttsModelId/asrModelId/model fields
* feat(tts): voice picker groups by provider:model, sets both model and voice
Voice selection in agent bar now groups voices by model. Picking a
voice from a model group sets both modelId and voiceId on the agent.
TTS settings shows available models as display-only chips.
- Add compatibleModels field to TTSVoiceInfo (OpenAI marin/cedar restricted to gpt-4o-mini-tts)
- Add modelId to agent voiceConfig and ResolvedVoice
- Add ModelVoiceGroup to ProviderWithVoices, build groups in getAvailableProvidersWithVoices
- Update AgentVoicePill and TeacherVoicePill to iterate modelGroups
- Thread modelId from voice selection through discussion TTS pipeline
- Replace model Select with display-only chips in tts-settings
* fix(tts): show provider name in voice picker group headers
* fix(tts): restore MiniMax speech-01 models per official API docs
* fix(tts): add MiniMax speech-2.8 models per official docs, default to speech-2.8-hd
* feat(tts): expand MiniMax voice list with recommended voices
* fix(tts): remove non-official MiniMax recommended voices, keep 10 from official list
* fix: address CR findings - align defaults, fix test mocks, ASR modelId fallback
* fix(tts): pass modelId in voice preview and classroom generation
* fix(tts): voice picker highlights only the exact model:voice match
---------
Co-authored-by: 杨慎 <117187635+cosarah@users.noreply.github.com>
Add MiniMax LLM models (M2–M2.7), TTS provider (speech-2.8/2.6/02/01),
image generation (image-01), and video generation (Hailuo 2.3/02,
T2V-01). Unify base URLs to api.minimaxi.com and add MiniMax-specific
base URL normalization for the Anthropic-compatible endpoint.
Co-authored-by: Hi-Jiajun <3138947285@qq.com>
Add ttsModelId/asrModelId to persisted settings, model management UI
for providers that support model selection, and propagate selected
model through preview, generation, and transcription flows.
Co-authored-by: 刘少杰 <liushaojie@cvte.com>
* feat(tts): add Doubao TTS 2.0 (Volcengine Seed-TTS 2.0) provider
Add Doubao TTS as a new TTS provider with 17 voices (14 Chinese, 3 English),
streaming response parsing for Volcengine's chunked JSON format, rate-limit
error handling, and full integration across types, constants, provider
implementation, server config, settings store, i18n, and UI components.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* ui(tts): split Doubao API key into separate App ID and Access Key fields
Show two input fields (App ID + Access Key) for Doubao TTS in settings,
instead of requiring the compound "appId:accessKey" format. The values
are combined internally so no changes are needed to the API layer.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(tts): address code review feedback for Doubao TTS provider
- Add TODO note explaining TTSRateLimitError's future use for retry/backoff
- Replace atob() + manual byte loop with Buffer.from() for server-side code
- Trim supportedFormats to ['mp3'] since only mp3 is used in requests
- Add i18n keys for Doubao App ID / Access Key labels (zh-CN + en-US)
- Add show/hide toggle to Access Key input field
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat(tts): add resolveVoice() and getServerVoiceList() utilities
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(tts): add AudioIndicator equalizer bars component
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(tts): add onSegmentSealed callback to StreamBuffer
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(tts): add voiceOverrides field to AgentConfig and AgentTemplate
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(tts): add useDiscussionTTS hook with audio queue and cleanup
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat(tts): add audio state indicator to Roundtable bubble
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(tts): wire onSegmentSealed callback through chat sessions
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat(tts): add per-agent voice dropdown to AgentBar
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat(tts): integrate useDiscussionTTS in Stage and pass state to Roundtable
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* style(tts): refine voice dropdown to pill-style selector
Replace native select styling with a compact rounded-full pill
that blends into the agent row. Remove border, use muted bg,
smaller text, and a custom chevron icon.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* style(tts): use shadcn Select for voice dropdown, link with TTS toggle
- Replace native <select> with shadcn Select component for consistent UI
- Hide voice dropdown when TTS is muted (ttsMuted)
- Compact pill-style trigger with rounded-full, no border, muted bg
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* style(tts): add voice label prefix and always show dropdown
Show "音色: Alloy" instead of plain "Alloy" in the voice pill.
Always show dropdown regardless of mute state (voice config is
independent of playback).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* style(tts): add volume icon hint in collapsed AgentBar
Show a small Volume2 icon in the collapsed pill when voice config
is available, hinting that voice settings are inside.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(tts): fix voice dropdown layout and click handling
- Move voice pill below agent name (second line) to prevent
horizontal overflow in English
- Wrap Select in div with onPointerDown stopPropagation to fix
Radix click-through to parent row
- Add line-clamp-1 to descriptions for consistent row height
- Use items-start instead of items-center for better multi-line alignment
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor(tts): redesign AgentBar voice layout for compactness
- Single-line layout: checkbox · avatar · name · role · voice pill
- Remove descriptions from agent rows (saves vertical space)
- Extract AgentVoicePill component to isolate Select event handling
- Smaller avatars (size-7), tighter row padding (py-1.5)
- Voice pill uses Volume2 icon + voice name (no prefix text)
- Works in both Chinese and English without overflow
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat(tts): cross-provider voice selection per agent
- Change voiceConfig from per-provider lookup to explicit
{ providerId, voiceId } per agent
- Each agent can use a different TTS provider's voice
- Voice picker dropdown groups voices by provider
- useDiscussionTTS routes TTS requests per agent's provider
- resolveAgentVoice falls back to global provider if no config
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(tts): align role badge and voice pill across agent rows
Give role badge fixed width (w-14 text-right) so role text
and voice pills align vertically across all rows regardless
of agent name length.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(tts): fix role badge and voice pill alignment
Wrap role badge + voice pill in a fixed-width container
(w-[9.5rem] justify-end) so both align vertically across
all agent rows regardless of name or role text length.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* style(tts): align role badge and voice pill across agent rows
Add min-w-[52px] text-right to role badge so it starts at a
consistent position regardless of agent name length.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(tts): use fixed w-[60px] for role badge alignment
* fix(tts): use fixed w-[88px] for voice pill alignment
* fix(tts): prevent click-outside from closing AgentBar when Select portal is open
* fix(tts): comprehensive voice picker rewrite
- Replace Radix Select with Popover + button list (fixes click issue)
- Fix getAvailableProvidersWithVoices to always include global provider
- Widen panel from w-80 to w-96 (prevents name truncation)
- Voice pill uses primary color instead of gray (more visible)
- Extract renderAgentRow helper to reduce duplication
- Popover shows voices grouped by provider with active state
- Add findVoiceDisplayName utility
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(tts): align voice provider availability with toolbar logic
* fix(tts): fallback to first available provider when global provider has no voices
* refactor(tts): remove global provider fallback from voice resolution
Voice resolution now only depends on available providers (those with
API keys or server-configured). No more globalProviderId parameter.
Fallback is first available provider, then browser-native-tts.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat(tts): add browser native TTS voices to agent voice picker
Load speechSynthesis.getVoices() in AgentBar and include as a
"Browser Native" provider group in the voice popover. No API key
needed - always available if browser supports it.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat(tts): simplify toolbar TTS to on/off toggle, add disabled state
Toolbar:
- Replace volume slider with simple TTS on/off toggle button
- Remove ttsMuted/ttsVolume/onVolumeChange props from CanvasToolbar
- Toggle now controls ttsEnabled (not ttsMuted)
AgentBar:
- Collapsed: show VolumeX icon when TTS disabled
- Voice pills show disabled state (gray, cursor-not-allowed, no popover)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor(tts): simplify Settings TTS tab to toggle + provider config
Remove voice selection, speed slider, preview/test, Azure locale
filter from Settings TTS tab. Voice is now per-agent in AgentBar.
Keep: on/off toggle, provider selector, API key + base URL config.
Add hint text pointing to AgentBar for voice configuration.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor(tts): simplify media popover TTS tab to toggle only
* fix(tts): add voice config hint to media popover TTS tab
* feat(tts): add per-voice preview button in voice picker
Each voice row in the popover has a small speaker icon button.
Click to preview the voice with "欢迎来到AI课堂" / "Welcome to
AI Classroom" (follows i18n). Browser native uses Web Speech API,
server TTS calls /api/generate/tts. Click again or close popover
to stop. Shows spinner while generating.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(tts): preview text follows course language instead of UI language
* refactor(tts): redesign AgentBar expanded panel layout
- Teacher always at top with voice pill (works in both modes)
- Mode tabs moved below teacher
- Auto mode: single compact row with shuffle icon + description
- Max turns: compact inline row with smaller input
- Preset mode: only student agents listed (teacher already above)
- Remove large shuffle animation from auto mode
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor(tts): merge max turns into teacher row
* refactor(tts): separate teacher row and max turns, use stepper UI
- Teacher row: avatar + name + voice pill only
- Max turns: bottom row with MessageSquare icon + compact stepper
(minus/number/plus in a rounded pill)
- Remove Input component dependency
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(tts): increase voice pill contrast in dark mode
* fix(tts): make max turns input editable, tighten panel padding
* fix(tts): restore shuffle animation in auto mode (compact version)
* fix(tts): adjust auto mode text spacing and add voice auto-assign hint
* fix(tts): auto-close voice popover after selecting a voice
* fix(tts): increase auto mode vertical padding for better balance
* fix(tts): push auto mode text toward bottom with flex spacer
* fix(tts): reduce auto mode bottom padding
* feat(tts): wait for TTS audio to finish before next agent turn
Add waitForDrain() to useDiscussionTTS that returns a promise
resolving when the audio queue is empty. The agent loop in
useChatSessions now awaits this after buffer drain, so the next
agent's turn doesn't start until the current agent's TTS audio
finishes playing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(tts): keep bubble visible while TTS audio is still playing
When buffer drains (text=null) but audio indicator is still active,
don't clear liveSpeech. Clear it only when audio state goes idle.
This keeps the speech bubble visible until TTS finishes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat(tts): hold discussion bubble until TTS audio finishes
When StreamBuffer fires the done signal (onLiveSpeech null), Stage
now checks if TTS is still playing. If so, it defers clearing the
bubble state. The bubble stays visible until onAllAudioEnd fires
from the TTS hook (queue empty + nothing playing), then clears.
This prevents the jarring UX where the bubble disappears while
the agent's voice is still audible.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(tts): fix bubble hold - guard onStopSession instead of onLiveSpeech
Root cause: bubble disappears because doSessionCleanup fires via
onStopSession when the agent loop ends naturally, NOT because of
onLiveSpeech(null, null).
Fix: when onStopSession fires and TTS is still playing, defer
doSessionCleanup to onAllAudioEnd callback. Manual stop (user
presses button) still cleans up immediately via handleStopDiscussion.
Use doSessionCleanupRef to avoid circular dependency between
discussionTTS hook and doSessionCleanup useCallback.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(tts): guard BOTH onLiveSpeech and onStopSession for bubble hold
Two paths clear the bubble:
1. onLiveSpeech(null, null) from StreamBuffer done → clears liveSpeech
2. onStopSession → doSessionCleanup → clears all state
Both fire when agent loop ends. Path 1 fires first (tick loop),
path 2 fires after (waitUntilDrained resolves). Both must be
guarded when TTS is still playing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat(tts): hold bubble during TTS playback and respect playback speed
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat(tts): LLM picks voice matching agent persona during generation
- Client sends available voices (providerId + voiceId + name) to
/api/generate/agent-profiles
- LLM prompt asks to pick a voice matching each agent's personality
- Parse "providerId::voiceId" from response, save as voiceConfig
- Fallback to index-based assignment if LLM doesn't pick
- Browser native voices hidden when server providers are available
- saveGeneratedAgents accepts and persists voiceConfig
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(tts): restore volume slider in classroom toolbar
Revert the toolbar simplification from 36e3997 that replaced the
volume slider with a TTS on/off toggle. The volume control with
hover slider is a core classroom UX. TTS on/off is controlled via
Settings and Media popover instead.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(tts): teacher uses global lecture voice in discussion when no voiceConfig override
* fix(tts): teacher always uses global lecture voice, no overrides
* fix(tts): sync playback speed to currently playing audio in real-time
* fix(tts): address code review issues
- Issue 2: enabled flag now checks ttsEnabled && !ttsMuted in stage.tsx
- Issue 4: remove unused browserAvailableVoices from useDiscussionTTS
- Issue 5: remove dead code in audio-settings.tsx (Slider, Loader2, handleTTSVoiceChange, handleTTSSpeedChange, handleTestTTS, testingTTS, ttsTestStatus, ttsTestMessage, testText, ttsSpeed, setTTSSpeed, and unused browser-tts-preview imports)
- Issue 6: shouldHold now checks queue length in addition to isPlayingRef
- Issue 8: hide AgentVoicePill for teacher row in agent-bar.tsx (teacher voice is controlled in Settings)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(tts): address PR review — abort preview fetch, defer error recovery
1. Add AbortController to voice preview server TTS fetch, abort on
stopPreview to prevent stale responses on rapid switching
2. Use queueMicrotask for processQueue calls in error/ended handlers
to prevent synchronous recursion if multiple items fail consecutively
3. Add ordering invariant comment on sealLastText's onSegmentSealed
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(tts): restore teacher voice pill, respect voiceConfig override
* fix(tts): sync volume and mute to discussion TTS audio in real-time
* fix(tts): allow browser-native TTS alongside server providers
* fix(tts): remove top padding from voice popover content
* fix(tts): make selectedAgents reactive to voiceConfig changes
* fix(tts): use agents record instead of listAgents() to avoid infinite loop
* fix(tts): single source of truth for teacher voice
Teacher voice pill now reads/writes global ttsProviderId + ttsVoice
(same settings used by lecture TTS). This ensures lecture and
discussion always use the same teacher voice. Student agents still
use per-agent voiceConfig.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add avatar descriptions for smarter LLM avatar selection
Each avatar now has a one-line description (appearance, vibe) sent
to the agent-profiles generation API. LLM picks avatars matching
agent personality instead of guessing from file paths.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: 杨慎 <117187635+cosarah@users.noreply.github.com>
* feat: add Grok (xAI) provider support for LLM, Image and Video generation
- Add Grok as LLM provider (OpenAI-compatible, 11 models including grok-4.20, grok-4, grok-3)
- Add Grok Image generation provider (grok-imagine-image, grok-imagine-image-pro)
- Add Grok Video generation provider with async polling (grok-imagine-video)
- Add env vars: GROK_*, IMAGE_GROK_*, VIDEO_GROK_*
- Add web search note: Grok search is via chat completions, not standalone API
- Update README/README-zh with Grok in supported providers
Closes#87
* fix: ensure new image/video providers are auto-added to persisted settings
Add ensureBuiltInImageProviders and ensureBuiltInVideoProviders functions
that run on every store rehydrate, mirroring the existing LLM provider
sync logic. Without this, Grok Image/Video providers would not appear
for users with existing localStorage settings.
* fix: add missing English translation for providerGrokVideo
* style: fix prettier formatting for grok video provider
* fix: remove unsupported grok multi-agent model and improve video error
* fix(tts): fix browser-native TTS playback and add provider switching to toolbar (#145)
- Add speechSynthesis.cancel() before speak() in PlaybackEngine to fix
garbled/broken audio output (Chrome known bug workaround)
- Replace flat voice selector with GroupedSelect in toolbar TTS tab,
allowing direct provider switching (Qwen TTS ↔ Browser Native etc.)
- Dynamically populate browser-native voices from speechSynthesis.getVoices()
instead of a single hardcoded "default" entry
- Split browser voices by language for easier navigation
- Use i18n for TTS provider names in toolbar
Closes#145
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: resolve selectedGroup matching for duplicate groupId sub-groups
When browser-native-tts voices are split by language, multiple groups
share the same groupId. The GroupedSelect trigger now finds the
sub-group that contains the selected item, so it displays the correct
language label (e.g. "Browser Native TTS · English" instead of always
showing the first sub-group).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: use browser speechSynthesis for playback when browser-native-tts is selected
Previously, selecting browser-native-tts as the TTS provider would
produce sound in the settings test but remain silent during classroom
playback. This happened because:
1. The scene generator correctly skipped pre-generation for browser TTS
(it runs client-side, not via API)
2. The playback engine fell back to a silent reading timer when no
pre-generated audio was found, instead of calling speechSynthesis
This commit adds Web Speech API integration directly in the
PlaybackEngine:
- New playBrowserTTS() method speaks text via speechSynthesis
- Properly wires onend/onerror to advance to the next action
- pause()/resume() now handle speechSynthesis.pause()/resume()
- stop() and handleUserInterrupt() cancel browser TTS
Fixes#25, fixes#12, fixes#5
* fix: handle "default" ttsVoice, extract CJK_LANG_THRESHOLD constant
- When ttsVoice is "default" (set by Browser Native TTS which has no
voice picker), the voiceURI lookup silently fails and no lang is set,
causing Chinese text to be spoken with an English voice.
- Extract the 0.3 CJK detection threshold as a named constant
CJK_LANG_THRESHOLD with JSDoc explaining the rationale.
- Fall through to language auto-detection when voice lookup fails,
regardless of the reason (missing voice, "default" sentinel, etc.).
* fix: support browser-native tts previews
* refactor: extract shared TTS preview logic into useTTSPreview hook
The browser-native and API-based TTS preview code was duplicated across
tts-config-popover, media-popover, and tts-settings. Extract it into a
reusable useTTSPreview hook that handles refs, cancellation, audio
lifecycle, and staleness checks in one place.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: yangshen <1322568757@qq.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace the card-based media popover with a modern segmented-control tab UI.
Add GroupedSelect for provider+model selection (filtered to available providers),
TTS voice preview with audio playback, voice name localization, and remove
unsupported speedRange from qwen-tts provider.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>