mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-04 02:21:47 +00:00
fix(tui): pin todo panel above live output
This commit is contained in:
parent
a7831b63db
commit
3271ffbd80
6 changed files with 38 additions and 15 deletions
9
ui-tui/src/lib/liveLayout.test.ts
Normal file
9
ui-tui/src/lib/liveLayout.test.ts
Normal 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'])
|
||||
})
|
||||
})
|
||||
1
ui-tui/src/lib/liveLayout.ts
Normal file
1
ui-tui/src/lib/liveLayout.ts
Normal file
|
|
@ -0,0 +1 @@
|
|||
export const liveTailOrder = () => ['todo', 'history', 'assistant'] as const
|
||||
|
|
@ -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')
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue