codex-rs: Rename /clear to /new, make it start an entirely new chat (#1264)

I noticed that `/clear` wasn't fully clearing chat history; it would
clear the chat history widgets _in the UI_, but the LLM still had access
to information from previous messages.

This PR renames `/clear` to `/new` for clarity as per Michael's
suggestion, resetting `app_state` to a fresh `ChatWidget`.
This commit is contained in:
Reilly Wood
2025-06-06 16:29:37 -07:00
committed by GitHub
parent 029f39b9da
commit 345a38502d
4 changed files with 24 additions and 21 deletions

View File

@@ -12,7 +12,7 @@ use strum_macros::IntoStaticStr;
)]
#[strum(serialize_all = "kebab-case")]
pub enum SlashCommand {
Clear,
New,
ToggleMouseMode,
Quit,
}
@@ -21,7 +21,7 @@ impl SlashCommand {
/// User-visible description shown in the popup.
pub fn description(self) -> &'static str {
match self {
SlashCommand::Clear => "Clear the chat history.",
SlashCommand::New => "Start a new chat.",
SlashCommand::ToggleMouseMode => {
"Toggle mouse mode (enable for scrolling, disable for text selection)"
}