AGC 项目管理子画布上传素材会归类为 "未归类" 导致在上传它的页面看不到, 会有惊奇 #359
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I'll fix
修复已发 PR:#596
根因
栏目画布底部工具栏的「上传」调
upload_local_asset,而该命令里 manifest 的kind只由内容证据推导(assets.rs::uploaded_asset_kind):unclassifiedaudio,文档 / 字体 →documentkind 派生分类与栏目词汇(
ui-interaction/character/scene/audio)不是同一套,所以图片上传只能落「待归类」。生成入口早就有这条口径(start_local_project_asset_generation的targetCategory:GUI 完成登记以入口栏目为准),上传漏了这半边 —— 于是「已上传 1 个素材」弹出、当前栏目仍是「0 项」。修法
upload_local_asset增加可选targetCategory,登记改走既有的register_local_asset_entry_with_category(非法值失败关闭、不回退 kind 派生);前端uploadProjectAssetFilesAndReadSnapshot透传,栏目画布工具栏上传带上工具栏自己的栏目。效果:在「角色与对象」上传hero.png,素材直接登记进「角色与对象」,当场出现在上传它的那一页。不传
targetCategory时行为不变(资源面板上传、UI 编辑器图片导入、聊天附件上传都不受影响)。验证
cargo test ... --bin genarrative-ai-game-creator-shell assets::tests→ 27 passed(新增upload_registers_into_the_explicit_entry_category:显式栏目 →character、不传 →unclassified、非法version失败关闭且不新增登记)npx vitest run apps/ai-game-creator-shell/tests/appSurface.test.ts→ 196 passed / 9 skipped(新增用例断言工具栏上传载荷带targetCategory: 'character')npm run agc:typecheck、npm run check:encoding、git diff --check、cargo fmt --check全绿改动范围:
apps/ai-game-creator-shell/src-tauri/src/{assets.rs,commands/desktop.rs}、src/view/project-development/{projectResourceLiveUpdateModel.ts,index.tsx}、appSurface 用例,以及 PRD §3.10 / 工具栏入口矩阵 §4 / V3 验收 S11a / decision-log / pitfalls。