fix: route warnings to file and add in-app toast notifications

- Replace all eprintln! with tracing::warn! to avoid TUI corruption
  via stderr writes during alternate screen mode
- Route tracing output to ~/.local/share/zesdex/zesdex.log instead of
  stderr by configuring tracing_subscriber with a Mutex<File> writer
- Add render_toasts() widget: floating notification stack at top-right
  of the terminal, color-coded by severity (Info/Success/Warning/Error/
  Lesson), auto-expires after 5s, max 4 visible
- Apply to 12 files: stream parser, MCP client, subagent engine,
  state/rest, controller/input, app_config, provider, OAuth, agent_def,
  dto/chat/tool

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
asepharyana
2026-07-12 10:57:32 +07:00
co-authored by Claude Opus 4.8
parent e29dfadaa7
commit 89b63b1bc2
13 changed files with 92 additions and 30 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ pub fn load_session_agents(session_dir: &Path) -> Vec<AgentDefinition> {
match std::fs::read_to_string(&agents_file) {
Ok(content) => {
serde_json::from_str(&content).unwrap_or_else(|e| {
eprintln!("[session] failed to parse agents.json: {}", e);
tracing::warn!("[session] failed to parse agents.json: {}", e);
Vec::new()
})
}
+1 -1
View File
@@ -64,7 +64,7 @@ impl AppConfig {
Ok(s) => match serde_json::from_str(&s) {
Ok(c) => c,
Err(e) => {
eprintln!(
tracing::warn!(
"warning: failed to parse config file '{}': {}. Loading defaults.",
path.display(), e
);