refactor: move slash command handling into chatwidget (#2536)

no functional change, just moving the code that handles /foo into
chatwidget, since most commands just do things with chatwidget.
This commit is contained in:
Jeremy Rose
2025-08-21 10:36:58 -07:00
committed by GitHub
parent 9604671678
commit 16d16a4ddc
5 changed files with 137 additions and 152 deletions

View File

@@ -4,7 +4,6 @@ use ratatui::text::Line;
use crate::history_cell::HistoryCell;
use crate::slash_command::SlashCommand;
use codex_core::protocol::AskForApproval;
use codex_core::protocol::SandboxPolicy;
use codex_core::protocol_config_types::ReasoningEffort;
@@ -14,6 +13,9 @@ use codex_core::protocol_config_types::ReasoningEffort;
pub(crate) enum AppEvent {
CodexEvent(Event),
/// Start a new session.
NewSession,
/// Request to exit the application gracefully.
ExitRequest,
@@ -21,10 +23,6 @@ pub(crate) enum AppEvent {
/// bubbling channels through layers of widgets.
CodexOp(codex_core::protocol::Op),
/// Dispatch a recognized slash command from the UI (composer) to the app
/// layer so it can be handled centrally.
DispatchCommand(SlashCommand),
/// Kick off an asynchronous file search for the given query (text after
/// the `@`). Previous searches may be cancelled by the app layer so there
/// is at most one in-flight search.