fix(playground): prioritize campaign models in selectors - #992
Merged
Conversation
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.
问题背景:Playground 模型选择器的默认顺序没有遵循模型列表的促销排序,搜索结果也没有把最新、免费、折扣和最热模型置于前列。
证据:默认列表直接使用后端返回顺序;此前统一排序比较器按发布时间/价格排序,促销标签的优先级未按产品要求区分默认和搜索场景。
根因:默认列表和搜索结果复用了不匹配的排序规则。
改动范围:默认列表按免费、有限折扣、最热、其他排序;搜索结果按最新、免费、有限折扣、最热、其他排序,并在同一层级内按发布时间、价格、featured 顺序稳定排序。
影响与风险:仅影响 web/default Playground 模型选择器 UI,不改变模型调用、路由、计费或后端请求。
验证:模型选择器单测 3 项通过;bun run typecheck、相关 ESLint 和 bun run build 均通过。
发布建议:Router deploy: not required。Other deploy target: newapi-console/staging and production console frontend only; website/router/Terraform/Cloudflare not involved。