Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions codex-rs/tui/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,19 @@ impl App {
}
}
}
AppEvent::InsertEphemeralHistoryLines(lines) => {
if lines.is_empty() {
return Ok(true);
}
// Ephemeral lines are appended to the inline viewport only and do not
// update the persisted transcript_cells.
self.has_emitted_history_lines = true;
if self.overlay.is_some() {
self.deferred_history_lines.extend(lines);
} else {
tui.insert_history_lines(lines);
}
}
AppEvent::StartCommitAnimation => {
if self
.commit_anim_running
Expand Down Expand Up @@ -736,6 +749,12 @@ impl App {
return Ok(false);
}
AppEvent::CodexOp(op) => self.chat_widget.submit_op(op),
AppEvent::SwitchAgent { agent_id } => {
self.chat_widget.switch_to_agent(agent_id);
}
AppEvent::CreateAgentFromComposer { agent_id } => {
self.chat_widget.create_agent_from_composer(agent_id);
}
AppEvent::DiffResult(text) => {
// Clear the in-progress state in the bottom pane
self.chat_widget.on_diff_complete();
Expand Down
16 changes: 16 additions & 0 deletions codex-rs/tui/src/app_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use codex_core::protocol::Event;
use codex_core::protocol::RateLimitSnapshot;
use codex_file_search::FileMatch;
use codex_protocol::openai_models::ModelPreset;
use ratatui::text::Line;

use crate::bottom_pane::ApprovalRequest;
use crate::history_cell::HistoryCell;
Expand Down Expand Up @@ -54,6 +55,9 @@ pub(crate) enum AppEvent {

InsertHistoryCell(Box<dyn HistoryCell>),

/// Insert lines into the inline viewport only (do not persist to transcript).
InsertEphemeralHistoryLines(Vec<Line<'static>>),

StartCommitAnimation,
StopCommitAnimation,
CommitTick,
Expand Down Expand Up @@ -156,6 +160,18 @@ pub(crate) enum AppEvent {
/// Re-open the approval presets popup.
OpenApprovalsPopup,

/// Switch the active agent view.
SwitchAgent {
agent_id: String,
},

/// Create (if needed) a new agent and submit the current composer draft to it.
///
/// Triggered by Ctrl+N in the chat view.
CreateAgentFromComposer {
agent_id: String,
},

/// Forwarded conversation history snapshot from the current conversation.
ConversationHistory(ConversationPathResponseEvent),

Expand Down
Loading
Loading