feat: refine UI, improve UX, optimize the analysis pipeline, and add character standing positions

This commit is contained in:
saturn
2026-04-02 17:39:16 +08:00
parent c3e74c228a
commit 9703714b69
153 changed files with 4472 additions and 1088 deletions

View File

@@ -0,0 +1,8 @@
import { describe, expect, it } from 'vitest'
import { formatDefaultProjectTimestamp } from '@/lib/projects/default-name'
describe('default project name timestamp', () => {
it('formats month-day and hour-minute without year', () => {
expect(formatDefaultProjectTimestamp(new Date('2026-03-29T18:56:42+08:00'))).toBe('03-29 18:56')
})
})

View File

@@ -0,0 +1,28 @@
import { describe, expect, it } from 'vitest'
import {
normalizeProjectDraft,
validateProjectDraft,
} from '@/lib/projects/validation'
describe('project validation', () => {
it('normalizes blank descriptions to null', () => {
expect(normalizeProjectDraft({
name: ' 项目 A ',
description: ' ',
})).toEqual({
name: '项目 A',
description: null,
})
})
it('rejects descriptions longer than the shared max limit', () => {
expect(validateProjectDraft({
name: '项目 A',
description: 'a'.repeat(501),
})).toEqual({
code: 'PROJECT_DESCRIPTION_TOO_LONG',
field: 'description',
limit: 500,
})
})
})