Skip to content

feat(workflow-editor): 前端接上三渲二的建资产入口与路线选择 - #414

Open
johnnyzhang-eng wants to merge 2 commits into
1024XEngineer:mainfrom
johnnyzhang-eng:feat/render3d-frontend-entry
Open

feat(workflow-editor): 前端接上三渲二的建资产入口与路线选择#414
johnnyzhang-eng wants to merge 2 commits into
1024XEngineer:mainfrom
johnnyzhang-eng:feat/render3d-frontend-entry

Conversation

@johnnyzhang-eng

Copy link
Copy Markdown
Contributor

背景

后端的 5 个 render3d 端点已合入 main 并部署到线上(线上 openapi.jsonmaster-precheckbuildapprovediscard、造型资产读取都在),但 frontend/src 全目录搜索 render3d 零命中——这条路线对用户不存在。

controller.ts:728 另有一句在 #277 之后已不成立的硬拦截:选 3d-to-2d 直接抛「3D 转 2D 接口尚未提供」。

改动

  • entities/render3d/:三渲二端点的前端适配层,页面不直连适配器,替身注入只有会话一个入口。
  • 母版确认闸:选中候选到定为母版之间加一个停点。放大图是主体,后端 master-precheck 的零成本判据是旁证;预检不通过不阻断人工放行。理由是一张母版约 ¥0.29 而图生 3D 一次 ¥2.40,且模型生成即最终,母版不合格只能整条重来。
  • 建 3D 资产入口:按钮上标明 30 积分、约 ¥3.6、每造型一次性。
  • 动作生成方式增加三渲二,可选与否只看该造型有没有已确认的 Outfit.model3dUrl;没有就禁用并说明去哪里建,不静默兜底成 i2v。
  • 去掉 controller.ts 里那句硬拦截。

不包含

验证

frontend 跑 CI 原样命令:format:checklinttypechecktest:coveragebuild 五项退出码均为 0,55 个测试文件 675 条用例通过。

两条新增用例覆盖判据两侧:造型无 3D 模型时三渲二按钮禁用且给出原因,有 3D 模型时可选并按 3d-to-2d 提交完整动画。

Closes #413

后端 5 个 render3d 端点已合入并上线,但 frontend/src 里 render3d 零命中,
用户在界面上够不到这条路线。

- 母版确认闸:选中候选后先看放大图与零成本预检,再决定是否定为母版
- 建 3D 资产入口:图生 3D + 绑骨,标明 30 积分/约 ¥3.6、每造型一次性
- 动作生成方式多一条三渲二,判据是该造型有没有已确认的 model3dUrl
- 去掉 controller 里已不成立的硬拦截(接口在 1024XEngineer#277 已提供)
@vercel

vercel Bot commented Aug 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
windup Ready Ready Preview Aug 18, 2026 3:44pm

@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.50617% with 17 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
frontend/src/pages/workflow-editor/index.tsx 89.10% 2 Missing and 9 partials ⚠️
frontend/src/entities/render3d/api.ts 90.00% 6 Missing ⚠️

📢 Thoughts on this report? Let us know!

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

审查结论

三渲二适配器与后端资产状态契约整体一致,但当前路由选择和两个编辑器状态转换会偏离 PR 明确声明的交互:已有 3D 资产时选择视频裁剪仍会实际走三渲二,预检拒绝会阻断人工放行,并且资产就绪后当前会话仍保持三渲二禁用。已沿调用链核对前端请求、后端路由判据与编辑器本地状态。

验证说明:尝试运行相关 Vitest 套件时,环境中的 vitest 可执行文件返回 Permission denied,直接模块入口也不存在,因此未能完成自动化测试执行。

View job run

num_frames: 32,
// 后端据此查该造型的 model_3d_url 决定路线(三渲二 / i2v,#122);不发就恒为
// None,路线永远选不中。
outfit_id: nonEmptyString(input.outfitId, 'outfitId'),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] 仅在选择三渲二时发送 outfit_id

这里对所有完整动画请求都发送 outfit_id,但后端并不读取 WorkflowRun 中保存的 method;它只要发现该造型存在 model_3d_url 就直接走 generate_rendered。因此一个已经建好 3D 资产的造型即使用户明确点击“视频裁剪”,最终也会被静默改成三渲二,改变画风、成本和生成语义。请把所选方法传入这一层,并仅在 method === '3d-to-2d' 时携带 outfit_id(或提供等价的显式后端路线参数),同时覆盖“有 3D 资产但选择视频裁剪”的用例。

<button
type="button"
className={CARD_BUTTON}
disabled={branchBusy || rejected}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] 不要用预检拒绝结果禁用人工确认

PR 描述和这里的 useMasterPrecheck 注释都明确要求“预检不通过不阻断人工放行”,因为这些近似判据可能误判;但 rejected 被加入 disabled 后,任何 accepted: false 都让用户无法确认母版,只能重新生成。这直接违背验收条件,也会把可接受图片卡死在零成本预检上。请保留警告/拒绝说明,但只用 branchBusy 控制确认按钮,允许用户在查看结果后人工放行。


{asset.state === 'ready' ? (
<p className={CARD_SUMMARY}>
3D 资产已就绪,这个造型可以走三渲二了{hasModel ? '' : '(刷新后生效)'}。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 资产 ready 后同步当前 Character 状态

轮询拿到 ready 时这里只更新组件内的 asset,而三渲二按钮的判据读取的是页面级 input.character.outfits[].model3dUrl。后端 GET 虽然已经把 URL 回写数据库,但当前会话没有重新读取 Character,所以用户等待付费流程完成后仍看到三渲二禁用,必须整页刷新才能继续。请在 ready 且返回 model3dUrl 时同步 input.setCharacter 中对应 Outfit(或重新拉取 Character),让同一工作流会话立即解锁路线选择。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: 三渲二后端已上线但前端没有入口,用户够不到这条路线

1 participant