fix(tui): stabilize live progress rendering

This commit is contained in:
Brooklyn Nicholson 2026-04-26 15:23:43 -05:00
parent d4dde6b5f2
commit a7831b63db
28 changed files with 619 additions and 154 deletions

View file

@ -0,0 +1,27 @@
import { describe, expect, it } from 'vitest'
import {
freezeTurnRendering,
getRenderableTurnState,
patchTurnState,
resetTurnState,
unfreezeTurnRendering
} from '../app/turnStore.js'
describe('turn render freezing', () => {
it('holds the render snapshot stable while live turn state keeps changing', () => {
resetTurnState()
patchTurnState({ streaming: 'before scroll' })
freezeTurnRendering()
patchTurnState({ reasoning: 'new thinking', streaming: 'new streamed text' })
expect(getRenderableTurnState().streaming).toBe('before scroll')
expect(getRenderableTurnState().reasoning).toBe('')
unfreezeTurnRendering()
expect(getRenderableTurnState().streaming).toBe('new streamed text')
expect(getRenderableTurnState().reasoning).toBe('new thinking')
})
})