{{ message }}
Repository navigation
fix(console): load category tree in create model modal - #1697
Open
EastSouthWestNorthMiddle wants to merge 1 commit into
Open
EastSouthWestNorthMiddle wants to merge 1 commit into
EastSouthWestNorthMiddle wants to merge 1 commit into
Conversation
|
|
The create-model modal rendered from the page level reads state.categoryList, which use-model-initializer only fills for official models (modelType === 1). When the personal model list is empty, the empty-state "create model" button opens that page-level modal, so the required "model category" select stays empty and the form can never be submitted. Fetch the category tree from the API as a fallback when the modal opens and state.categoryList is empty. Fixes iflytek#1696 Signed-off-by: EastSouthWestNorthMiddle <283185948+EastSouthWestNorthMiddle@users.noreply.github.com>
EastSouthWestNorthMiddle
force-pushed
the
bugfix/console-personal-model-category-tree
branch
from
October 3, 2026 18:17
0ae0f39 to
f85abbf
Compare
Member
This branch has not been deployed
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.

Summary
修复 #1696:个人模型列表为空时,「新建模型」弹窗的必填项「模型类别」下拉恒为空,导致全新部署无法通过 UI 创建第一个模型。
Type of Change
Related Issue
Fixes #1696
Changes
console/frontend/src/pages/model-management/components/model-modal-components.tsx:当创建弹窗打开且state.categoryList为空时,从/api/model/category-tree补取分类树,作为CreateModal的categoryTree兜底值。根因(详见 #1696):
hooks/use-model-initializer.ts只在modelType === 1(官方模型)时actions.setCategoryList(...);个人模型页调用的是useModelInitializer(2),因此state.categoryList从不被填充。ModelModalComponents,它直接把state.categoryList传给CreateModal→categoryTree恒为[]→ 必填的「模型类别」下拉为空、提交按钮永久禁用。components/model-card-list.tsx(自己getCategoryTree()存本地 state),而它只在列表非空时渲染 → 所以「列表非空」时不复现,属「空列表首建」这条边角路径被遗漏。为什么选择在弹窗层兜底,而不是直接改
use-model-initializer:个人模型页的筛选逻辑走filterType,modelType === 1这个判断很可能是刻意为之(避免把官方模型合并出的分类树注入个人页筛选)。在弹窗层按需补取是最小改动、影响面最小,也不改变官方模型页的既有行为。Testing
已在
console/frontend下执行:npx prettier --list-different <改动文件>npx eslint <改动文件> --quietnpx tsc --noEmitsrc/pages/model-management/目录 0 个类型错误关于
tsc:全仓库基线仍有 3763 个既有类型错误(与本改动无关,CI 中tsc --noEmit也是 continue-on-error)。本次改动未新增任何类型错误。未执行:
npm run test:unit、界面 E2E。建议回归路径:
Checklist