fix: resolve confirmed character hidden bug, remove online font dependency, improve UI/UX experience

This commit is contained in:
saturn
2026-03-21 14:35:32 +08:00
parent f364bbc9e4
commit a6ad11b9c4
42 changed files with 1189 additions and 553 deletions

View File

@@ -0,0 +1,55 @@
import { describe, expect, it } from 'vitest'
import { createEmptyAssetGroupMap } from '@/lib/assets/grouping'
import { mapAssetGroupsToProjectAssetsData } from '@/lib/query/hooks/useProjectAssets'
describe('useProjectAssets adapters', () => {
it('preserves profileData for unconfirmed character profiles', () => {
const groups = createEmptyAssetGroupMap()
groups.character.push({
id: 'character-1',
scope: 'project',
kind: 'character',
family: 'visual',
name: '林夏',
folderId: null,
capabilities: {
canGenerate: true,
canSelectRender: true,
canRevertRender: true,
canModifyRender: true,
canUploadRender: true,
canBindVoice: true,
canCopyFromGlobal: true,
},
taskRefs: [],
taskState: {
isRunning: false,
lastError: null,
},
variants: [],
introduction: '主角',
profileData: JSON.stringify({ archetype: 'lead' }),
profileConfirmed: false,
profileTaskRefs: [],
profileTaskState: {
isRunning: false,
lastError: null,
},
voice: {
voiceType: null,
voiceId: null,
customVoiceUrl: null,
media: null,
},
})
const data = mapAssetGroupsToProjectAssetsData(groups)
expect(data.characters).toHaveLength(1)
expect(data.characters[0]).toEqual(expect.objectContaining({
id: 'character-1',
profileData: JSON.stringify({ archetype: 'lead' }),
profileConfirmed: false,
}))
})
})