Conversation
- 在 ModelMarketplaceView 中将 zhipu 品牌映射到 glm 模型图标体系 - 在 ModelIcon 中补充识别 zhipu/智谱 品牌关键词 - 在 providerBrand 中增加 z.ai、zai 别名映射 - 补充 ModelMarketplaceView 与 ModelIcon 的相关回归单测
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.
变更类型
背景与问题
在模型广场页面(
/models)中,当分组品牌为智谱(例如分组名为GLM、zai,或展示品牌为“智谱”)时,分组卡片左侧的大图标未能正确渲染为官方点阵 Logo,而是触发了兜底逻辑,显示为紫底汉字“智”占位符。问题根因:
ModelMarketplaceView.vue的groupBrandIconModel函数在品牌转模型图标的映射中漏掉了智谱分支,导致品牌名直接回退给了ModelIcon。ModelIcon.vue组件此前仅识别glm等模型标识,未包含zhipu/智谱品牌词。providerBrand.ts中智谱别名缺少常见的英文缩写zai、z.ai。解决方案
与系统中现有的 Anthropic(映射为 Claude)、xAI(映射为 Grok)、OpenAI(映射为 GPT)等厂商映射体系全面对齐:
ModelMarketplaceView.vue):groupBrandIconModel中补充case 'zhipu': return 'glm',将智谱品牌归一化到 GLM 模型图标体系。ModelIcon.vue):zhipu与智谱关键词,避免品牌原名直传时回退到文字占位。providerBrand.ts):z.ai、zai,兼容常用分组名称与徽标归一化。ModelMarketplaceView.spec.ts:补充zai分组与智谱品牌的大图标渲染断言,确保渲染 SVG 且无回退。ModelIcon.spec.ts:补充glm-4.6、zhipu、智谱测试用例。验证情况
make test-frontend全量通过(ESLint、类型检查、199 项关键测试)。ModelIcon.spec.ts(13 项)、ModelMarketplaceView.spec.ts(11 项)全量通过。