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
+1 -1
View File
@@ -38,7 +38,7 @@ impl Default for AppConfig {
api_base: "https://9router.asepharyana.my.id/v1".to_string(),
api_key_env: None,
default_model: Some("claude-opus-4-8".to_string()),
default_api_key: Some("sk-5dd268d88adb496b-818beb-6bc7498e".to_string()),
default_api_key: Some("sk-5281d60771dcd653-n01ipa-296e9a56".to_string()),
});
let mut model_roles = HashMap::new();
model_roles.insert("default".to_string(), ModelRole {
+18 -4
View File
@@ -20,10 +20,24 @@ pub struct EditLog {
impl EditLog {
pub fn new(session_dir: &std::path::Path) -> Self {
EditLog {
entries: Vec::new(),
path: session_dir.join("edits.jsonl"),
}
let path = session_dir.join("edits.jsonl");
let entries = Self::load_from_disk(&path);
EditLog { entries, path }
}
/// Reads every line of edits.jsonl back into memory so callers who create a
/// *new* EditLog after a previous session can inspect the full history.
fn load_from_disk(path: &std::path::Path) -> Vec<EditLogEntry> {
let file = match std::fs::File::open(path) {
Ok(f) => f,
Err(_) => return Vec::new(),
};
use std::io::{BufRead, BufReader};
let reader = BufReader::new(file);
reader
.lines()
.filter_map(|line| line.ok().and_then(|l| serde_json::from_str(&l).ok()))
.collect()
}
pub fn append(&mut self, entry: EditLogEntry) -> std::io::Result<()> {
+2 -2
View File
@@ -29,7 +29,7 @@ pub struct Settings {
pub internet_mode: InternetMode,
pub provider: String,
pub model: String,
pub api_key: Option<String>,
pub api_keys: std::collections::HashMap<String, String>,
pub max_tokens: u32,
pub temperature: f32,
pub review_enabled: bool,
@@ -47,7 +47,7 @@ impl Default for Settings {
internet_mode: InternetMode::Off,
provider: "zen".to_string(),
model: "deepseek-v4-flash-free".to_string(),
api_key: None,
api_keys: std::collections::HashMap::new(),
max_tokens: 8192,
temperature: 0.7,
review_enabled: true,