feat: implement model management commands and overlays for enhanced user interaction

This commit is contained in:
asepharyana
2026-07-12 02:06:46 +07:00
parent 9f272d5973
commit 662e269f2c
8 changed files with 403 additions and 26 deletions
+18
View File
@@ -34,6 +34,9 @@ pub fn apply_command(command: Command) -> Vec<Action> {
Command::Mode(mode) => {
vec![Action::SwitchMode(mode)]
}
Command::ClearConfirm => {
vec![Action::OpenOverlay(Overlay::ClearConfirm)]
}
Command::Clear => {
vec![Action::SystemNote {
kind: "clear".to_string(),
@@ -43,12 +46,27 @@ pub fn apply_command(command: Command) -> Vec<Action> {
Command::Login { provider } => {
vec![Action::StartOAuth { provider }]
}
Command::Edit(path) if path == "." || path.is_empty() => {
vec![Action::SystemNote {
kind: "info".to_string(),
message: "Usage: /edit <path>\nOpens a file for inline editing.\nExample: /edit src/main.rs".to_string(),
}]
}
Command::Edit(path) => {
vec![Action::OpenEditor { path }]
}
Command::McpAdd { name, command } => {
vec![Action::McpAdd { name, command }]
}
Command::ModelList => {
vec![Action::ModelList]
}
Command::ModelUse { provider } => {
vec![Action::ModelUse { provider }]
}
Command::ModelAdd { name, base_url } => {
vec![Action::ModelAdd { name, base_url }]
}
Command::Unknown(cmd) => {
vec![Action::SystemNote {
kind: "error".to_string(),