fix(tts): EdgeTTS UX polish — dropdown animation, voice selector sync, default voice#12
Merged
chyinan merged 4 commits intochyinan:mainfrom Apr 6, 2026
Merged
Conversation
Compute portal coordinates synchronously in handleToggle before
calling setOpen, so React batches all state updates into a single
render and the dropdown's first paint is already at the correct
position.
Previously, coords initialized to {0,0} and were only updated by a
useEffect on the next tick, causing the portal to briefly appear at
the top-left corner before jumping to the correct spot. On macOS
WebKit the GPU compositor renders that stale frame visibly, producing
the fly-in artifact. Windows/Linux WebView2 tends to discard it.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove the `provider.id !== ttsProviderId` guard so the voice dropdown is always visible in the EdgeTTS / OpenAI edit form - When the provider is active, the selector binds to `ttsVoice` / `onTtsVoiceChange` so both sections stay in sync - When inactive, it still writes to `provider.default_voice` as before - Replace the misleading "no available voices" Select with a plain hint text when voices haven't loaded yet (first add before save+refresh) - Add i18n keys: manage_providers.active / voices_after_save (zh/en/ja/ko) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…t alphabetical Two-part fix: 1. TtsTab addProvider: seed default_voice on new edge_tts / openai providers at creation time so normalizeTtsVoice always finds a configured value and never hits the raw array fallback. 2. normalizeTtsVoice (both empty-voice and no-match branches): when default_voice is absent, prefer zh-CN-XiaoyiNeural (matching the Rust backend constant) over voices.find() which returned whatever locale sorts first alphabetically (Afrikaans / Arabic / Spanish…). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
❌ API 错误:Error code: 402 - {'error': {'message': '余额不足,请充值后继续使用', 'balance': -0.39923132853442767}} |
Owner
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. Generated with Claude Code |
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 / 概述
Polish and bug-fix pass on the EdgeTTS integration introduced in the previous commit.
Fixes three UX issues (macOS dropdown animation glitch, voice selector disappearing when provider is active, wrong default voice selection) and bumps the underlying
edge-tts-rustcrate.Changes / 变更内容
fix: macOS dropdown fly-in animation — The custom
Selectportal rendered at{top:0, left:0}on the first frame (coords were{0,0}until auseEffectran), causing the dropdown to briefly appear at the top-left corner and triggering the entry animation from there. Fixed by computing the position synchronously insidehandleToggleso React batches all state updates into a single render.fix: EdgeTTS voice selector always visible in edit form — The voice
<Select>inside the provider edit panel was hidden whenever that provider was the active one (provider.id !== ttsProviderIdguard). This left the edit form completely empty for EdgeTTS (which has no other config fields) and made the selector appear/disappear unpredictably. Now the selector is always shown: when the provider is active it binds tottsVoice/onTtsVoiceChange(keeping both panels in sync); when inactive it writesdefault_voiceas before. First-add state (voices not yet loaded) shows a hint text instead of a broken empty dropdown.fix: default voice falling back to Spanish / first-alphabetical voice — When a newly added EdgeTTS provider had no
default_voiceset,normalizeTtsVoicefell back tovoices.find(...)which returned the first entry in the alphabetically-sorted voice list (Afrikaans → Arabic → … → Spanish → … → Chinese). Fixed in two places: (1)addProvidernow seedsdefault_voice: "zh-CN-XiaoyiNeural"at creation time; (2) both fallback branches innormalizeTtsVoicepreferzh-CN-XiaoyiNeural(matching the Rust backend constant) before giving up to the raw array.chore: upgrade
edge-tts-rust0.1.2 → 0.1.3Type / 类型
feat— New feature / 新功能fix— Bug fix / Bug 修复refactor— Code refactoring / 代码重构docs— Documentation / 文档style— UI/CSS changes / 界面样式test— Tests / 测试chore— Build/tooling / 构建工具Testing / 测试
npm run tauri devruns without errorsnpx tsc --noEmitpassescargo checkpassesScreenshots / 截图
Related Issues / 相关 Issue