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:
asepharyana
2026-07-12 03:14:52 +07:00
parent 71d3494372
commit 36573e7e3b
28 changed files with 435 additions and 482 deletions
+2 -4
View File
@@ -5,8 +5,7 @@ pub mod editor;
pub mod effort;
pub mod key_input;
pub mod mcp;
pub mod onboard;
pub mod onboard_provider;
pub mod quit_confirm;
pub mod rewind;
pub mod security;
@@ -22,8 +21,7 @@ pub enum ModeKind {
Help,
Settings,
QuitConfirm,
Onboard,
OnboardProvider,
KeyInput,
Editor,
Effort,
-12
View File
@@ -1,12 +0,0 @@
use crate::app::state::rest::AppStateRest;
use crate::app::state::types::Overlay;
pub fn complete_onboarding(state: &mut AppStateRest) {
state.misc.overlay = Overlay::None;
state.dirty = true;
}
pub fn skip_onboarding(state: &mut AppStateRest) {
state.misc.overlay = Overlay::None;
state.dirty = true;
}
-20
View File
@@ -1,20 +0,0 @@
use crate::model::settings::Settings;
pub const PROVIDERS: &[&str] = &["Zen API", "Router", "OpenAI"];
pub fn set_provider(settings: &mut Settings, provider: &str) {
settings.provider = match provider {
"Zen API" => "zen".to_string(),
"Router" => "router".to_string(),
"OpenAI" => "openai".to_string(),
_ => "zen".to_string(),
};
}
pub fn set_api_key(settings: &mut Settings, key: String) {
settings.api_key = Some(key);
}
pub fn set_model(settings: &mut Settings, model: String) {
settings.model = model;
}