Refactor verdict handling and editor state management
- Removed the Escalate variant from the Verdict enum and associated parsing logic. - Cleaned up the EditorState struct by removing unused fields and methods. - Simplified MCP connection functions by removing unnecessary disconnect and handle dismiss functions. - Added tick count to MiscState for managing UI updates during processing. - Updated chat and status views to display a spinner during AI processing using the tick count. - Created a README.md file to document the project, its features, architecture, usage, key bindings, agent modes, security measures, installation instructions, and configuration details.
This commit is contained in:
@@ -8,16 +8,6 @@ pub struct EditorState {
|
||||
pub undo_stack: Vec<Vec<String>>,
|
||||
pub cursor_line: usize,
|
||||
pub cursor_col: usize,
|
||||
pub scroll_offset: usize,
|
||||
pub active: bool,
|
||||
pub mode: EditorMode,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum EditorMode {
|
||||
Normal,
|
||||
Insert,
|
||||
Visual,
|
||||
}
|
||||
|
||||
impl Default for EditorState {
|
||||
@@ -28,9 +18,6 @@ impl Default for EditorState {
|
||||
undo_stack: Vec::new(),
|
||||
cursor_line: 0,
|
||||
cursor_col: 0,
|
||||
scroll_offset: 0,
|
||||
active: false,
|
||||
mode: EditorMode::Normal,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -41,7 +28,6 @@ impl EditorState {
|
||||
EditorState {
|
||||
path,
|
||||
content,
|
||||
active: true,
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
@@ -160,29 +146,6 @@ impl EditorState {
|
||||
pub fn as_string(&self) -> String {
|
||||
self.content.join("\n")
|
||||
}
|
||||
|
||||
pub fn close(&mut self) {
|
||||
self.active = false;
|
||||
}
|
||||
|
||||
pub fn toggle_mode(&mut self) {
|
||||
self.mode = match self.mode {
|
||||
EditorMode::Normal => EditorMode::Insert,
|
||||
EditorMode::Insert => EditorMode::Normal,
|
||||
EditorMode::Visual => EditorMode::Normal,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct AppEditorState {
|
||||
pub editor: Option<EditorState>,
|
||||
}
|
||||
|
||||
impl AppEditorState {
|
||||
pub fn new() -> Self {
|
||||
AppEditorState { editor: None }
|
||||
}
|
||||
}
|
||||
|
||||
pub fn handle_editor_input(state: &mut AppStateRest, text: String) {
|
||||
|
||||
Reference in New Issue
Block a user