feat(desktop): 触发按钮显示模型服务商#4146
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9bc7b70679
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const currentProvider = useMemo(() => { | ||
| const cur = models.find((m) => m.current); | ||
| return cur ? providerLabel(cur.provider, t) : null; |
There was a problem hiding this comment.
Keep the trigger provider in sync
Because currentProvider is derived from models, but that array is only fetched while the popover is open, the trigger shows no provider on initial render and can show the wrong provider after selecting a model from another provider: onPick refreshes the parent label, while this stale models state still marks the old model as current until the menu is opened and fetched again. In those common closed-menu states the new model · provider display is missing or mismatched.
Useful? React with 👍 / 👎.
e95e2dc to
508f1a8
Compare
在 ModelSwitcher 触发按钮上,模型名后附加服务商名称,例如:
deepseek-v4-flash · DeepSeek