-
Notifications
You must be signed in to change notification settings - Fork 129
fix(settings): 切换 LLM/ASR preset UI 不刷新 (#219) #220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onLlmProviderChangenow waits on multiple async IPC calls before callingsetLlmProvider. Because this is a controlled<select>, delaying the state update until afterawaitmakes the displayed selection depend on async completion order rather than the latest user input. If the user switches providers quickly, an earlier request that resolves later can overwrite a newer choice and leave the UI showing a stale provider.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修复 P2,commit 1eec2fa。
按反馈把 provider state 拆成两个:
*Provider立即跟随用户输入,驱动 `` —— 受控反馈始终是最新选择 committed*Provider 仅在所有 await 完成后 commit,驱动 `CredentialField` 的 key 与 placeholder/preset 渲染 加 *SwitchSeqRef 守卫:每次进 handler 自增,每段 await 后比对,发现已有更新的 switch 在飞就 abort 当前 commit 三类回归路径都堵上了: 单次切换:`` 立即响应;CredentialField 等后端 active 切完才 remount 读正确 entry(issue fix(settings): 切换 LLM/ASR preset 时凭据 UI 显示旧 active 的内容(race + 覆盖) #219 fix 保留)