feat(tui): stream thinking + tools expanded by default

Extends SECTION_DEFAULTS so the out-of-the-box TUI shows the turn as
a live transcript (reasoning + tool calls streaming inline) instead of
a wall of `▸` chevrons the user has to click every turn.

Final default matrix:

  - thinking: expanded
  - tools:    expanded
  - activity: hidden    (unchanged from the previous commit)
  - subagents: falls through to details_mode (collapsed by default)

Everything explicit in `display.sections` still wins, so anyone who
already pinned an override keeps their layout.  One-line revert is
`display.sections.<name>: collapsed`.
This commit is contained in:
Brooklyn Nicholson 2026-04-24 02:53:44 -05:00
parent 70925363b6
commit 67bfd4b828
3 changed files with 53 additions and 26 deletions

View file

@ -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.<name>` in config.yaml
// or at runtime via `/details <name> collapsed|hidden`.
const SECTION_DEFAULTS: SectionVisibility = {
thinking: 'expanded',
tools: 'expanded',
activity: 'hidden'
}
const THINKING_FALLBACK: Record<string, DetailsMode> = {
collapsed: 'collapsed',