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:
asepharyana
2026-07-12 03:19:25 +07:00
parent 36573e7e3b
commit df5775a272
9 changed files with 193 additions and 1468 deletions
+4 -2
View File
@@ -83,10 +83,12 @@ pub fn draw_chat(frame: &mut Frame, area: Rect, state: &crate::app::state::rest:
display_lines.push(Line::from(Span::raw("")));
}
if state.misc.thinking {
if state.turn_in_flight() {
let spinner_frames = ["", "", "", "", "", "", "", "", "", ""];
let frame = spinner_frames[(state.misc.tick_count as usize / 2) % spinner_frames.len()];
display_lines.push(Line::from(vec![
Span::styled(" AI ", Style::default().fg(Theme::BG).bg(Theme::ROLE_ASSISTANT).add_modifier(Modifier::BOLD)),
Span::styled(" Thinking...", Style::default().fg(Theme::DIM)),
Span::styled(format!(" {} Generating...", frame), Style::default().fg(Theme::DIM)),
]));
display_lines.push(Line::from(Span::raw("")));
}
+5 -3
View File
@@ -10,12 +10,14 @@ pub fn draw_status_bar(frame: &mut Frame, area: Rect, state: &crate::app::state:
// PROG → turn is in flight
// READY → connected and ready
// NOAPI → disconnected
let spinner_frames = ["", "", "", "", "", "", "", "", "", ""];
let (agent_status, conn_color) = if state.turn_in_flight() {
("PROG", Theme::MODE_YOLO)
let frame = spinner_frames[(state.misc.tick_count as usize / 2) % spinner_frames.len()];
(format!("{} PROG", frame), Theme::MODE_YOLO)
} else if state.misc.api_connected {
("READY", Theme::MODE_AUTO)
("READY".to_string(), Theme::MODE_AUTO)
} else {
("NOAPI", Theme::DIM)
("NOAPI".to_string(), Theme::DIM)
};
let status = Span::styled(
format!(" {} ", agent_status),