diff --git a/ui-tui/src/__tests__/constants.test.ts b/ui-tui/src/__tests__/constants.test.ts index 0a864f160b..c469883079 100644 --- a/ui-tui/src/__tests__/constants.test.ts +++ b/ui-tui/src/__tests__/constants.test.ts @@ -3,9 +3,7 @@ import { describe, expect, it } from 'vitest' import { FACES, HOTKEYS, INTERPOLATION_RE, PLACEHOLDERS, ROLE, TOOL_VERBS, VERBS, ZERO } from '../constants.js' import { DEFAULT_THEME } from '../theme.js' - describe('constants', () => { - it('ZERO', () => expect(ZERO).toEqual({ calls: 0, input: 0, output: 0, total: 0 })) it('string arrays are populated', () => { diff --git a/ui-tui/src/__tests__/messages.test.ts b/ui-tui/src/__tests__/messages.test.ts index 0ce7150553..8f6a265f1d 100644 --- a/ui-tui/src/__tests__/messages.test.ts +++ b/ui-tui/src/__tests__/messages.test.ts @@ -2,9 +2,7 @@ import { describe, expect, it } from 'vitest' import { upsert } from '../lib/messages.js' - describe('upsert', () => { - it('appends when last role differs', () => { expect(upsert([{ role: 'user', text: 'hi' }], 'assistant', 'hello')).toHaveLength(2) }) diff --git a/ui-tui/src/__tests__/text.test.ts b/ui-tui/src/__tests__/text.test.ts index 322d292942..be93126c72 100644 --- a/ui-tui/src/__tests__/text.test.ts +++ b/ui-tui/src/__tests__/text.test.ts @@ -11,9 +11,7 @@ import { userDisplay } from '../lib/text.js' - describe('stripAnsi / hasAnsi', () => { - it('strips ANSI codes', () => { expect(stripAnsi('\x1b[31mred\x1b[0m')).toBe('red') }) @@ -28,9 +26,7 @@ describe('stripAnsi / hasAnsi', () => { }) }) - describe('compactPreview', () => { - it('truncates with ellipsis', () => { expect(compactPreview('a'.repeat(100), 20)).toHaveLength(20) expect(compactPreview('a'.repeat(100), 20).at(-1)).toBe('…') @@ -49,9 +45,7 @@ describe('compactPreview', () => { }) }) - describe('estimateRows', () => { - it('single line', () => expect(estimateRows('hello', 80)).toBe(1)) it('wraps long lines', () => expect(estimateRows('a'.repeat(160), 80)).toBe(2)) @@ -72,9 +66,7 @@ describe('estimateRows', () => { }) }) - describe('fmtK', () => { - it('formats thousands', () => expect(fmtK(1500)).toBe('1.5k')) it('keeps small numbers', () => expect(fmtK(42)).toBe('42')) @@ -85,25 +77,19 @@ describe('fmtK', () => { }) }) - describe('hasInterpolation', () => { - it('detects {!cmd}', () => expect(hasInterpolation('echo {!date}')).toBe(true)) it('rejects plain text', () => expect(hasInterpolation('plain')).toBe(false)) }) - describe('pick', () => { - it('returns element from array', () => { expect([1, 2, 3]).toContain(pick([1, 2, 3])) }) }) - describe('userDisplay', () => { - it('returns short messages as-is', () => expect(userDisplay('hello')).toBe('hello')) it('truncates long messages', () => { diff --git a/ui-tui/src/__tests__/theme.test.ts b/ui-tui/src/__tests__/theme.test.ts index ea0011a519..86a9768b0f 100644 --- a/ui-tui/src/__tests__/theme.test.ts +++ b/ui-tui/src/__tests__/theme.test.ts @@ -2,9 +2,7 @@ import { describe, expect, it } from 'vitest' import { DEFAULT_THEME, fromSkin } from '../theme.js' - describe('DEFAULT_THEME', () => { - it('has brand defaults', () => { expect(DEFAULT_THEME.brand.name).toBe('Hermes Agent') expect(DEFAULT_THEME.brand.prompt).toBe('❯') @@ -17,9 +15,7 @@ describe('DEFAULT_THEME', () => { }) }) - describe('fromSkin', () => { - it('overrides banner colors', () => { expect(fromSkin({ banner_title: '#FF0000' }, {}).color.gold).toBe('#FF0000') }) diff --git a/ui-tui/src/app.tsx b/ui-tui/src/app.tsx index 2fed081e2a..93fc5159c2 100644 --- a/ui-tui/src/app.tsx +++ b/ui-tui/src/app.tsx @@ -213,6 +213,7 @@ export function App({ gw }: { gw: GatewayClient }) { const { queueRef, queueEditRef, queuedDisplay, queueEditIdx, enqueue, dequeue, replaceQ, setQueueEdit, syncQueue } = useQueue() + const { historyRef, historyIdx, setHistoryIdx, historyDraftRef, pushHistory } = useInputHistory() const { completions, compIdx, setCompIdx, compReplace } = useCompletion(input, blocked(), gw) @@ -733,6 +734,7 @@ export function App({ gw }: { gw: GatewayClient }) { queueEditIdx === null ? queueRef.current.length - 1 : (queueEditIdx - 1 + queueRef.current.length) % queueRef.current.length + setQueueEdit(idx) setHistoryIdx(null) setInput(queueRef.current[idx] ?? '') @@ -1014,7 +1016,6 @@ export function App({ gw }: { gw: GatewayClient }) { break } - // eslint-disable-next-line react-hooks/exhaustive-deps }, [appendMessage, dequeue, newSession, pushActivity, send, sys] ) @@ -1470,7 +1471,6 @@ export function App({ gw }: { gw: GatewayClient }) { return true } - // eslint-disable-next-line react-hooks/exhaustive-deps }, [catalog, compact, gw, lastUserMsg, messages, newSession, pastes, pushActivity, rpc, send, sid, statusBar, sys] ) @@ -1526,7 +1526,6 @@ export function App({ gw }: { gw: GatewayClient }) { } dispatchSubmission([...inputBuf, value].join('\n')) - // eslint-disable-next-line react-hooks/exhaustive-deps }, [dequeue, dispatchSubmission, inputBuf, sid] )