Polish web chat presentation

This commit is contained in:
Yichen Jiang
2026-07-30 19:30:58 +08:00
parent 3921610f5b
commit b121adcf1a
23 changed files with 201 additions and 87 deletions
@@ -111,7 +111,11 @@ describe('MessageItem arms', () => {
const ctxView = render(
<MessageItem node={{ kind: 'context', seq: 3, content: [], source: null } as never} />,
)
expect(ctxView.getByText(/上下文注入/)).toBeTruthy()
const contextToggle = ctxView.getByRole('button', { name: '上下文注入' })
expect(contextToggle.getAttribute('aria-expanded')).toBe('false')
expect(contextToggle.querySelector('svg')).not.toBeNull()
fireEvent.click(contextToggle)
expect(contextToggle.getAttribute('aria-expanded')).toBe('true')
const unknownView = render(
<MessageItem node={{ kind: 'unknown', seq: 4, type: 'surface/next', data: { x: 1 } } as never} />,
)
@@ -318,6 +318,7 @@ describe('ChatView', () => {
const view = render(<h.ChatView {...h.props} />)
expect(view.container.querySelector('[data-state="running"]')).not.toBeNull()
expect(view.getByText('cmd-r1')).toBeTruthy()
expect(view.getByRole('status').textContent).toBe('Deep diving...')
})
it('dispatches each tool row through the keyed slot with the tool name as entryKey', () => {