Refactor view modules for improved readability and consistency
- Updated markdown rendering logic to use more concise methods for obtaining vector lengths. - Changed review status display to use the correct flag from settings. - Cleaned up sidebar rendering code for better formatting and readability. - Enhanced status bar rendering with improved string formatting and consistent style application. - Refined workflow panel rendering, ensuring consistent style usage and improved readability. - Added architecture overview and detailed documentation for backend, data, dependencies, and frontend structures.
This commit is contained in:
+12
-10
@@ -11,10 +11,7 @@ pub enum Command {
|
||||
ClearConfirm,
|
||||
Login { provider: String },
|
||||
Edit(String),
|
||||
McpAdd {
|
||||
name: String,
|
||||
command: String,
|
||||
},
|
||||
McpAdd { name: String, command: String },
|
||||
ModelList,
|
||||
Compact,
|
||||
TodoOpen,
|
||||
@@ -44,13 +41,15 @@ pub fn parse_command(text: &str) -> Command {
|
||||
"/quit" => Command::Quit,
|
||||
"/clear" if arg1.is_empty() => Command::ClearConfirm,
|
||||
"/clear" => Command::Clear,
|
||||
"/login" if arg1.is_empty() => Command::Login { provider: String::new() },
|
||||
"/login" if !arg1.is_empty() => Command::Login { provider: arg1.to_string() },
|
||||
"/login" if arg1.is_empty() => Command::Login {
|
||||
provider: String::new(),
|
||||
},
|
||||
"/login" if !arg1.is_empty() => Command::Login {
|
||||
provider: arg1.to_string(),
|
||||
},
|
||||
"/edit" if !arg1.is_empty() => Command::Edit(arg1.to_string()),
|
||||
"/edit" => Command::Edit(".".to_string()),
|
||||
"/mcp" if arg1.is_empty() => {
|
||||
Command::McpOpen
|
||||
}
|
||||
"/mcp" if arg1.is_empty() => Command::McpOpen,
|
||||
"/mcp" if arg1 == "add" && !arg2.is_empty() => {
|
||||
let rest = arg2.trim();
|
||||
if let Some(space) = rest.find(' ') {
|
||||
@@ -58,7 +57,10 @@ pub fn parse_command(text: &str) -> Command {
|
||||
let command = rest[space + 1..].trim().to_string();
|
||||
Command::McpAdd { name, command }
|
||||
} else {
|
||||
Command::McpAdd { name: rest.to_string(), command: String::new() }
|
||||
Command::McpAdd {
|
||||
name: rest.to_string(),
|
||||
command: String::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
"/model" => Command::ModelList,
|
||||
|
||||
Reference in New Issue
Block a user