Closed
Conversation
- 修复供应商类型表单选项使用动态生成而非硬编码 - 统一使用 PROVIDER_TYPE_CONFIG 配置中的 label 和 description - 改进类型选择的帮助文本,更清楚地说明不同类型的影响 - 确保类型显示与配置的一致性
| import type { ProviderDisplay, ProviderType } from "@/types/provider"; | ||
| import { validateNumericField, isValidUrl } from "@/lib/utils/validation"; | ||
| import { PROVIDER_DEFAULTS } from "@/lib/constants/provider.constants"; | ||
| import { PROVIDER_TYPE_CONFIG, getAllProviderTypes } from "@/lib/provider-type-utils"; |
Contributor
Author
There was a problem hiding this comment.
很好的引入!使用 getAllProviderTypes() 动态生成选项确实比硬编码更易维护。这样未来添加新的供应商类型时,只需要在 PROVIDER_TYPE_CONFIG 中添加配置即可。
| </SelectItem> | ||
| {getAllProviderTypes().map((type) => { | ||
| const config = PROVIDER_TYPE_CONFIG[type]; | ||
| const isDisabled = !enableMultiProviderTypes && (type === "gemini-cli" || type === "openai-compatible"); |
Contributor
Author
There was a problem hiding this comment.
这个实现很棒!使用 enableMultiProviderTypes 来控制功能可用性,并且提供了清晰的禁用状态提示,这样的用户体验很好。
Contributor
Author
✅ 代码审查结果这是一个高质量的 PR,成功修复了 Issue #29 中提到的供应商类型显示问题。 🎯 主要改进点:
📝 代码质量:
🔧 技术实现:
🚀 建议合并:此 PR 已准备好合并到 dev 分支。修复后,供应商类型的显示将更加统一和准确,为用户提供更好的配置体验。 自动关闭 Issue #29 |
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.
Close #29\n\n## 修复内容\n\n- 供应商类型表单优化:将硬编码的类型选项改为动态生成,确保与 PROVIDER_TYPE_CONFIG 配置保持一致\n- 统一显示格式:使用配置中的 label 和 description 字段,提供更清晰的类型说明\n- 改进帮助文本:更新类型选择的说明文字,更好地解释不同类型对请求处理和调度策略的影响\n- 保持功能禁用状态:Gemini CLI 和 OpenAI Compatible 类型在 enableMultiProviderTypes=false 时仍然禁用\n\n## 技术改进\n\n- 引入 PROVIDER_TYPE_CONFIG 和 getAllProviderTypes 工具函数\n- 移除硬编码的 SelectItem 选项,使用 map 动态生成\n- 确保类型显示的一致性和可维护性\n\n修复后,供应商类型的显示将更加统一和准确。