Refactor scrolling methods in ScrollState to accept an amount parameter
- Updated `scroll_up` and `scroll_down` methods to take an `amount` parameter for more flexible scrolling. - Removed the `AgentMode` enum and related methods from the types module to simplify state management. - Modified `AppStateRest` to remove the `mode` field and adjusted related logic. - Enhanced `run_subagent` to build tool definitions and handle API key resolution from configuration. - Updated command parsing to reflect changes in login handling. - Removed onboarding overlays and related logic from input handling and rendering. - Improved status bar to reflect connection status and agent readiness. - Adjusted workflow panel rendering to simplify phase status display. - Refactored edit log initialization to load from disk if available. - Updated settings structure to use a HashMap for API keys. - Enhanced error handling in LlmClient for authentication issues.
This commit is contained in:
+25
-25
@@ -6,38 +6,38 @@ use ratatui::Frame;
|
||||
use super::theme::Theme;
|
||||
|
||||
pub fn draw_status_bar(frame: &mut Frame, area: Rect, state: &crate::app::state::rest::AppStateRest) {
|
||||
let left_text = Span::styled(
|
||||
" [zesdex] ",
|
||||
// Connection status — reflects actual agent readiness:
|
||||
// PROG → turn is in flight
|
||||
// READY → connected and ready
|
||||
// NOAPI → disconnected
|
||||
let (agent_status, conn_color) = if state.turn_in_flight() {
|
||||
("PROG", Theme::MODE_YOLO)
|
||||
} else if state.misc.api_connected {
|
||||
("READY", Theme::MODE_AUTO)
|
||||
} else {
|
||||
("NOAPI", Theme::DIM)
|
||||
};
|
||||
let status = Span::styled(
|
||||
format!(" {} ", agent_status),
|
||||
Style::default()
|
||||
.fg(Theme::TEXT)
|
||||
.fg(if agent_status == "NOAPI" { Theme::DIM } else { Theme::BG })
|
||||
.bg(conn_color)
|
||||
.add_modifier(Modifier::BOLD),
|
||||
);
|
||||
|
||||
let agent_status = if state.turn_in_flight() {
|
||||
"PROCESSING"
|
||||
} else if state.misc.api_connected {
|
||||
"READY"
|
||||
} else {
|
||||
"NO API"
|
||||
};
|
||||
let status_color = if state.misc.api_connected {
|
||||
Theme::MODE_AUTO
|
||||
} else if state.turn_in_flight() {
|
||||
Theme::MODE_YOLO
|
||||
} else {
|
||||
Theme::DIM
|
||||
};
|
||||
let center_text = Span::styled(
|
||||
format!(" | {} | {} ", state.settings.provider, agent_status),
|
||||
Style::default().fg(status_color),
|
||||
);
|
||||
// Left chunk: [zesdex] STATUS
|
||||
let mut spans = vec![
|
||||
Span::styled(" [zesdex] ", Style::default().fg(Theme::TEXT).add_modifier(Modifier::BOLD)),
|
||||
status,
|
||||
];
|
||||
|
||||
let right_text = Span::styled(
|
||||
format!(" | {} ", state.settings.model),
|
||||
// Right chunk: provider · model
|
||||
spans.push(Span::styled(
|
||||
format!(" {} · {} ", state.settings.provider, state.settings.model),
|
||||
Style::default().fg(Theme::DIM),
|
||||
);
|
||||
));
|
||||
|
||||
let line = Line::from(vec![left_text, center_text, right_text]);
|
||||
let line = Line::from(spans);
|
||||
|
||||
let block = Block::default()
|
||||
.style(
|
||||
|
||||
Reference in New Issue
Block a user