fix: 完善聊天解析与导出体验

- 修复引用消息名称和图片布局
- 明确单会话图片测试日志范围
- 支持导出文件附件
- 完善图片批测、会话刷新和安全退出
This commit is contained in:
Wxw-Gu
2026-08-04 12:03:07 +08:00
parent d76727875d
commit c70e49bf16
41 changed files with 2320 additions and 221 deletions
+21
View File
@@ -9,6 +9,7 @@ vi.mock('../../src/renderer/src/components/image-loader', () => ({
}))
import { ImageBubble } from '../../src/renderer/src/components/ImageBubble'
import { RichMessageBubble } from '../../src/renderer/src/components/RichMessageBubble'
const thumbnail =
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAusB9Y9ZQmcAAAAASUVORK5CYII='
@@ -50,4 +51,24 @@ describe('ImageBubble', () => {
await userEvent.click(screen.getByText('加载失败'))
expect(await screen.findByAltText('图片')).toBeVisible()
})
it('places a quoted image on the line below the quoted sender', async () => {
requestImage.mockResolvedValueOnce({ data: thumbnail, isThumbnail: true })
const { container } = render(
<RichMessageBubble
contentData={{
type: 'quote',
content: '回复内容',
quotedContent: '[图片]',
quotedSender: '测试群成员',
quotedImageMd5: 'fixture-image'
}}
sessionId="fixture-session"
/>
)
expect(screen.getByText('测试群成员')).toBeInTheDocument()
expect(container.querySelector('.quoted-message')).toHaveClass('quoted-message-image')
expect(await screen.findByAltText('图片')).toBeVisible()
})
})