mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
Refine hook activity rendering in the TUI (#42118)
## 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
This commit is contained in:
1 parent
ea7e0714da
commit
bc39b0ed59
35 files changed
+903
-945
No files matched your search
@@ -1,13 +1,14 @@
|
||||
//! Hook run lifecycle handling for `ChatWidget`.
|
||||
//!
|
||||
//! This module keeps active hook cells, hook timers, and hook completion output
|
||||
//! together.
|
||||
//! This module keeps hook timers, compact activity-row progress, and durable
|
||||
//! hook completion output together.
|
||||
|
||||
use super::*;
|
||||
|
||||
impl ChatWidget {
|
||||
/// Drop transient live hook status without flushing it into history.
|
||||
pub(super) fn clear_active_hook_cell(&mut self) {
|
||||
self.bottom_pane.set_hook_status_message(/*message*/ None);
|
||||
if self.active_hook_cell.take().is_some() {
|
||||
self.bump_active_cell_revision();
|
||||
self.request_pending_usage_output_insertion();
|
||||
@@ -23,13 +24,11 @@ impl ChatWidget {
|
||||
self.bump_active_cell_revision();
|
||||
}
|
||||
None => {
|
||||
self.active_hook_cell = Some(history_cell::new_active_hook_cell(
|
||||
run,
|
||||
self.config.animations,
|
||||
));
|
||||
self.active_hook_cell = Some(history_cell::new_active_hook_cell(run));
|
||||
self.bump_active_cell_revision();
|
||||
}
|
||||
}
|
||||
self.sync_hook_status_message();
|
||||
self.request_redraw();
|
||||
}
|
||||
|
||||
@@ -51,8 +50,7 @@ impl ChatWidget {
|
||||
self.bump_active_cell_revision();
|
||||
}
|
||||
None => {
|
||||
let cell =
|
||||
history_cell::new_completed_hook_cell(completed, self.config.animations);
|
||||
let cell = history_cell::new_completed_hook_cell(completed);
|
||||
if !cell.is_empty() {
|
||||
self.active_hook_cell = Some(cell);
|
||||
self.bump_active_cell_revision();
|
||||
@@ -62,6 +60,7 @@ impl ChatWidget {
|
||||
}
|
||||
self.flush_completed_hook_output();
|
||||
self.finish_active_hook_cell_if_idle();
|
||||
self.sync_hook_status_message();
|
||||
self.request_redraw();
|
||||
}
|
||||
|
||||
@@ -118,6 +117,15 @@ impl ChatWidget {
|
||||
self.bump_active_cell_revision();
|
||||
}
|
||||
self.finish_active_hook_cell_if_idle();
|
||||
self.sync_hook_status_message();
|
||||
}
|
||||
|
||||
fn sync_hook_status_message(&mut self) {
|
||||
let status_message = self
|
||||
.active_hook_cell
|
||||
.as_ref()
|
||||
.and_then(HookCell::running_status_summary);
|
||||
self.bottom_pane.set_hook_status_message(status_message);
|
||||
}
|
||||
|
||||
pub(super) fn schedule_hook_timer_if_needed(&self) {
|
||||
|
||||
Reference in new issue
Block a user