mirror of
https://github.com/openai/codex.git
synced 2026-11-22 07:13:50 +00:00
Add thread title to configurable TUI status line (#17187)
- Add thread-title as an optional TUI status line item, omitted unless the user has set a custom name (`ChatWidget.thread_name`). - Refresh the status line when threads are renamded - Add snapshot coverage for renamed-thread footer behavior.
This commit is contained in:
1 parent
5779be314a
commit
aac1e74cd5
5 files changed
+83
-1
No files matched your search
@@ -14,7 +14,7 @@
|
||||
//! - Git information (branch name)
|
||||
//! - Context usage (meter, window size)
|
||||
//! - Usage limits (5-hour, weekly)
|
||||
//! - Session info (ID, tokens used)
|
||||
//! - Session info (thread title, ID, tokens used)
|
||||
//! - Application version
|
||||
|
||||
use ratatui::buffer::Buffer;
|
||||
@@ -98,6 +98,9 @@ pub(crate) enum StatusLineItem {
|
||||
|
||||
/// Whether Fast mode is currently active.
|
||||
FastMode,
|
||||
|
||||
/// Current thread title (if set by user).
|
||||
ThreadTitle,
|
||||
}
|
||||
|
||||
impl StatusLineItem {
|
||||
@@ -129,6 +132,7 @@ impl StatusLineItem {
|
||||
"Current session identifier (omitted until session starts)"
|
||||
}
|
||||
StatusLineItem::FastMode => "Whether Fast mode is currently active",
|
||||
StatusLineItem::ThreadTitle => "Current thread title (omitted unless changed by user)",
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -149,6 +153,7 @@ const SELECTABLE_STATUS_LINE_ITEMS: &[StatusLineItem] = &[
|
||||
StatusLineItem::TotalOutputTokens,
|
||||
StatusLineItem::SessionId,
|
||||
StatusLineItem::FastMode,
|
||||
StatusLineItem::ThreadTitle,
|
||||
];
|
||||
|
||||
/// Runtime values used to preview the current status-line selection.
|
||||
@@ -380,6 +385,33 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn preview_includes_thread_title() {
|
||||
let preview_data = StatusLinePreviewData::from_iter([
|
||||
(StatusLineItem::ModelName, "gpt-5".to_string()),
|
||||
(StatusLineItem::ThreadTitle, "Roadmap cleanup".to_string()),
|
||||
]);
|
||||
let items = vec![
|
||||
MultiSelectItem {
|
||||
id: StatusLineItem::ModelName.to_string(),
|
||||
name: String::new(),
|
||||
description: None,
|
||||
enabled: true,
|
||||
},
|
||||
MultiSelectItem {
|
||||
id: StatusLineItem::ThreadTitle.to_string(),
|
||||
name: String::new(),
|
||||
description: None,
|
||||
enabled: true,
|
||||
},
|
||||
];
|
||||
|
||||
assert_eq!(
|
||||
preview_data.line_for_items(&items),
|
||||
Some(Line::from("gpt-5 · Roadmap cleanup"))
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn setup_view_snapshot_uses_runtime_preview_values() {
|
||||
let (tx_raw, _rx) = unbounded_channel::<AppEvent>();
|
||||
|
||||
Reference in new issue
Block a user