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

@@ -22,8 +22,56 @@ describe('ImageGenerationInlineCountButton', () => {
}),
)
expect(html).toContain('role="button"')
expect(html).toContain('aria-disabled="true"')
expect(html).toContain('opacity-60 cursor-not-allowed')
expect(html).not.toContain('<select disabled=""')
expect(html).toContain('rounded-full bg-white/12')
expect(html).toContain('inline-flex shrink-0 items-center whitespace-nowrap leading-none')
})
it('renders the count control as a rounded inline pill with the chevron inside it', () => {
Reflect.set(globalThis, 'React', React)
const html = renderToStaticMarkup(
createElement(ImageGenerationInlineCountButton, {
prefix: createElement('span', null, '重新生成'),
suffix: createElement('span', null, '张'),
value: 2,
options: [1, 2, 3],
onValueChange: () => undefined,
onClick: () => undefined,
ariaLabel: '选择重新生成数量',
}),
)
expect(html).toContain('重新生成')
expect(html).toContain('张')
expect(html).toContain('whitespace-nowrap')
expect(html).toContain('rounded-full bg-white/12')
expect(html).toContain('right-2')
expect(html).toContain('hover:bg-white/16')
})
it('can render a regenerate action without exposing the count selector', () => {
Reflect.set(globalThis, 'React', React)
const html = renderToStaticMarkup(
createElement(ImageGenerationInlineCountButton, {
prefix: createElement('span', null, '重新生成'),
suffix: null,
value: 2,
options: [1, 2, 3],
onValueChange: () => undefined,
onClick: () => undefined,
showCountControl: false,
ariaLabel: '重新生成当前图片',
className: 'inline-flex h-6 items-center justify-center rounded-md px-1.5',
}),
)
expect(html).toContain('重新生成')
expect(html).toContain('type="button"')
expect(html).not.toContain('<select')
expect(html).not.toContain('rounded-full bg-white/12')
})
})