mirror of
https://github.com/openai/codex.git
synced 2026-11-22 23:00:42 +00:00
## What changed - Show latest user-prompt previews beneath saved side-chat titles, fetching previews only for visible entries when the chooser refreshes. - Keep cached chats available during discovery, show loading and refresh status, and offer an inline retry action on failure. - Preserve the selected chat across list updates and prevent asynchronous changes or held activation keys from opening an unintended entry. Account for preview rows in paging and mouse selection. - Explain that side chats become available after the first main-chat message, and let `Ctrl+C` dismiss the chooser while preserving the main draft. - Separate tabs with noninteractive gaps and improve hover styling for tabs, overflow arrows, and the add button. ## Testing Extend integration tests and snapshots for discovery failures and retries, refreshed prompt previews, activation guards, variable-height paging, draft preservation, and tab hover states across light, dark, and fallback colors. GitOrigin-RevId: 34423f5aeccb566682f7aa219f54ca5c7c8304fb
47 lines
1.7 KiB
Rust
47 lines
1.7 KiB
Rust
//! Chat widget hooks for side-conversation mode.
|
|
//!
|
|
//! App-level side-thread lifecycle lives in `app::side`; this module owns the
|
|
//! chat-surface pieces that side mode toggles, such as the composer placeholder,
|
|
//! footer label, and inline `/side` message submission behavior.
|
|
|
|
use super::*;
|
|
|
|
impl ChatWidget {
|
|
pub(crate) fn side_chat_creation_state(&self) -> crate::sidebar_chooser::NewChatState {
|
|
if self.thread_id.is_some() && self.turn_lifecycle.has_turn_history {
|
|
crate::sidebar_chooser::NewChatState::Available
|
|
} else {
|
|
crate::sidebar_chooser::NewChatState::WaitingForMainMessage
|
|
}
|
|
}
|
|
|
|
pub(crate) fn submit_user_message_as_plain_user_turn(
|
|
&mut self,
|
|
user_message: UserMessage,
|
|
) -> Option<AppCommand> {
|
|
self.submit_user_message_with_shell_escape_policy(user_message, ShellEscapePolicy::Disallow)
|
|
}
|
|
|
|
pub(crate) fn set_side_conversation_active(&mut self, active: bool) {
|
|
self.active_side_conversation = active;
|
|
let placeholder = if active {
|
|
self.side_placeholder_text.clone()
|
|
} else {
|
|
self.normal_placeholder_text.clone()
|
|
};
|
|
self.bottom_pane.set_placeholder_text(placeholder);
|
|
self.bottom_pane.set_side_conversation_active(active);
|
|
if self.blocks_direct_input && !active {
|
|
self.bottom_pane.set_parent_owned_thread();
|
|
}
|
|
}
|
|
|
|
pub(crate) fn side_conversation_active(&self) -> bool {
|
|
self.active_side_conversation
|
|
}
|
|
|
|
pub(crate) fn set_side_conversation_context_label(&mut self, label: Option<String>) {
|
|
self.bottom_pane.set_side_conversation_context_label(label);
|
|
}
|
|
}
|