fix(tui): stabilize live todo progress

This commit is contained in:
Brooklyn Nicholson 2026-04-26 15:55:38 -05:00
parent 1566f1eecc
commit f5552f92e2
14 changed files with 256 additions and 86 deletions

View file

@ -4,20 +4,26 @@ import { appendTranscriptMessage } from './messages.js'
describe('appendTranscriptMessage', () => {
it('merges adjacent tool-only shelves into one transcript row', () => {
const out = appendTranscriptMessage(
[{ kind: 'trail', role: 'system', text: '', tools: ['Terminal("one") ✓'] }],
{ kind: 'trail', role: 'system', text: '', tools: ['Terminal("two") ✓'] }
)
const out = appendTranscriptMessage([{ kind: 'trail', role: 'system', text: '', tools: ['Terminal("one") ✓'] }], {
kind: 'trail',
role: 'system',
text: '',
tools: ['Terminal("two") ✓']
})
expect(out).toEqual([{ kind: 'trail', role: 'system', text: '', tools: ['Terminal("one") ✓', 'Terminal("two") ✓'] }])
expect(out).toEqual([
{ kind: 'trail', role: 'system', text: '', tools: ['Terminal("one") ✓', 'Terminal("two") ✓'] }
])
})
it('does not merge tool shelves across thinking text', () => {
it('merges tool shelves into the nearest thinking shelf', () => {
const out = appendTranscriptMessage(
[{ kind: 'trail', role: 'system', text: '', thinking: 'plan', tools: ['Terminal("one") ✓'] }],
{ kind: 'trail', role: 'system', text: '', tools: ['Terminal("two") ✓'] }
)
expect(out).toHaveLength(2)
expect(out).toEqual([
{ kind: 'trail', role: 'system', text: '', thinking: 'plan', tools: ['Terminal("one") ✓', 'Terminal("two") ✓'] }
])
})
})