fix(tui): pin todo panel above live output

This commit is contained in:
Brooklyn Nicholson 2026-04-26 15:27:31 -05:00
parent a7831b63db
commit 3271ffbd80
6 changed files with 38 additions and 15 deletions

View file

@ -0,0 +1,9 @@
import { describe, expect, it } from 'vitest'
import { liveTailOrder } from './liveLayout.js'
describe('liveTailOrder', () => {
it('keeps todo before transcript and assistant live output', () => {
expect(liveTailOrder()).toEqual(['todo', 'history', 'assistant'])
})
})

View file

@ -0,0 +1 @@
export const liveTailOrder = () => ['todo', 'history', 'assistant'] as const

View file

@ -1,6 +1,6 @@
import { describe, expect, it } from 'vitest'
import { todoGlyph } from './todo.js'
import { todoGlyph, todoTone } from './todo.js'
describe('todoGlyph', () => {
it('uses fixed-width ASCII markers so the active row does not render wide or emoji-like', () => {
@ -10,3 +10,12 @@ describe('todoGlyph', () => {
expect(todoGlyph('cancelled')).toBe('[-]')
})
})
describe('todoTone', () => {
it('keeps todo status rows neutral instead of red/green', () => {
expect(todoTone('completed')).toBe('dim')
expect(todoTone('cancelled')).toBe('dim')
expect(todoTone('pending')).toBe('body')
expect(todoTone('in_progress')).toBe('active')
})
})

View file

@ -1,4 +1,9 @@
import type { TodoItem } from '../types.js'
export type TodoTone = 'active' | 'body' | 'dim'
export const todoGlyph = (status: TodoItem['status']) =>
status === 'completed' ? '[x]' : status === 'cancelled' ? '[-]' : status === 'in_progress' ? '[>]' : '[ ]'
export const todoTone = (status: TodoItem['status']): TodoTone =>
status === 'in_progress' ? 'active' : status === 'pending' ? 'body' : 'dim'