mirror of
https://github.com/openai/codex.git
synced 2026-05-02 02:17:22 +00:00
[tui] add optional details to TUI status header (#8293)
### What Add optional `details` field to TUI's status indicator header. `details` is shown under the header with text wrapping and a max height of 3 lines. Duplicated changes to `tui2`. ### Why Groundwork for displaying error details under `Reconnecting...` for clarity with retryable errors. Basic examples <img width="1012" height="326" alt="image" src="https://github.com/user-attachments/assets/dd751ceb-b179-4fb2-8fd1-e4784d6366fb" /> <img width="1526" height="358" alt="image" src="https://github.com/user-attachments/assets/bbe466fc-faff-4a78-af7f-3073ccdd8e34" /> Truncation example <img width="936" height="189" alt="image" src="https://github.com/user-attachments/assets/f3f1b5dd-9050-438b-bb07-bd833c03e889" /> ### Tests Tested locally, added tests for truncation.
This commit is contained in:
@@ -377,15 +377,22 @@ impl ChatWidget {
|
||||
}
|
||||
}
|
||||
|
||||
fn set_status_header(&mut self, header: String) {
|
||||
/// Update the status indicator header and details.
|
||||
///
|
||||
/// Passing `None` clears any existing details.
|
||||
fn set_status(&mut self, header: String, details: Option<String>) {
|
||||
self.current_status_header = header.clone();
|
||||
self.bottom_pane.update_status_header(header);
|
||||
self.bottom_pane.update_status(header, details);
|
||||
}
|
||||
|
||||
/// Convenience wrapper around [`Self::set_status`];
|
||||
/// updates the status indicator header and clears any existing details.
|
||||
fn set_status_header(&mut self, header: String) {
|
||||
self.set_status(header, None);
|
||||
}
|
||||
|
||||
fn restore_retry_status_header_if_present(&mut self) {
|
||||
if let Some(header) = self.retry_status_header.take()
|
||||
&& self.current_status_header != header
|
||||
{
|
||||
if let Some(header) = self.retry_status_header.take() {
|
||||
self.set_status_header(header);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user