mirror of
https://github.com/openai/codex.git
synced 2026-11-14 21:40:39 +00:00
## What changed - Show revealed running hooks in the bottom activity area instead of the conversation viewport or transcript overlay. Fold the hook message into the active status row when space permits and reflow it below the row without displacing background-process controls or status details. - Keep fast hooks hidden, collapse concurrent hooks to a shared summary when needed, and support hook activity outside an active agent turn. - Simplify durable hook output into user-facing messages and actionable failure, block, and stop states. Suppress model-facing context and quiet successful completions from all TUI history surfaces. ## Testing - Add lifecycle, layout, narrow-width, multi-width Unicode, transcript, restart, and completion-output coverage for hook status and history rendering. GitOrigin-RevId: 4c52b7a736e9e466e109107eb3c04a39d089597f
33 lines
1023 B
Rust
33 lines
1023 B
Rust
//! Transient hook activity, independent of whether an agent turn owns a status row.
|
|
|
|
use crate::line_truncation::truncate_line_with_ellipsis_if_overflow;
|
|
use crate::motion::MotionMode;
|
|
use crate::motion::shimmer_text;
|
|
use crate::render::renderable::Renderable;
|
|
use crate::text_formatting::capitalize_first;
|
|
use ratatui::buffer::Buffer;
|
|
use ratatui::layout::Rect;
|
|
use ratatui::style::Stylize;
|
|
use ratatui::text::Line;
|
|
|
|
pub(super) struct HookStatus<'a> {
|
|
pub message: &'a str,
|
|
pub animations_enabled: bool,
|
|
}
|
|
|
|
impl Renderable for HookStatus<'_> {
|
|
fn render(&self, area: Rect, buf: &mut Buffer) {
|
|
let mut spans = vec!["• ".dim()];
|
|
spans.extend(shimmer_text(
|
|
&capitalize_first(self.message),
|
|
MotionMode::from_animations_enabled(self.animations_enabled),
|
|
));
|
|
truncate_line_with_ellipsis_if_overflow(Line::from(spans).dim(), usize::from(area.width))
|
|
.render(area, buf);
|
|
}
|
|
|
|
fn desired_height(&self, _width: u16) -> u16 {
|
|
1
|
|
}
|
|
}
|