保存抠图实际模型元数据
Project CI / Repository checks (pull_request) Failing after 10s
Project CI / Backend tests (pull_request) Failing after 10s
Project CI / Frontend tests (pull_request) Successful in 1m32s
Project CI / Native shell tests (pull_request) Successful in 1m55s

在 generationInputs 顶层记录实际抠图供应商与模型

覆盖 BgFilter、阿里云和本地键色及三条派生资产持久化链路

保持源生图模型与图片信息展示契约不变

补充后端前端测试并同步数据契约和决策文档
This commit is contained in:
2026-07-30 12:10:40 +00:00
parent 0c4775f5ab
commit 4670632919
5 changed files with 206 additions and 29 deletions
@@ -68,17 +68,20 @@ describe('ImageCanvasMetadataModalView', () => {
});
it('keeps the generation model while hiding internal processing models', () => {
const generationInputsWithInternalMattingMetadata = {
fields: [
{ title: '处理阶段', value: '角色抠图' },
{ title: '处理模型', value: 'birefnet' },
],
references: [],
mattingProvider: 'Aliyun Matting',
mattingModel: 'segment-common-image',
};
const { rerender } = render(
<ImageCanvasMetadataModalView
layer={createLayer({
model: 'gpt-image-2',
generationInputs: {
fields: [
{ title: '处理阶段', value: '角色抠图' },
{ title: '处理模型', value: 'birefnet' },
],
references: [],
},
generationInputs: generationInputsWithInternalMattingMetadata,
})}
onClose={vi.fn()}
/>,
@@ -92,6 +95,8 @@ describe('ImageCanvasMetadataModalView', () => {
expect(within(dialog).getByText('Model')).toBeTruthy();
expect(within(dialog).getByText('gpt-image-2')).toBeTruthy();
expect(within(dialog).queryByText('birefnet')).toBeNull();
expect(within(dialog).queryByText('Aliyun Matting')).toBeNull();
expect(within(dialog).queryByText('segment-common-image')).toBeNull();
rerender(
<ImageCanvasMetadataModalView