Fix prop confirmation bug, add Wan 2.7 model, refine multiple UI details, improve prop generation quality and aspect ratio, remove text overlays from Asset Center created images, and optimize prop filtering logic

This commit is contained in:
saturn
2026-04-03 22:36:41 +08:00
parent 854b932e67
commit 78b93331b4
136 changed files with 3393 additions and 875 deletions

View File

@@ -1,8 +1,11 @@
import { describe, expect, it } from 'vitest'
import {
addCharacterPromptSuffix,
addPropPromptSuffix,
CHARACTER_PROMPT_SUFFIX,
PROP_PROMPT_SUFFIX,
removeCharacterPromptSuffix,
removePropPromptSuffix,
} from '@/lib/constants'
function countOccurrences(input: string, target: string) {
@@ -32,4 +35,21 @@ describe('character prompt suffix regression', () => {
expect(addCharacterPromptSuffix('')).toBe(CHARACTER_PROMPT_SUFFIX)
expect(removeCharacterPromptSuffix('')).toBe('')
})
it('appends the prop suffix exactly once', () => {
const basePrompt = '银质餐具套装,包含刀叉与汤匙,金属光泽冷白'
const generated = addPropPromptSuffix(basePrompt)
expect(generated).toContain(PROP_PROMPT_SUFFIX)
expect(countOccurrences(generated, PROP_PROMPT_SUFFIX)).toBe(1)
})
it('removes the prop suffix from prompts', () => {
const basePrompt = '黑铁长棍,两端包裹金色金属箍'
const withSuffix = addPropPromptSuffix(basePrompt)
const removed = removePropPromptSuffix(withSuffix)
expect(removed).not.toContain(PROP_PROMPT_SUFFIX)
expect(removed).toContain(basePrompt)
})
})

View File

@@ -0,0 +1,22 @@
import { describe, expect, it } from 'vitest'
import { isBillableTaskType } from '@/lib/billing/task-policy'
import { getLLMTaskPolicy } from '@/lib/llm-observe/task-policy'
import { getTaskTypeLabel } from '@/lib/task/progress-message'
import { resolveTaskIntent } from '@/lib/task/intent'
import { TASK_TYPE } from '@/lib/task/types'
describe('prop modify task registration', () => {
it('registers project prop modify tasks across task metadata helpers', () => {
expect(resolveTaskIntent(TASK_TYPE.AI_MODIFY_PROP)).toBe('modify')
expect(getTaskTypeLabel(TASK_TYPE.AI_MODIFY_PROP)).toBe('progress.taskType.aiModifyProp')
expect(isBillableTaskType(TASK_TYPE.AI_MODIFY_PROP)).toBe(true)
expect(getLLMTaskPolicy(TASK_TYPE.AI_MODIFY_PROP).consoleEnabled).toBe(true)
})
it('registers asset-hub prop modify tasks across task metadata helpers', () => {
expect(resolveTaskIntent(TASK_TYPE.ASSET_HUB_AI_MODIFY_PROP)).toBe('modify')
expect(getTaskTypeLabel(TASK_TYPE.ASSET_HUB_AI_MODIFY_PROP)).toBe('progress.taskType.assetHubAiModifyProp')
expect(isBillableTaskType(TASK_TYPE.ASSET_HUB_AI_MODIFY_PROP)).toBe(true)
expect(getLLMTaskPolicy(TASK_TYPE.ASSET_HUB_AI_MODIFY_PROP).consoleEnabled).toBe(true)
})
})