feat(settings): cross-platform parity for local ASR#403
Open
feat(settings): cross-platform parity for local ASR#403
Conversation
- AdvancedSection: warning collapses to inline 11px amber badge in the title row's top-right; the enable-confirm popup is now a centered fixed modal with backdrop blur(8px) and click-outside- to-cancel (busy-guarded). - Symmetric rows by platform — fixes the #400 bug where the Qwen3 row was rendered on Windows even though all qwen_engine / local_provider / cache modules are #[cfg(target_os = "macos")], so Enable on Windows would always error: macOS: Qwen3 row enabled / Foundry row hidden Windows: Foundry row enabled / Qwen3 row disabled with notSupportedHere desc - Providers ASR Card: replaces the plain-text localAsrActiveNotice branch with an always-rendered dropdown that includes the platform-native local engine (macOS=Qwen3, Windows=Foundry) as a disabled option, plus a takeover hint underneath. Entire dropdown locks when a local engine is active, so it can only be released via Advanced (matches "启动之后供应商将被接管" UX). - onLlmProviderChange / onAsrProviderChange now emit saving → saved through emitSaved. Data was already being persisted; the saved-toast was missing. - LocalAsr embedded: hide Qwen3 model management (mirror / engine-status / model list) on Windows — dead UI without the Qwen3 backend. The shared error Card is kept unconditional since Foundry handlers also call setError. - i18n × 5 (zh-CN/zh-TW/en/ja/ko): shorten localAsrWarningShort; rewrite qwen3Desc and foundryDesc to '启动之后,ASR 提供商将被接管'; add notSupportedHere and localAsrTakeoverHint.
Collaborator
Author
|
QAQ |
PR Reviewer Guide 🔍(Review updated until commit 7e23e3d)Here are some key observations to aid the review process:
|
pr_agent #403 caught: emitSaved('saving') with no try/catch — if setActiveLlmProvider / setActiveAsrProvider / any later credential write throws, the right-corner toast stays stuck on saving forever. Wrap both onLlmProviderChange and onAsrProviderChange bodies in try/catch. On error, emit 'failed' (and re-throw) only if seq still matches — stale calls superseded by a newer switch shouldn't overwrite the newer call's own saving state.
|
Persistent review updated to latest commit 7a65cee |
… pr_agent #403 Fixes piled up in user feedback during local verify of the previous commit; bundled into one commit to keep #403 small. - capabilities/default.json: add `dialog:default` permission. The About → Export error log button always failed because the Tauri 2 capabilities did not allow `tauri-plugin-dialog`'s `save()` command; the JS rejected before export_error_log was ever invoked. - ProvidersSection ASR Card (pr_agent #403 'Wrong active label'): when committedAsrProvider is a local engine, selectedValue now reflects the actually-active engine instead of being forced to platformLocalAsr. Cross-machine config sync (macOS profile with foundry-local-whisper / Windows profile with local-qwen3) used to make the dropdown lie about which backend is running. Anomalous local engines are added as disabled <option>s so the controlled <select> still finds its value and doesn't fall back to the first option. - ProvidersSection: drop verbose desc on LLM and ASR provider rows. '选择后将自动填入 Base URL 默认值。' is ~16 Chinese chars and always wraps inside the 180px label column, leaving a stranded second line on the left — the dropdown itself already conveys the semantic, the desc was redundant. - AdvancedSection: replace the [启用] / [已启用] Btn with the shared Toggle component for Qwen3 and Foundry rows. Toggle off switches back to volcengine. The Qwen3 row's Toggle truthfully reflects committed state on Windows (so a cross-platform anomaly shows ON even though it is non-interactive there). The standalone '禁用本地 ASR' escape row is now only rendered when no inline Toggle can disable the active engine — i.e., Linux / unsupported platform, or anomaly where the row for the foreign engine is hidden / non-interactive. - PermissionsSection: every status pill (microphone, accessibility, hotkey, Windows IME, network) now right-aligns inside its row via `justifyContent: flex-end` + `width: 100%`. Pill text moved to the right of inline messages so the green '已授权' / 'Authorized' reads as a right-edge badge — closer to macOS System Settings convention.
|
Persistent review updated to latest commit 678a5fd |
pr_agent 'Stale Windows state' caught: previous commit had `on=
{isOnLocalQwen3}` which truthfully reflected committed state, so a
profile synced from macOS with activeAsrProvider=local-qwen3 would
render Toggle ON next to a desc that says '本平台暂不支持'. The
visual contradiction was the concern.
Switch to `on={isMac && isOnLocalQwen3}` — Windows always renders
the row OFF + non-interactive, matching the unsupported desc. The
cross-platform anomaly state surfaces via the standalone '禁用本地
ASR' escape row, which is rendered exactly when no inline Toggle
can disable the active engine.
Comment updated to match the new behavior and document the
tradeoff.
|
Persistent review updated to latest commit be270eb |
pr_agent 'Linux regression' caught: previous wrap was `!IS_WINDOWS`, so a hypothetical Linux render path would still expose the Qwen3 mirror / model-list / engine-status UI even though Qwen3's backend is `#[cfg(target_os = "macos")]`. Swap the two wrappers to `IS_MAC` so the management cards only materialize on macOS. Today's AdvancedSection guards LocalAsr embedded with `platformSupported = isMac || isWin`, so Linux already short-circuits before LocalAsr renders — but defense in depth here costs nothing and keeps the comment accurate.
|
Persistent review updated to latest commit 7e23e3d |
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.
User description
Summary
qwen_engine/local_provider/cacheare all#[cfg(target_os = "macos")]→ Enable on Windows always errors. New layout: macOS shows Qwen3 enabled + Foundry hidden; Windows shows Foundry enabled + Qwen3 disabled withnotSupportedHeredesc.position: fixed,backdropFilter: blur(8px), click-outside-to-cancel (busy-guarded).localAsrActiveNoticebranch removed. Dropdown now always renders, including the platform-native local engine (macOS=Qwen3, Windows=Foundry) as a disabled option with a takeover hint. Entire dropdown locks while a local engine is active, so it can only be released via Advanced.onLlmProviderChange/onAsrProviderChangenow emitsaving → savedviaemitSaved. Data was already being persisted; only the right-corner toast was missing — that's why "切换 Ark / OpenAI 没保存提示".errorCard kept unconditional since Foundry handlers also callsetError.localAsrWarningShort; rewriteqwen3Desc/foundryDescto "启动之后,ASR 提供商将被接管"; addnotSupportedHere,localAsrTakeoverHint.Test plan
macOS (verified locally with
./scripts/build-mac.shinstall):npm run build— tsc + vite build greenWindows (static — needs separate test box):
Notes
PR Type
Enhancement, Bug fix
Description
Add toast notifications for provider switch success/failure
emitSaved('saving'/'saved'/'failed')now wraps LLM/ASR changesReplace local ASR enable popup with centered blurred modal
Achieve cross‑platform parity for local ASR rows
Simplify ASR provider dropdown into always‑rendered locked selector
Restrict Qwen3 model management UI to macOS only
Diagram Walkthrough
File Walkthrough
6 files
Add takeover hint and simplify warning stringsAdd takeover hint and simplify warning stringsAdd takeover hint and simplify warning stringsAdd takeover hint and simplify warning stringsAdd takeover hint and simplify warning stringsProvider toasts, modal, cross‑platform rows, dropdown lock1 files
Restrict Qwen3 model management to macOS only1 files
Add dialog permission for native confirm popup