diff --git a/crates/ox-core/src/config/tui.rs b/crates/ox-core/src/config/tui.rs index da80b089b..5f7eede64 100644 --- a/crates/ox-core/src/config/tui.rs +++ b/crates/ox-core/src/config/tui.rs @@ -184,6 +184,9 @@ pub struct TuiChromePatch { /// Override for divider rules between entries. #[serde(skip_serializing_if = "Option::is_none")] pub show_dividers: Option, + /// Override for live activity indicator visibility above the input box. + #[serde(skip_serializing_if = "Option::is_none")] + pub activity_indicator: Option, } /// Partial override for TUI glyph and icon settings. @@ -301,6 +304,10 @@ impl TuiConfigPatch { merge_opt(&mut target.tool_style, overlay_chrome.tool_style); merge_opt(&mut target.density, overlay_chrome.density); merge_opt(&mut target.show_dividers, overlay_chrome.show_dividers); + merge_opt( + &mut target.activity_indicator, + overlay_chrome.activity_indicator, + ); } if let Some(overlay_glyphs) = overlay.glyphs { @@ -418,6 +425,7 @@ mod tests { tool_style = "card" density = "relaxed" show_dividers = true + activity_indicator = true "#}; let overlay_toml = indoc! {r##" [layout] @@ -454,6 +462,7 @@ mod tests { tool_style = "compact" density = "compact" show_dividers = false + activity_indicator = false "##}; let mut base: TuiConfigPatch = toml::from_str(base_toml).unwrap(); @@ -482,6 +491,7 @@ mod tests { assert_eq!(chrome.tool_style, Some(ToolStyle::Compact)); assert_eq!(chrome.density, Some(Density::Compact)); assert_eq!(chrome.show_dividers, Some(false)); + assert_eq!(chrome.activity_indicator, Some(false)); } fn assert_merged_input(input: &TuiInputPatch) { diff --git a/crates/ox-tui/src/app.rs b/crates/ox-tui/src/app.rs index b64688504..68d4ceea4 100644 --- a/crates/ox-tui/src/app.rs +++ b/crates/ox-tui/src/app.rs @@ -614,10 +614,19 @@ impl App { !matches!(self.status, AppStatus::Idle) } - /// Returns `true` while an agent turn or any subagent is actively running. + /// Returns `true` while a visible spinner animation should tick. #[must_use] pub fn needs_spinner(&self) -> bool { - self.is_busy() + (self.is_busy() && self.tui_config.chrome.activity_indicator) + || self.visible_entries().iter().any(|entry| { + matches!( + entry, + TranscriptEntry::ToolCall { + status: ToolCallStatus::Running, + .. + } + ) + }) || self .subagents .iter() diff --git a/crates/ox-tui/src/render/ui.rs b/crates/ox-tui/src/render/ui.rs index bd18e687d..331b2fd79 100644 --- a/crates/ox-tui/src/render/ui.rs +++ b/crates/ox-tui/src/render/ui.rs @@ -319,17 +319,18 @@ fn build_layout_plan(inputs: &LayoutPlanInputs<'_>) -> (Vec, Vec.toml`) omit the `[tui]` prefix and use `[la ### `[tui.chrome]` -| Field | Type | Default | Description | -| ------------------- | --------- | ----------- | --------------------------------------------------------------------------------- | -| `transcript_border` | `boolean` | `false` | Draw a box border around the transcript pane | -| `message_style` | `string` | `"prompt"` | Message presentation: `"prompt"`, `"accent_bar"`, `"prefix"`, or `"box"` | -| `tool_style` | `string` | `"compact"` | Tool call presentation: `"compact"` or `"card"` | -| `density` | `string` | `"normal"` | Vertical spacing between transcript entries: `"compact"`, `"normal"`, `"relaxed"` | -| `show_dividers` | `boolean` | `false` | Draw horizontal divider rules between transcript entries | +| Field | Type | Default | Description | +| -------------------- | --------- | ----------- | --------------------------------------------------------------------------------- | +| `transcript_border` | `boolean` | `false` | Draw a box border around the transcript pane | +| `message_style` | `string` | `"prompt"` | Message presentation: `"prompt"`, `"accent_bar"`, `"prefix"`, or `"box"` | +| `tool_style` | `string` | `"compact"` | Tool call presentation: `"compact"` or `"card"` | +| `density` | `string` | `"normal"` | Vertical spacing between transcript entries: `"compact"`, `"normal"`, `"relaxed"` | +| `show_dividers` | `boolean` | `false` | Draw horizontal divider rules between transcript entries | +| `activity_indicator` | `boolean` | `true` | Show the live activity spinner row above the input box while a turn is running | ### `[tui.glyphs]`