diff --git a/ui-tui/src/__tests__/details.test.ts b/ui-tui/src/__tests__/details.test.ts index 56b82087e..15ef681dc 100644 --- a/ui-tui/src/__tests__/details.test.ts +++ b/ui-tui/src/__tests__/details.test.ts @@ -73,10 +73,16 @@ describe('resolveSections', () => { describe('sectionMode', () => { it('falls back to the global mode for sections without a built-in default', () => { - expect(sectionMode('tools', 'collapsed', {})).toBe('collapsed') - expect(sectionMode('tools', 'expanded', undefined)).toBe('expanded') - expect(sectionMode('thinking', 'collapsed', {})).toBe('collapsed') - expect(sectionMode('subagents', 'expanded', {})).toBe('expanded') + expect(sectionMode('subagents', 'collapsed', {})).toBe('collapsed') + expect(sectionMode('subagents', 'expanded', undefined)).toBe('expanded') + expect(sectionMode('subagents', 'hidden', {})).toBe('hidden') + }) + + it('streams thinking + tools expanded by default regardless of global mode', () => { + expect(sectionMode('thinking', 'collapsed', {})).toBe('expanded') + expect(sectionMode('thinking', 'hidden', undefined)).toBe('expanded') + expect(sectionMode('tools', 'collapsed', {})).toBe('expanded') + expect(sectionMode('tools', 'hidden', undefined)).toBe('expanded') }) it('hides the activity panel by default regardless of global mode', () => { @@ -86,16 +92,17 @@ describe('sectionMode', () => { }) it('honours per-section overrides over both the section default and global mode', () => { + expect(sectionMode('thinking', 'collapsed', { thinking: 'collapsed' })).toBe('collapsed') + expect(sectionMode('tools', 'collapsed', { tools: 'hidden' })).toBe('hidden') expect(sectionMode('activity', 'collapsed', { activity: 'expanded' })).toBe('expanded') expect(sectionMode('activity', 'expanded', { activity: 'collapsed' })).toBe('collapsed') - expect(sectionMode('tools', 'collapsed', { tools: 'expanded' })).toBe('expanded') }) it('lets per-section overrides escape the global hidden mode', () => { // Regression for the case where global details_mode: hidden used to // short-circuit the entire accordion and prevent overrides from // surfacing — `sections.tools: expanded` must still resolve to expanded. - expect(sectionMode('tools', 'hidden', { tools: 'expanded' })).toBe('expanded') + expect(sectionMode('subagents', 'hidden', { subagents: 'expanded' })).toBe('expanded') expect(sectionMode('thinking', 'hidden', { thinking: 'collapsed' })).toBe('collapsed') expect(sectionMode('activity', 'hidden', { activity: 'expanded' })).toBe('expanded') }) diff --git a/ui-tui/src/domain/details.ts b/ui-tui/src/domain/details.ts index 75f25a3aa..079b08ea7 100644 --- a/ui-tui/src/domain/details.ts +++ b/ui-tui/src/domain/details.ts @@ -4,12 +4,27 @@ const MODES = ['hidden', 'collapsed', 'expanded'] as const export const SECTION_NAMES = ['thinking', 'tools', 'subagents', 'activity'] as const -// Activity panel = ambient meta (gateway hints, terminal-parity nudges, -// background-process notifications). Hidden out of the box because tool -// failures already render inline on the failing tool row — the panel itself -// is noise for typical use. Opt back in via `display.sections.activity` or -// `/details activity collapsed`. -const SECTION_DEFAULTS: SectionVisibility = { activity: 'hidden' } +// Out-of-the-box per-section defaults — applied when the user hasn't pinned +// an explicit override and layered ABOVE the global details_mode: +// +// - thinking / tools: expanded — stream open so the turn reads like a +// live transcript (reasoning + tool calls side by side) instead of a +// wall of chevrons the user has to click every turn. +// - activity: hidden — ambient meta (gateway hints, terminal-parity +// nudges, background notifications) is noise for typical use. Tool +// failures still render inline on the failing tool row, and ambient +// errors/warnings surface via the floating-alert backstop when every +// panel resolves to hidden. +// - subagents: not set — falls through to the global details_mode so +// Spawn trees stay under a chevron until a delegation actually happens. +// +// Opt out of any of these with `display.sections.` in config.yaml +// or at runtime via `/details collapsed|hidden`. +const SECTION_DEFAULTS: SectionVisibility = { + thinking: 'expanded', + tools: 'expanded', + activity: 'hidden' +} const THINKING_FALLBACK: Record = { collapsed: 'collapsed', diff --git a/website/docs/user-guide/tui.md b/website/docs/user-guide/tui.md index 7e76653c5..8c1b179b6 100644 --- a/website/docs/user-guide/tui.md +++ b/website/docs/user-guide/tui.md @@ -132,24 +132,29 @@ Runtime toggles: **Default visibility** -- `thinking`, `tools`, `subagents` — fall through to the global `details_mode` - (collapsed under chevron by default, click to expand). -- `activity` — **hidden by default**. The activity panel surfaces ambient - meta (gateway hints, terminal-parity nudges, background notifications) and - is noise for most day-to-day use. Tool failures still render inline on the - failing tool row, so this default suppresses the noise feed without losing - the signal. +The TUI ships with opinionated per-section defaults that stream the turn as +a live transcript instead of a wall of chevrons: + +- `thinking` — **expanded**. Reasoning streams inline as the model emits it. +- `tools` — **expanded**. Tool calls and their results render open. +- `subagents` — falls through to the global `details_mode` (collapsed under + chevron by default — stays quiet until a delegation actually happens). +- `activity` — **hidden**. Ambient meta (gateway hints, terminal-parity + nudges, background notifications) is noise for most day-to-day use. Tool + failures still render inline on the failing tool row; ambient + errors/warnings surface via a floating-alert backstop when every panel + is hidden. Per-section overrides take precedence over both the section default and the -global `details_mode`. To opt the activity panel back in: +global `details_mode`. To reshape the layout: -- `display.sections.activity: collapsed` — under a chevron -- `display.sections.activity: expanded` — always open -- `/details activity collapsed` at runtime +- `display.sections.thinking: collapsed` — put thinking back under a chevron +- `display.sections.tools: collapsed` — put tool calls back under a chevron +- `display.sections.activity: collapsed` — opt the activity panel back in +- `/details
` at runtime -With `activity: hidden` (the default), errors/warnings are suppressed entirely -— the floating-alert fallback that surfaces under `details_mode: hidden` is -silenced as well. +Anything set explicitly in `display.sections` wins over the defaults, so +existing configs keep working unchanged. ## Sessions